Digital Signal Processing Reference
In-Depth Information
We obtain the following:
X ð0Þ¼4:25
X ð1Þ¼2:23 j1:22
X ð2Þ¼0:53
X ð3Þ¼2:23 þ j1:22
NT ¼
1
4$0:01 ¼ 25 Hz
D f ¼
Applying Equations (4.19) , (4.22), and (4.23), we achieve
A 0 ¼ 1
4 jX ð0Þj ¼ 1:0625; f 0 ¼ tan 1
0
4:25
P 0 ¼ 1
¼ 0 0 ;
4 2 jX ð0Þj 2 ¼ 1:1289
4 jX ð1Þj ¼ 0:6355; f 1 ¼ tan 1 1:22
A 1 ¼ 1
P 1 ¼ 1
¼151:32 0 ;
4 2 jX ð1Þj 2 ¼ 0:4308
2:23
4 jX ð2Þj ¼ 0:1325; f 2 ¼ tan 1
A 2 ¼ 1
0
0:53
P 2 ¼ 1
¼ 0 0 ;
4 2 jX ð2Þj 2 ¼ 0:0176
Similarly,
4 jX ð3Þj ¼ 0:6355; f 3 ¼ tan 1 1:22
A 3 ¼ 1
P 3 ¼ 1
4 2 jX ð3Þj 2 ¼ 0:4308
¼ 151:32 0 ;
2:23
EXAMPLE 4.11
Given the sinusoid
n
8; 000
xðnÞ¼2$sin
2; 000p
obtained using a sampling rate of
f s ¼ 8; 000 Hz, use the DFT to compute the spectrum with the following
specifications:
a. Compute the spectrum of a triangular window function with window size ¼ 50.
b. Compute the spectrum of a Hamming window function with window size ¼ 100.
c. Compute the spectrum of a Hanning window function with window size ¼ 150 and a one-sided spectrum.
Solution:
The MATLAB program is listed in Program 4.2, and results are plotted in Figures 4.19 to 4.21 . As compared with
the no-window (rectangular window) case, all three windows are able to effectively reduce the spectral leakage, as
shown in the figures.
Program 4.2. MATLAB program for Example 4.11.
%Example 4.11
close all;clear all
% Generate the sine wave sequence
fs ¼ 8000; T ¼ 1/fs; % Sampling rate and sampling period
x ¼ 2*sin(2000*pi*[0:1:50]*T); % Generate 51 2000-Hz samples.
% Apply the FFT algorithm
N ¼ length(x);
Search WWH ::




Custom Search