I tried to deconvolute a measured spectrum (Sm) with the pure spectrum (S0) to get the apodization and instrument line shape. Here are the files: Sm and S0
However, I found that the result of my ifft of Sm and S0 are similar. It should give me Gaussian line shape, but I got triangular. What is my mistake and how to solve it? Thank you in advance.
close all
clear all
clc
sm=load('n2o_gaussian.txt'); %loading spectrum with gaussian ILS
s0=load('n2o_noapodization.txt'); %loading pure spectrum
v=s0(:,1); %wavenumber of pure spectrum
s0_y=s0(:,2); %y component of S0
L=length(v); %length of data
n=2^(nextpow2(L)*2); %number of the next power of two data for FFT
vm=sm(:,1); %wavenumber of measured spectrum
v0=2217.241; %v0 is peak location
vv0=v*ones(1,length(v0))-ones(length(v),1)*v0; %vv0 is wavenumber difference
sm_interpl=interp1( vm, sm, v, 'spline',0); %fit the measured spectrum to match the grid
%pure spectrum
sm_interpl_y=sm_interpl(:,2); %y component of Sm
%y-deconvolution of Sm with S0
s0_y_ift=ifft(s0_y,n,'symmetric'); %inverse FFT of pure spectrum, the symmetric option
enforces imaginary part should be zero in DFT
s0_y_ift=fftshift(s0_y_ift);
sm_interpl_ift=ifft(sm_interpl_y,n,'symmetric'); %inverse FFT of measured spectrum, without
symmetric, half of amplitude will lost
sm_interpl_ift=fftshift(sm_interpl_ift);
apo_y=(sm_interpl_ift)./(s0_y_ift); %get the apodization function from division of sm
and s0
ILS_y=fft(apo_y,n); %get the ILS
ILS_y2=fftshift(ILS_y);
%normalize the area of ILS
area=trapz(f,ILS_y2);
ILS_y2_normalized=ILS_y2./area;
%showing spectra and spline result
figure (1)
plot (sm(:,1),sm(:,2),'o');
hold on;
plot (sm_interpl(:,1),sm_interpl(:,2));
hold on
plot (s0(:,1),s0(:,2));
legend('Measured spectrum','fitted spectrum','pure spectrum')
hold on;
%showing interferogram results
figure (2)
plot(real(sm_interpl_ift))
hold on
plot(real(s0_y_ift))
legend('interferogram of Sm','interferogram of S0')
hold on
%showing apodization function
figure (3)
plot(real(apo_y))
legend('apodization function')
hold on
%showing retrieved ILS
figure (4);
plot(f,real(ILS_y2_normalized));
xlim([-0.0001 0.0001]);
legend('ILS');
hold on;