In the SE Chemistry forum, someone posted an interesting question on converting a scaled and shifted delta function into Lorentzian by convolution please see "simulating a molecular spectrum". The OP was observing shifts on the x-axis after the convolution of his deltas' with a Lorentzian. This was obviously due to an incorrectly chosen center of the Lorentzian.

In convolution, the horizontal centroids add. So I suggested that a zero centered Lorentzian should be convoluted with the shifted delta and after that there will be no shift on the x-axis i.e., if the delta function is at x=t, after convoluting with a zero centered Lorentzian, there will be a Lorentzian at t - the desired location.

Another user suggested another alternative. His suggestion was that one can also center the Lorentzian at the mean of the x-axis values, $\mu$, and convolute this mean centered Lorentzian with the deltas. There will be no shifts, and indeed this was observed.

The query is: Centroids add in convolution. It is understandable that when delta was shifted at x=t, and Lorentzian was centered at zero, so the resulting Lorentzian was centered at t+0=t.

Now, why is the other alternative working? This time the delta is at t, and the Lorentzian is centered at $\mu$, the resulting convolution should be at t+$\mu$, but still the deltas do not shift. What is the mathematical basis of getting the same results?

Here is a MATLAB code for a demo.

%Assigning variable names
x=[6200:2:6700-2]'; % x axis
Int=cat(1, zeros(80,1), 1, zeros(169,1)); %
Delta= x(2,1)-x(1,1); % Sampling interval

% Zero centered Lorentzian parameter;
N=[-(length(x/2)):Delta:length(x/2)-Delta]'; % x-axis for the zero centered Lorentzian
A= 1; %amplitude
W= 10; %full width at half maximum
M=0; %centered peak

L1= A./(1+4*((N-M).^2/W.^2)); % Lorentzian equation

% Mean centered Lorentzian parameters
L2=A./(1+4*((x-mu).^2/W.^2)); % Lorentzian equation

F1=conv(Int, L1, 'same');
F2=conv(Int, L2, 'same');

figure (1)
stem(x, Int,'.');
xlabel('time'); ylabel ('signal'); title ('shifted impulse')
xlabel('time'); ylabel ('signal'); title ('zero centered Lorentzian for convolution')
subplot (1,3,3)
xlabel('time'); ylabel ('signal'); title ('impulse*zero centered Lorentzian')

stem(x, Int,'.');
xlabel('time'); ylabel ('signal'); title ('shifted impulse')
subplot (1,3,2)
plot(x, L2)
xlabel('time'); ylabel ('signal'); title ('"mean time" centered Lorentzian for convolution')
subplot (1,3,3)
xlabel('time'); ylabel ('signal'); title ('impulse*mean time centered Lorentzian')

Figure 1

Figure 2



It would be better to show that property using pencil and paper, because you're fooling yourself with that Matlab code. Of course we have

$$\delta[n-n_0]\star g[n]=g[n-n_0]\tag{1}$$

Now define $h[n]=g[n-n_1]$. According to $(1)$ we have

$$\delta[n-n_0]\star h[n]=h[n-n_0]\tag{2}$$

And, consequently, with $h[n]=g[n-n_1]$,

$$\delta[n-n_0]\star g[n-n_1]=g[n-n_0-n_1]\tag{3}$$

No need to waste computing power to show this.

  • $\begingroup$ Thanks, I did not get the gist of your point, g[n-n0] and g[n-n0-n1] are not at the same locations. And where is the mean of the x-axis, as suggested by one user. I am not a DSP engineer, my background is chemistry. $\endgroup$ – M. Farooq Jul 29 '20 at 19:20
  • 1
    $\begingroup$ @M.Farooq: The point is that convolution with a Dirac impulse $\delta[n-n_0]$ shifts the convolved function $n_0$ samples to the right. If the function is already shifted by some other value $n_1$ then the total shift is $n_0+n_1$. So the equivalency that you're trying to prove doesn't exist. $\endgroup$ – Matt L. Jul 29 '20 at 20:17
  • $\begingroup$ Matt, Exactly, as you said, the equivalency does not exist. I think only the zero centered Lorentzian works. It seems like some fallacy as to why the other option is working. How is the MATLAB fooling us with the mean centered Lorentzian? $\endgroup$ – M. Farooq Jul 29 '20 at 23:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.