lecture 5 short time fourier transform and filterbanks
play

Lecture 5: Short-Time Fourier Transform and Filterbanks Mark - PowerPoint PPT Presentation

Review STFT Linear Frequency Inverse Nonlinear Frequency Summary Lecture 5: Short-Time Fourier Transform and Filterbanks Mark Hasegawa-Johnson ECE 417: Multimedia Signal Processing, Fall 2020 Review STFT Linear Frequency Inverse


  1. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary Lecture 5: Short-Time Fourier Transform and Filterbanks Mark Hasegawa-Johnson ECE 417: Multimedia Signal Processing, Fall 2020

  2. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary Review: Power Spectrum 1 Short-Time Fourier Transform 2 STFT as a Linear-Frequency Filterbank 3 Optional Stuff: the Inverse STFT 4 Implementing Nonlinear-Frequency Filterbanks Using the STFT 5 Summary 6

  3. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary Outline Review: Power Spectrum 1 Short-Time Fourier Transform 2 STFT as a Linear-Frequency Filterbank 3 Optional Stuff: the Inverse STFT 4 Implementing Nonlinear-Frequency Filterbanks Using the STFT 5 Summary 6

  4. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary Power Spectrum The DFT power spectrum of a signal is defined to be R [ k ] = 1 N | X [ k ] | 2 . This is useful because the signal power is N − 1 N − 1 1 x 2 [ n ] = 1 � � R [ k ] N N n =0 k =0 Similary, the DTFT power spectrum of a signal of length N can be defined to be R ( ω ) = 1 N | X ( ω ) | 2 , because the signal power is � π N − 1 1 x 2 [ n ] = 1 � R ( ω ) d ω 2 π N − π n =0 In this class we will almost never use the power spectrum of an infinite length signal, but if we need it, it can be defined as 2 � � ( N − 1) / 2 � � 1 � x [ n ] e − j ω n � � R ( ω ) = lim � � N N →∞ � � n = − ( N − 1) / 2 � �

  5. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary Autocorrelation The power spectrum of a finite-length signal of length N is R ( ω ) = 1 N | X ( ω ) | 2 Its inverse Fourier transform is the autocorrelation, ∞ r [ n ] = 1 N x [ n ] ∗ x [ − n ] = 1 � x [ m ] x [ m − n ] N m = −∞ Or, if x [ n ] is infinite-length, we can write ( N − 1) / 2 1 � r [ n ] = lim x [ m ] x [ m − n ] N N →∞ m = − ( N − 1) / 2 This relationship, r [ n ] ↔ R ( ω ), is called Wiener’s theorem, named after Norbert Wiener, the inventor of cybernetics.

  6. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary Outline Review: Power Spectrum 1 Short-Time Fourier Transform 2 STFT as a Linear-Frequency Filterbank 3 Optional Stuff: the Inverse STFT 4 Implementing Nonlinear-Frequency Filterbanks Using the STFT 5 Summary 6

  7. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary Spectrogram = 20 log 10 | Short Time Fourier Transform |

  8. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary Short Time Fourier Transform The short-time Fourier Transform (STFT) is the Fourier transform of a short part of the signal. We write either X ( ω k , m ) of X [ k , m ] to mean: The DFT of the short part of the signal that starts at sample m , windowed by a window of length less than or equal to N samples, evaluated at frequency ω k = 2 π k N . The next several slides will go through this procedure in detail, then I’ll summarize.

  9. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary Step #1: Chop out part of the signal First, we just chop out the part of the signal starting at sample m . Here are examples from Librivox readings of White Fang and Pride and Prejudice :

  10. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary Step #2: Window the signal Second, we window the signal. A window with good spectral properties is the Hamming window: � � � 2 π n 0 . 54 − 0 . 46 cos 0 ≤ n ≤ N N − 1 w [ n ] = 0 otherwise

  11. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary Step #2: Window the signal Here is the windowed signals, which is nonzero for 0 ≤ n − m ≤ ( N − 1): x [ n , m ] = w [ n − m ] x [ n ]

  12. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary Step #3: Fourier Transform Finally, we compute the DFT: m +( N − 1) � w [ n − m ] x [ n ] e − j 2 π k ( n − m ) / N X [ k , m ] = n = m Here it is, plotted as a function of k :

  13. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary Spectrogram = 20 log 10 | Short Time Fourier Transform | � � � � � w [ n − m ] x [ n ] e − j 2 π k ( n − m ) / N 20 log 10 | X [ k , m ] | = 20 log 10 � � � � � n � Here it is, plotted as an image, with k =row index, m =column index.

  14. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary Putting it all together: STFT The STFT, then, is defined as ω k = 2 π k � w [ n − m ] x [ n ] e − j ω k ( n − m ) , X [ k , m ] = N n which we can also write as X [ k , m ] = DFT { w [ n ] x [ n + m ] }

  15. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary Outline Review: Power Spectrum 1 Short-Time Fourier Transform 2 STFT as a Linear-Frequency Filterbank 3 Optional Stuff: the Inverse STFT 4 Implementing Nonlinear-Frequency Filterbanks Using the STFT 5 Summary 6

  16. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary STFT as a bank of analysis filters The STFT is defined as: m +( N − 1) � w [ n − m ] x [ n ] e − j ω k ( n − m ) X [ k , m ] = n = m which we can also write as X [ k , m ] = x [ m ] ∗ h k [ − m ] where h k [ m ] = w [ m ] e j ω k m The frequency response of this filter is just the window DTFT, W ( ω ), shifted up to ω k : H k ( ω ) = W ( ω − ω k )

  17. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary Hamming window spectrum The frequency response of this filter is just the window DTFT, W ( ω ), shifted up to ω k : H k ( ω ) = W ( ω − ω k ) For a Hamming window, w [ n ] is on the left, W ( ω ) is on the right: By Olli Niemitalo, public domain image,

  18. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary STFT as a bank of analysis filters So the STFT is just like filtering x [ n ] through a bank of analysis filters, in which the k th filter is a bandpass filter centered at ω k : By Ventetpluie, GFDL, https://en.wikipedia.org/wiki/File:Multidimensional_Analysis_Filter_Banks.jpg

  19. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary Short-Time Fourier Transform STFT as a Transform: X [ k , m ] = DFT { w [ n ] x [ n + m ] } STFT as a Filterbank: h k [ m ] = w [ m ] e j ω k m X [ k , m ] = x [ m ] ∗ h k [ − m ] ,

  20. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary Outline Review: Power Spectrum 1 Short-Time Fourier Transform 2 STFT as a Linear-Frequency Filterbank 3 Optional Stuff: the Inverse STFT 4 Implementing Nonlinear-Frequency Filterbanks Using the STFT 5 Summary 6

  21. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary Short-Time Fourier Transform STFT as a Transform: X [ k , m ] = DFT { w [ n ] x [ n + m ] } STFT as a Filterbank: h k [ m ] = w [ m ] e j ω k m X [ k , m ] = x [ m ] ∗ h k [ − m ] ,

  22. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary The inverse STFT STFT as a transform is defined as: m +( N − 1) � w [ n − m ] x [ n ] e − j 2 π k ( n − m ) / N X [ k , m ] = n = m Obviously, we can inverse transform as: N − 1 1 � X [ k , m ] e j 2 π k ( n − m ) / N x [ n ] = Nw [ n − m ] k =0

  23. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary The inverse STFT We get a better estimate of x [ n ] if we average over all of the windows for which w [ n − m ] � = 0. Remember that this happens when 0 ≤ n − m ≤ ( N − 1), so � n 1 � N − 1 k =0 X [ k , m ] e j ω k ( n − m ) m = n − ( N − 1) N x [ n ] = � n m = n − ( N − 1) w [ n − m ] The denominator is N − 1 � W (0) = w [ m ] m =0 So n N − 1 1 � � X [ k , m ] e j ω k ( n − m ) x [ n ] = NW (0) m = n − ( N − 1) k =0

  24. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary STFT: Forward and Inverse Short Time Fourier Transform (STFT) : m +( N − 1) ω k = 2 π k � w [ n − m ] x [ n ] e − j ω k ( n − m ) , X [ k , m ] = N n = m Inverse Short Time Fourier Transform (ISTFT) : n N − 1 1 � � X [ k , m ] e j ω k ( n − m ) x [ n ] = NW (0) m = n − ( N − 1) k =0

  25. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary ISTFT as a bank of synthesis filters Inverse Short Time Fourier Transform (ISTFT) : n N − 1 1 � � X [ k , m ] e j ω k ( n − m ) x [ n ] = NW (0) m = n − ( N − 1) k =0 The ISTFT is the sum of filters: N − 1 n 1 � � X [ k , m ] e j ω k ( n − m ) x [ n ] = W (0) k =0 m = n − ( N − 1) N − 1 � = ( X [ k , m ] ∗ g k [ m ]) k =0 where � W (0) e j ω k m 1 0 ≤ m ≤ N − 1 g k [ m ] = 0 otherwise

  26. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary ISTFT as a bank of synthesis filters So the ISTFT is just like filtering X [ k , m ] through a bank of synthesis filters, in which the k th filter is a bandpass filter centered at ω k : By Ventetpluie, GFDL, https://en.wikipedia.org/wiki/File:Multidimensional_Synthesis_Filter_Banks.jpg

  27. Review STFT Linear Frequency Inverse Nonlinear Frequency Summary The whole process: STFT and ISTFT as a filterbanks We can compute the STFT, downsample, do stuff to it, upsample, and then resynthesize the resulting waveform: By Ventetpluie, GFDL, https://en.wikipedia.org/wiki/File:Multidimensional_M_Channel_Filter_Banks.jpg

Recommend


More recommend