n [0:127];
x1 sin(2*pi*30*n/128); X1 abs(fft(x1));
x2 sin(2*pi*30.5*n/128); X2 abs(fft(x2));
subplot(2,1,1),plot(n,X1), axis( [0 64 0 70]),
title(`(a) Sinewave at 30 Hz'),
subplot(2,1,2),plot(n,X2), axis([0 64 0 70]),
title(`(b) Sinewave at 30.5 Hz'),
xlabel(`Frequency,Hz');
A solution to this problem is to make the frequencies f
k
kf
s
=N more closely spaced,
thus matching the signal frequencies. This may be achieved by using a larger DFT size
N to increase the computational frequency resolution of the spectrum. If the number
of data samples is not sufficiently large, the sequence may be expanded by adding
additional zeros to the true data, thus increasing the length N. The added zeros serve
to increase the computational frequency resolution of the estimated spectrum to the
true spectrum without adding additional information. This process is simply the
interpolation of the spectral curve between adjacent frequency components. A real
improvement in frequency resolution can only be achieved if a longer data record is
available.
A number of problems have to be avoided in performing non-parametric spectral
analysis such as aliasing, finite data length, spectral leakage, and spectral smearing.
The effects of spectral leakage and smearing may be minimized by windowing the
data using a suitable window function. These issues will be discussed in the following
section.
7.3.2 Spectral Leakage and Resolution
The data that represents the signal of length N is effectively obtained by multiplying all
the sampled values in the interval by one, while all values outside this interval are
multiplied by zero. This is equivalent to multiplying the signal by a rectangular window
of width N and height 1, expressed as
wn 1
,
0 n N À 1
0,
otherwise.
&
7:3:2
In this case, the sampled data x
N
n is obtained by multiplying the signal x(n) with the
window function w(n). That is,
x
N
n wnxn xn, 0 n N À 1
0,
otherwise.
&
7:3:3
The multiplication of x(n) by w(n) ensures that x
N
n vanishes outside the window. As
the length of the window increases, the windowed signal x
N
n becomes a better
approximation of x(n), and thus X(k) becomes a better approximation of the DTFT
X!.
324
FAST FOURIER TRANSFORM AND ITS APPLICATIONS