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
mu=mean(x)
L2=A./(1+4*((x-mu).^2/W.^2)); % Lorentzian equation
F1=conv(Int, L1, 'same');
F2=conv(Int, L2, 'same');
figure (1)
subplot(1,3,1)
stem(x, Int,'.');
xlabel('time'); ylabel ('signal'); title ('shifted impulse')
subplot(1,3,2)
plot(N,L1)
xlabel('time'); ylabel ('signal'); title ('zero centered Lorentzian for convolution')
subplot (1,3,3)
plot(x,F1)
xlabel('time'); ylabel ('signal'); title ('impulse*zero centered Lorentzian')
figure(2)
subplot(1,3,1)
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)
plot(x,F2)
xlabel('time'); ylabel ('signal'); title ('impulse*mean time centered Lorentzian')
Thanks.