8 DIGITAL SIGNAL SPECTRA 2018/11/24 8 DIGITAL SIGNAL SPECTRA 2018/11/24
Main Contents Demonstrates how to calculate spectra for nonperiodic signals using DTFT Introduces the discrete Fourier series(DFS) Shows how to calculate spectra for periodic signals using DFS Defines fundamental frequency and harmonic frequency
8.1 THE MEANING OF THE SPECTRUM The smooth transition in a signal come from its low frequency components. Sharp edges and rapid changes come from its high frequency elements.
8.2 NONPERIODIC DIGITAL SIGNALS To calculate the spectra of nonperiodic digital signals using DTFT Truncate:截断
FIGURE 8-4 Rectangular pulse for Example 8.1.
FIGURE 8-6 Spectrum of signal for Example 8.1.
FIGURE 8-7 Magnitude and phase spectra for Example 8.2. Solution:
FIGURE 8-8 The vowel “eee” (2000 samples, fs = 8 kHz)for Example 8. 3 FIGURE 8-8 The vowel “eee” (2000 samples, fs = 8 kHz)for Example 8.3. And its magnitude spectrum. demo: listenMusic.m
8.2 PERIODIC DIGITAL SIGNALS FIGURE 8-10 Periodic digital signals.
The introduction of DFS
DFS DFS:Discrete Fourier Series(离散傅里叶级数)
Fourier Coefficients
Fourier Coefficients
frequency
frequency
FIGURE 8-11 Comparing DTFTs and DFSs for digital signals.
Comparing DTFT and DFS for digital signals ck is the sample of DTFT ck OR X(k) See P461 Figure 11.28
FIGURE 8-12 Magnitude spectrum for a periodic signal.
FIGURE 8-13 Digital signal for Example 8.4.
FIGURE 8-14 Spectrum of signal for Example 8.4.
FIGURE 8-14 Spectrum of signal for Example 8.4.
FIGURE 8-15 Digital sine wave for Example 8.5. SOLUTION:
MATLAB realization clear; N=10; n=0:1:(N-1); x=sin(n*pi/5); for k=0:1:(N-1) ef=exp(-j*2*pi/N*k*n); Ck(k+1)=sum(x.*ef); end k=0:(N-1); subplot(2,1,1); stem(k,abs(Ck)/N); subplot(2,1,2); stem(k,angle(Ck));
?
FIGURE 8-16 Spectrum of sine wave for Example 8.5.
analysis
FIGURE 8-17 Spectrum of signal for Example 8.6. SOLUTION:
FIGURE 8-17 Spectrum of signal for Example 8.6.
FIGURE 8-18 Artificial “eee” signal for Example 8.7.
MATLAB realization % exm_8_7.m fs=8000; n=0:(8000-1); f1=200; f2=400; W1=2*pi/fs*f1; W2=2*pi/fs*f2; x=2/3*sin(W1*n)+1/6*sin(W2*n); sound(x,fs); X=fft(x,1024); plot(abs(X(1:512)));
FIGURE 8-19 Magnitude spectrum of artificial “eee” sound for Example 8
Notice Leakage For period signal, the sample number must be the multiple of period of signal. demo
summary DTFT:discrete time Fourier transform DFS:discrete Fourier series DFT:discrete Fourier transform FFT:fast Fourier transform
The Relationship
Calculation of DFT