Convolution of spectrum with custom line shape

General forum for EasySpin: questions, how to's, etc.

Convolution of spectrum with custom line shape

Postby katarkon » Thu Jan 18, 2018 3:26 am

I need help to understand how to make the spectrum with custom line shape (without 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));

What I do wrong?
katarkon
Local Expert
 
Posts: 101
Joined: Mon Jan 12, 2015 4:01 am

Return to General forum

Who is online

Users browsing this forum: No registered users and 3 guests

cron