Fourier Analysis of Signals Using the DFT ECE 535 Lecture April 29, 23 Overview: Motivation Many applications require analyzing the frequency content of signals Speech processing study resonances of vocal tract Radar Doppler processing Sonar study channel effects on long-range transmissions Basic spectral analyzer setup Windowing Frequency-sampling Relating DFT output to CT spectrum Examples Time-dependent Fourier transform
Basic spectral analyzer s c (t) Anti-Alias C/D x c (t) Filter (or A/D) x[n] v[n] Conversion N-point DFT V [k] w[n] Anti-alias filtering and A/D conversion for tonight assume negligible errors Windowing operation Necessary because DFT only works on finite-length sequences. Typically use same windows as for filter design Frequency-sampling Use FFT to compute samples of the DTFT Understanding windowing & frequency-sampling crucial to interpreting results
Windowing and frequency-sampling What does the windowing operation do? v[n] = w[n] x[n] +π F V (e jω ) = 1 X(e jθ )W (e j(ω θ) )dθ 2π π }{{} convolution of X(e jω ) with W (e jω ) Convolution with window function smears the spectrum of x[n] Smoothes sharp peaks and discontinuities What is the output of the N-point DFT operation? V [k] = N 1 n= 2πkn j v[n]e N k =,..., N 1 = V (e jω ) ω= 2πk N DFT is samples of the DTFT evenly spaced around the unit circle
Relating DFT output to the CT spectrum Suppose x c (t) is sampled at a rate of f s = 1 T. What CT frequencies correspond to the N DFT samples? Recall relationship between DT and CT frequencies: ω = ΩT Thus the CT frequency associated with the kth bin is: Ω k = ω k T = 2πk NT = 2πkf s N Using this relationship, we create a vector of analog frequencies to plot the spectrum with Consider analyzing a signal consisting of 2 sinusoids
Two sinusoid example Consider s c (t) equal to the sum of 2 sinusoids: (sinusoid = sum of 2 eigenfxns) The sampled signal x[n] becomes: s c (t) = A cos(ω t) + A 1 cos(ω 1 t) x[n] = A cos(ω n) + A 1 cos(ω 1 n) ω = Ω T ω 1 = Ω 1 T The windowed signal v[n] is: v[n] = A w[n] cos(ω n) + A 1 w[n] cos(ω 1 n) = A 2 w[n] ( e jω n + e jω n ) + A 1 2 w[n] ( e jω 1n + e jω 1n ) Taking the DTFT: V (e jω ) = A { } W (e j(ω ω) ) + W (e jω+ω ) + A { } 1 W (e j(ω ω1) ) + W (e jω+ω 1 ) } 2 {{ 2 } copies of W (e jω ) at ±ω, ±ω 1
Two effects of the window Resolution controlled by mainlobe width high resolution requires narrow ML Leakage controlled by sidelobe height energy at ω leaks out and can mask lower power signal at ω 1 What controls mainlobe width? length of window primary factor type of window secondary factor e.g., Hanning has wider ML than boxcar What controls sidelobe height? type of window see table in Ch. 7 Consider example
Example (compare to 1.3 in text) 6 4 2 W(e jω ) 3 2 1 V(e jω ) π π 64-point rectangular window Mainlobe width 4π 64 π π v[n] = A cos(ω n) + A 1 cos(ω 1 n) A = 1, A 1 =.75 ω = 2π 6, ω 1 = 2π 3 copies of W (e jω ) at ± 2π 6, ±2π 3
Example 1.3 continued V(e jω ) V(e jω ) 3 3 2 2 1 1 π π A = 1, A 1 =.75 ω = 2π 14, ω 1 = 4π 15 π π A = 1, A 1 =.75 ω = 2π 14, ω 1 = 2π 12 As sinusoids move closer together, leakage causes change in amplitudes
Example 1.3 continued V(e jω ) 3 2 1 Sinusoids not resolved when they move close enough Mainlobe width 4π 64 =.625π ω 1 ω =.171π π π A = 1, A 1 =.75 ω = 2π 14, ω 1 = 4π 25 Consider Matlab demo
Matlab demo: windowsine demo1 Parameters: Sampling frequency: f s = 1 Hz Window length: 1 points 1 second of data DFT length: 8192 points (lots of samples!) x c (t) consists of the sum of two sinewaves a 5 Hz sinewave a sinewave of varying frequency: 1 Hz (1st case) to 5 Hz (last case) See what happens to spectral plot
Spectral sampling Consider a 64-point section of v[n] = A cos(ω n) + A 1 cos(ω 1 n) where A = 1, A 1 =.75 ω = 2π 14, ω 1 = 4π 25 3 V[k] 3 V(e jω ) 2 2 1 1 2 4 6 Results of 64-point DFT π 2.π DTFT (shown between and 2π) DFT is samples of the DTFT
Spectral sampling can be misleading! Consider a 64-point section of v[n] = A cos(ω n) + A 1 cos(ω 1 n) where A = 1, A 1 =.75, ω = 2π 16, ω 1 = 2π 8 3 V[k] 3 V(e jω ) 2 2 1 1 2 4 6 Results of 64-point DFT Samples at zero-crossings of DTFT π 2.π DTFT (shown between and 2π) We can zero-pad v[n] and take a larger FFT to get more samples
Zero-padding V[k] 3 2 1 5 1 Results of padding v[n] with 64 zeros and taking 128-pt DFT Samples no longer at zerocrossings of DTFT Clean look of 64-point DFT was a bit of an illusion because samples occured at zero-crossings of spectrum Can zero-padding improve resolution? Consider Matlab demo
Zero-padding Matlab demo: windowsine demo2 Parameters: x c (t) consists of the sum of two sinewaves a 5 Hz sinewave a 5.5 Hz sinewave Sampling frequency: f s = 1 Hz Window length: 1 points 1 second of data DFT length varies from 128 to 32768 See what happens to spectral plot
Why aren t the sinusoids resolved in windowsine demo2? Window: 1 point rectangular window Mainlobe width: ω ML = 4π 1 Ω ML = 4π 1 f s = 4π 1 1 = 4π Thus the mainlobe width corresponds to approximately 2 Hz Since the sinewaves are.5 Hz apart, they won t be resolved Better resolution requires longer window (more data!) Consider third Matlab demo
Matlab demo: windowsine demo3 This demo illustrates how increasing the window length improves resolution Parameters: x c (t) consists of the sum of two sinewaves a 5 Hz sinewave a 5.5 Hz sinewave Sampling frequency: f s = 1 Hz DFT length: 8192 points (lots of samples!) Window length varies from 1 to 1 in increments of 25 See what happens to spectral plot