I'm trying to simulate the 2nu2 band of HCN in MATLAB. I generate a stick spectrum from the data I have (taken from the HITRAN database) and then use
conv() to apply my line shape function. However, when I plot the data, the broadened spectrum does not line up with the stick spectrum at all. I cannot figure out what it is that I'm doing wrong or what I need to change to align the spectra. Does anyone know what is I need to fix or a resource I could use to solve this issue?
This is the spectrum I've simulated:
and the function I use to generate the spectrum is
function f = func() HCN2nu2 = importdata('I:/HCN 2nu2.txt'); HCN = HCN2nu2(1:111,1:2); AX = HCN2nu2(1:111,2); v = ; s = ; L = ; q = 1; p = HCN(q); increase = false; for i = 6200:0.01:6700 for x = 1:111 if i == round(HCN(x,1), 2) z = AX(x); increase = true; break else z = 0; end end v = [v; i]; s = [s; z]; if increase == true q = q + 1; increase = false; if q > 111 q = 111; end end t = (1/(1 + ((i - p)/0.5)^2)); L = [L; t]; end hold on plot(v,s) k = conv(L,s, 'same'); plot(v,k) ylim([0 8e-21]); hold off end
Any help would be greatly appreciated
Link to the data file used to generate this spectrum: https://github.com/tkh97/HCN-2nu2.git