convspec
function). I suppose that IFFT images of stick spectrum and shape array of the same size should be multiplied and FFT should be applied back. Also, the zeroes should be added at both ends of the arrays to awoid artifacts appearing. But this procedure gives unexpected results. Here the example:
Code: Select all
clear;
Exp.Range=[340 350];
Exp.mwFreq=9.65;
Exp.nPoints=4096;
Sys.g=gfree;
Sys.lw=[0 0.5];
Range=[340 350];
pos=342;
npoints=4096;
[x,y]=makespec(Range,npoints,pos);
y1=garlic(Sys,Exp);
z=zeros(1,npoints/2);
y=[z y z];
y1=[z y1 z];
y=ifft(y);
y1=ifft(y1);
y2=y.*y1;
y2=fft(y2);
y2=y2(1+0.5*npoints:1.5*npoints);
plot(x,real(y2));