Non-stationary signals. Windowing and localisation. Short Time Fourier Transform. Spectrograms. Mathematical Tools for ITS (11MAI) Mathematical tools, 2020 Jan Přikryl 11MAI, lecture 3 Monday, October 12, 2020 version: 2020-10-06 15:05 Department of Applied Mathematics, CTU FTS 1
Lectue Contents Trigonometric formulae Vector space of continuous basic waveforms Vector space of discrete basic waveforms Discrete Fourier Transform – DFT Revision of sampled signals Windowing and Localization Computer session project Homework 2
Integrals of trigonometric functions The derivatives and integrals (as primitive functions) of trigonometric functions are interconnected: � d cos ℓ x d x = 1 d x sin ℓ x = ℓ cos ℓ x ⇒ ℓ sin ℓ x , � d sin ℓ x d x = − 1 d x cos ℓ x = − ℓ sin ℓ x ⇒ ℓ cos ℓ x . 3
Product of trigonometric functions Products of two trigonometric functions are expressible as 2 sin ℓ x sin mx = cos( ℓ − m ) x − cos( ℓ + m ) x , 2 cos ℓ x cos mx = cos( ℓ − m ) x + cos( ℓ + m ) x , 2 sin ℓ x cos mx = sin( ℓ − m ) x + sin( ℓ + m ) x . Note If x ∈ [ 0 , 2 π ) then for x = ω 0 t we have t ∈ [ 0 , T ) . We have learnt that trigonometric functions cos ω k t and sin ω k t form Fourier basis for T -periodic functions. Question Is the basis set of cos mx and sin mx for x ∈ [ 0 , 2 π ) orthogonal? 4
Orthogonal basis Assume ℓ, m ∈ N . We will study the scalar inner products of these functions for ℓ � = m first: � 2 π � cos ℓ x , cos mx � = cos ℓ x cos mx d x 0 � 2 π � 2 π = 1 cos( ℓ − m ) x d x + 1 cos( ℓ + m ) x d x 2 2 0 0 1 � � 2 π 1 � � 2 π = sin( ℓ − m ) x 0 + sin( ℓ + m ) x 2 ( ℓ − m ) 2 ( ℓ + m ) 0 0 − 0 0 − 0 = 2 ( ℓ − m ) + 2 ( ℓ + m ) = 0 5
Orthogonal basis � 2 π � sin ℓ x , sin mx � = sin ℓ x sin mx d x 0 � 2 π � 2 π = 1 cos( ℓ − m ) x d x − 1 cos( ℓ + m ) x d x 2 2 0 0 1 � � 2 π 1 � � 2 π = sin( ℓ − m ) x 0 − sin( ℓ + m ) x 2 ( ℓ − m ) 2 ( ℓ + m ) 0 0 − 0 0 − 0 = 2 ( ℓ − m ) − 2 ( ℓ + m ) = 0 6
Orthogonal basis � 2 π � sin ℓ x , cos mx � = sin ℓ x cos mx d x 0 � 2 π � 2 π = 1 sin( ℓ − m ) x d x + 1 sin( ℓ + m ) x d x 2 2 0 0 1 � � 2 π 1 � � 2 π = − cos( ℓ − m ) x 0 − cos( ℓ + m ) x 2 ( ℓ − m ) 2 ( ℓ + m ) 0 1 − 1 1 − 1 = − 2 ( ℓ − m ) − 2 ( ℓ + m ) = 0 7
Orthogonal basis We will study the case ℓ = m separately. � 2 π � sin mx , cos mx � = 1 sin 2 mx d x = − 1 � � 2 π cos 2 mx 2 4 m 0 0 = − 1 − 1 = 0 4 m 8
Normalization Finally the two cases of basis functions that should result in inner product being 1 if normalised. � 2 π � 2 π 1 + cos 2 mx cos 2 mx d x = � cos mx , cos mx � = d x 2 0 0 = 1 � � 2 π 0 + 1 � � 2 π x sin 2 mx 2 2 m 0 � cos m ω 0 t � 2 = T || cos mx || 2 = π 2 � 2 π � 2 π 1 − cos 2 mx sin 2 mx d x = � sin mx , sin mx � = d x 2 0 0 = 1 � � 2 π 0 − 1 � � 2 π sin 2 mx x 2 2 m 0 � sin m ω 0 t � 2 = T || sin mx || 2 = π 2 9
Lectue Contents Trigonometric formulae Vector space of continuous basic waveforms Vector space of discrete basic waveforms Discrete Fourier Transform – DFT Revision of sampled signals Windowing and Localization Computer session project Homework 10
Trigonometric Fourier Series 1. T -periodic signal x ( t ) representation: ∞ ∞ � � x ( t ) = a 0 + a k cos( k ω 0 t ) + b k sin( k ω 0 t ) k = 1 k = 1 2. basis vectors cos( k ω 0 t ) , sin( k ω 0 t ) � T � T 3. a 0 = 1 (cos( k ω 0 t ) , cos( k ω 0 t )) ≡ 2 ( x ( t ) , cos( k ω 0 t )) x ( t ) d t , a k = x ( t ) cos( k ω 0 t ) d t T T 0 0 � T (sin( k ω 0 t ) , sin( k ω 0 t )) ≡ 2 ( x ( t ) , sin( k ω 0 t )) 4. b k = x ( t ) sin( k ω 0 t ) d t T 0 11
Continuous signal and basis vectors ∞ � 1. T -periodic signal representation x ( t ) = c k exp( j k ω 0 t ) k = −∞ 2. basis vector φ k ( t ) = exp( j k ω 0 t ) � T 3. scalar product c k = ( x ( t ) , φ k ( t )) ( φ k ( t ) , φ k ( t )) ≡ 1 x ( t ) exp( − j k ω 0 t )) dt T 0 4. completness of basis vectors � T ( φ k ( t ) , φ ℓ ( t )) = 1 exp( j k ω 0 t ) exp( − j ℓω 0 t ) dt = δ k ,ℓ T 0 12
Continuous signal and basis vectors ∞ � c k e j ω k t 1. Fourier series x ( t ) = k = −∞ M � c k e j ω k t for N = 2 M + 1 2. Partial sum of Fourier Series x N ( t ) = k = − M 13
Dirichlet kernel Definition (Dirichlet kernel) Dirichlet kernels are the partial sums of exponential functions M M � � D M ( ω 0 t ) = exp( j k ω 0 t ) = 1 + 2 cos( k ω 0 t ) . k = − M k = 1 Show that D M ( ω 0 t ) = sin(( M + 1 / 2 ) ω 0 t ) . sin( ω 0 t / 2 ) 14
Dirichlet kernel Theorem (Convolution of Dirichlet kernel) The convolution of D M ( t ) with an arbitrary T -periodic function f ( t ) = f ( t + T ) is the M -th degree Fourier series approximation to f ( t ) . � T / 2 M D M ( t ) ∗ f ( t ) ≡ 1 � D M ( t − τ ) f ( τ ) d τ = c k exp( j k ω 0 t ) , T − T / 2 k = − M � T / 2 where c k = 1 f ( t ) exp( − j k ω 0 t ) d t . T − T / 2 15
Lectue Contents Trigonometric formulae Vector space of continuous basic waveforms Vector space of discrete basic waveforms Discrete Fourier Transform – DFT Revision of sampled signals Windowing and Localization Computer session project Homework 16
From continous to discrete periodic signal Consider a continuous signal x ( t ) defined as T -periodical signal, sampled N times during that period at timestamps t = nT / N for n = 0 , 1 , 2 , . . . , N − 1. This yields a discretised signal x = ( x 0 , x 1 , x 2 , . . . , x N − 1 ) where x is a vector in R N with N components x n = x ( nT / N ) . The sampled signal x = ( x 0 , x 1 , x 2 , . . . , x N − 1 ) can be extended periodically with period N by modular definition x m = x ( m mod N ) for all m ∈ Z . 17
Discrete signal and basis vectors In order to form the discrete basis vectors we start with exponential basis φ k ( t ) = e j ω k t = e j2 π kt / T and substitute t → nT / N yielding N components of the basis vector in C N � nT � = e j2 π kn / N . φ k , n ≡ φ k N 18
Discrete signal and basis vectors The k -th basis vector has the following complex components: e j2 π k · 0 / N e j2 π k · 1 / N e j2 π k · 2 / N φ k = . . . e j2 π k · ( N − 1 ) / N 19
DFT basis — Scaling factor || φ k || 2 On C n the usual inner product is defined as T y = x 1 y 1 + x 2 y 2 + . . . + x n y n � x , y � = x The corresponding norm is || x || 2 = � x , x � = x 1 x 1 + x 2 x 2 + · · · + x n x n = | x 1 | 2 + | x 1 | 2 + · · · + | x n | 2 which translates for our basis vector to || φ k || 2 = φ k , 0 φ k , 0 + φ k , 1 φ k , 1 + · · · + φ k , N − 1 φ k , N − 1 = 1 + 1 + . . . + 1 as φ k , n = e − j2 π kn / N is a complex conjugate to φ k , n = e j2 π kn / N and therefore φ k , n φ k , n = 1, which results in the scaling factor being || φ k || 2 = N . 20
DFT basis — Orthogonality We can prove that basis vectors φ k are orthogonal by verifying that � φ ℓ , φ m � = 0 for all ℓ � = m : N − 1 N − 1 � � e j2 π ( ℓ − m ) ν/ N = � φ ℓ , φ m � = φ ℓ,ν φ m ,ν = ν = 0 ν = 0 N − 1 � e j2 π ( ℓ − m ) / N � ν � = . ν = 0 We have arrived at partial sum of the first N elements for geometric series. For ℓ � = m we have � � N e j2 π ℓ − m 1 − 1 − e j2 π ( ℓ − m ) N 1 − 1 � φ ℓ , φ m � = 1 − e j2 π ( ℓ − m ) / N = 1 − e j2 π ( ℓ − m ) / N = 1 − e j2 π ( ℓ − m ) / N = 0 21
Lectue Contents Trigonometric formulae Vector space of continuous basic waveforms Vector space of discrete basic waveforms Discrete Fourier Transform – DFT Properties Aliasing Zero Padding in discrete Fourier Transform Revision of sampled signals Windowing and Localization Computer session project 22 Homework
From Fourier Series to Discrete Fourier Transform Strang (2000): The Fourier series is linear algebra in infinite dimensions. The “vectors” are functions f ( t ) ; they are projected onto the sines and cosines; that produces the Fourier coefficients a k and b k . From this infinite sequence of sines and cosines, multiplied by a k and b k , we can reconstruct f ( t ) . That is the classical case, which Fourier dreamt about, but in actual calculations it is the discrete Fourier transform that we compute. Fourier still lives, but in finite dimensions. 23
Definition of the DFT and IDFT 1. Let x ∈ C N be a vector ( x 0 , x 1 , x 2 , . . . , x N − 1 ) . The discrete Fourier transform (DFT) of x is the vector X ∈ C N with components N − 1 � x m e − j2 π km / N . X k = � x , Φ k � = m = 0 2. Let X ∈ C N be a vector ( X 0 , X 1 , X 2 , . . . , X N − 1 ) . The inverse discrete Fourier transform (IDFT) of X is the vector x ∈ C N with components N − 1 x k = � X , Φ − k � � Φ k , Φ k � = 1 � X m e j2 π km / N . N m = 0 24
Recommend
More recommend