conv gets central frequency wrong in voigt profile if you add the frequency offset twice

6 views (last 30 days)
I can generate a Voigt profile by convolving a Lorentzian and Gaussian line shape using the Matlab conv command. If the Lorentzian and Gaussian line shapes are zero-based, then this works great. But if I have an offset in the x-axis, then that offset gets doubled in the convolution. Here is the code:
clear; close all;
lwid = 1;
gwid = 10;
fzer = -10;
fi = linspace(-100,100,10001);
y1 = (((fi - fzer)./lwid).^2 + 1).^(-1);
y2 = exp(-(fi-fzer).^2 ./ (2*gwid^2));
y3 = conv(y1,y2);
x3 = linspace(2*min(fi),2*max(fi),2*length(fi)-1);
y3 = y3 ./ max(y3);
plot(fi,y1,fi,y2,x3,y3);
The convolution y3 has a "center" frequency at twice fzer. Apparently this can be avoided if you only offset ONE of either the Lorentzian or Gaussian profiles.
  1 Comment
Scott
Scott on 12 Sep 2013
By the way, this only works if the horizontal scale is symmetric about zero. In the above example, if the array is defined as
fi=linspace(-120,90,10001);
then the center frequency of the y3 array is off once again! Be careful!

Sign in to comment.

Accepted Answer

Matt J
Matt J on 12 Sep 2013
Edited: Matt J on 13 Sep 2013
I don't think there's anything out of the ordinary or unexpected in the result you're seeing. It's well known that signal shifts are additive under convolution.
As a simpler example, it is a basic result that the convolution of impulse(t-T1) with impulse(t-T2) is another impulse centered at t=T1+T2.
  2 Comments
Scott
Scott on 13 Sep 2013
Thank you. You are right. In retrospect I should have known this, but somehow I didn't consider it ahead of time. Any ideas about why shifting the min and max of the x-axis array also shifts the convolution?
Matt J
Matt J on 13 Sep 2013
Edited: Matt J on 13 Sep 2013
It won't shift the convolution. It will shift your plot. Presumably though, you want to be using the syntax
conv(y1,y2,'same')
so that you don't have to worry about defining a 2nd x-axis.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!