increment=.01;
position=21;
separation=1.5;
width1=.5; % Width of the original signal peak.
width2=1; % Width of the original signal peak.
width3=2; % Width of the original signal peak.
%
% Create simulated signal
x=10:increment:30;
y3=1/width1.*(lorentzian(x,position-separation,width1)+.5.*lorentzian(x,position+separation,width1));  % Create a function y of width w.
y2=1/width2.*(lorentzian(x,position-separation,width2)+.5.*lorentzian(x,position+separation,width2));  % Create a function y of width w.
y1=1/width3.*(lorentzian(x,position-separation,width3)+.5.*lorentzian(x,position+separation,width3));  % Create a function y of width w.

figure(1)
clf
plot(x,y1,x,y2,x,y3,'linewidth',2)
title('Changing peak widths with constant peak area')
grid
xlabel('Narrower peaks results in higher (better) resolution of the peaks')
ylabel('y')

figure(2)
clf
f=1:length(x)/2;
fs1=FrequencySpectrum(x,y1);
fs2=FrequencySpectrum(x,y2);
fs3=FrequencySpectrum(x,y3);

loglog(f,fs1(:,2),f,fs2(:,2),f,fs3(:,2),'linewidth',2)
axis([1 100 1e-2 1e5])
grid
title('Frequency spectra: The narrower the peaks the greater the high-frequency content')
xlabel('Frequency, bin number')
% 
% figure(3)
% loglog(f,fs2(:,2)./fs1(:,2),'.-r',f,fs3(:,2)./fs1(:,2),'.-','color',[0.9290    0.6940    0.1250])
% axis([1 100 1 1e6])
% grid