In the first example, we considered just two fixed frequencies. Now let us consider what happens if we have a signal that is changing with time. In other words, a frequency sweep, as one might do during a shaker test (or perhaps a motor or engine is speeding up or slowing down). We simulate a sine wave ramping up from 2 Hz to 10 Hz over 60 seconds, split up into 60 segments of 1 second each. The top frame shows the instantaneous FFT for each segment (the red marker showing the instantaneous center frequency). The bottom frame shows cumulative history of all of the previous FFTs. i.e. we put ``hold on'' on the matlab figure window 5. No window is applied to the FFT. We make the following observations:
When the signal frequency is aligned with a bin center, we get the full amplitude in that bin. When the signal frequency frequency is centered between two bins, we get a reduced amplitude split between the two bins. It looks as if the signal was changing amplitude at the same time as the frequency is changing. In actuality, the amplitude is constant and the apparent amplitude change is an artifact caused by spectral leakage as explained in the previous section. If we look at the bottom frame, we see an interesting pattern that looks like a picket fence (i.e. a series of triangle shaped ``pickets''). Hence the source of the name: picket fence effect.
We are most concerned about this if we care about the exact amplitude of our signal. If all we want to do with the FFT is to get a general idea of the frequencies involved and the order of magnitude of the amplitudes, then this is not a big deal.
If we do care about the exact amplitude, there are a few options. One is to simply use non-FFT method of extracting the amplitude (e.g. see section 8.4). If your signal is known to contain only a few dominant signals that are well separated in frequency, then it is possible to use the information from several neighboring bins to reconstruct the amplitude and frequency of the original signal. i.e. if you see two adjacent bins that have an equal amplitude of 0.7, then you can infer that they were generated by a signal of amplitude 1 at a frequency in between the 2 bins. But if you see two adjacent bins that have amplitudes of 0.6 and 0.9, you'll know the frequency was slightly biased towards the higher frequency bin. However, if your signal contains multiple frequency components that are closely spaced, this method is not reliable. In that case, the best approach is to use a flat top window, as described in section 6.4.8.
/' $I