Digital Signal Processing Reference
In-Depth Information
Therefore, the first adjustment we make to our strict definition is to modify (9.1)
to reflect the fact that we will have only a finite number of samples of x(n) with
which to work. Equation (9.2) shows the definition when we assume that we have
only N samples of the signal data:
N
=
1
j
ω
n
X
(
ω
)
=
x
(
n
)
e
(9.2)
n
0
Truncating the signal sequence as in (9.2) is effectively applying a rectangular
window to the time domain sequence. This causes problems in the resulting
frequency domain description which can be lessened by applying a different
window such as one used in Chapter 7 dealing with FIR filter coefficients. The
impact of such a window will be discussed very soon.
If we further assume that we'll only need to evaluate the frequency response
data at a finite number of equally spaced frequencies from 0 - 2π, we have the
definition of the K- point DFT of an N- point signal.
=
=
N
1
j
ω
n
X
(
ω
)
x
(
n
)
e
,
k
=
0
,
1
,
, K-
1
k
k
(9.3)
n
0
2
π
k
where
ω
=
k
K
Example 9.1 Calculation of DFT with Rectangular Window
Problem: Determine the DFT of an audio signal containing three distinct
frequencies of F 1 = 2 kHz, F 2 = 3 kHz, and F 3 = 4 kHz. Assume that the sampling
frequency is F s = 20 kHz and that we make use of either 20 or 40 samples of the
waveform. Use a rectangular window (in other words, simply truncate the
sequence).
Solution: First, we generate a waveform containing the three frequencies.
x
(
n
)
=
sin(
2
π
F
n
/
F
)
+
sin(
2
π
F
n
/
F
)
+
sin(
2
π
F
n
/
F
)
1
s
2
s
3
s
Then, we calculate the DFT using (9.3) letting K = 1,000 points. (This gives us a
near continuous frequency response.) The results are shown in Figure 9.1.
Although not shown, if we had used a large number of data points ( N = 1,000), the
DFT graphs would have shown six very distinct spikes in the frequency domain
with far less “clutter” at other frequencies. (There are six major responses in the
spectrum because the content from 10 kHz to 20 kHz is a mirror reflection of the
 
Search WWH ::




Custom Search