I have come across a peculiarity of FFTs which has got me somewhat baffled. I've simply summed up 101 sine waves and taken the FFT using this matlab script :
clear all
f=1e9; % Centre Frequency 1GHz
df=2.5e6; % Carrier Frequency 2.5MHz
Time=linspace(-100e-9,100e-9,1000); % Region of time to simulate over
delay=0;
Voltage=Time.*0; % Initialise Voltages to zero
for loop=-50:50 % Sum 101 carrier Frequencies
Voltage=Voltage+sin(2.*pi().*(f+df.*loop).*(Time-delay));
end
figure(1) %Plot Time dependent response
subplot(2,1,1)
plot(Time,Voltage)
subplot(2,1,2) %Plot Frequency Content
dt=Time(2)-Time(1);
frequency=linspace(-0.5/dt,0.5/dt,1000);
spectrum=fftshift(fft(Voltage));
plot(frequency,abs(spectrum))
The output is as I had expected, with the correct frequency content :
However, if I simply add a significant time delay (by re-running the script with delay=150e-9;
, such that the main constructive interference lobe disappears outside the calculation window) the frequency content of the resulting time trace collapses to two peaks.
However the time trace is still the summation of 101 sin waves albeit now out of phase because of the introduced delay ?? Intuitively I would have expected the absolute frequency content of the trace to be preserved and only the phases modified by the delay. Upon reflection I can perhaps understand that the frequency content must be modified on energy conservation grounds, but can anybody rationalise what is going on here ?