8.2. LEAKAGE 121
for(j=0; j<L; j++) {
cos = cosine[o];
sin = sine[o];
o = o+n;
for(p=j; p<k; p=p+m) {
q = p+L;
xt = cos*data->real[q] - sin*data->imaginary[q];
yt = sin*data->real[q] + cos*data->imaginary[q];
data->real[q] = data->real[p] - xt;
data->real[p] = data->real[p] + xt;
data->imaginary[q] = data->imaginary[p] - yt;
data->imaginary[p] = data->imaginary[p] + yt;
}
}
n = n>>1;
}
}
Note that, unlike in the DFT code, the twiddle factors ( cos and sin ) are pre-computed and
stored in the cosine and sine lookup tables, respectively. is function takes the same input
structure as the DFT function and performs a transformation which overwrites the input signal
with the transformed signal.
8.2 LEAKAGE
When computing DFT, it is required to assume periodicity with a period of N
s
samples. Fig-
ure 8.1 illustrates a sampled sinusoid which is no longer periodic. In order to make sure that the
sampled version remains periodic, the analog frequency should satisfy this condition [1]:
f
o
D
m
N
s
f
s
; (8.5)
where m denotes number of cycles over which DFT is computed.
When the periodicity constraint is not met, a phenomenon known as leakage occurs.
Figure 8.2 shows the effect of leakage on the FFT computation. In this figure, the FFTs of two
sinusoids with frequencies of 250 Hz and 251 Hz are shown. e amplitudes of the sinusoids
are unity. Although there is only a 1 Hz difference between the sinusoids, the FFT outcomes
are significantly different due to improper sampling. In Figure 8.2a, it can be seen that the signal
energy resides primarily in the 250 Hz band. Leakage causes the signal energy to be spread out
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.86.134