SIGAL PROCESSIG Prezentacja multimedialna współfinansowana przez Unię Europejsą w ramach Europejsiego Funduszu Społecznego w projecie pt. Innowacyjna dydatya bez ograniczeń - zintegrowany rozwój Politechnii Łódziej - zarządzanie Uczelnią, nowoczesna oferta eduacyjna i wzmacniania zdolności do zatrudniania osób niepełnosprawnych Politechnia Łódza, ul. Żeromsiego 6, 9-94 Łódź, tel. (4) 63 8 83 www.apitalludzi.p.lodz.pl
Spectral analysis
Signal processing 3 analog (anty-aliasing) filtering sampling A/D Digital processing D/A sensor transducer Amplifier fm f f s M Spectral methods Correlation methods Filtering Compressing Analog processing
Spectral analysis 4 Analysis of signals in spectral domain enables observation of signal features that are not visible in time domain but have significant diagnostic meaning. (t) ransformation X() Analysis t
Fourier series 5 Joseph Fourier (768-83) Wide range of signals may be represented by linear combination of harmonic functions of different frequencies so called Fourier series
DMF - Dual one Multi Frequency 6
Fourier ransform 7 How to combine amplitutes of individual harmonics (of varying frequencies) in order to obtain a representation of a signal of an arbitrary shape? F?
rigonometric Fourier series 8 a t a cos t b sin t where: and: a a b t t t fundamental frequency [rad/s] t dt t t costdt, sintdt,,,,,
Inner product of vectors A 9 B AB A B cos Inner product of vectors is a scalar A B A B dla 9 min for 8 A B ma for i.e. for orthogonal vectors
Inner product of vectors in a Cartesian coordinate system y A A y AB A B A y B y B y A A B B B AB A B cos A Bcos cos sin sin A A A cos B cos B B A A B A sin B sin B A A B B A y B y
For an -dimensional vectors: i i i y y y,,, y Y X Y X y,, y, y Y y y B A B A AB i i i y y y y Y X,,, X On the Euclidean plane Inner product of vectors hese can be interpreted as samples of functions
Basis vectors Problem: We want to represent a given vector C by orthogonal (basis) vectors a i b of unit length a b a b b a C Orthogonal vectors
Basis vectors Hyphotesis: C Proof: a Ca b Cb a C a a C cos a Aa b C b b C cos b Bb C Aa Bb A B B b B a a b C A 3 A Linear combintion of basis vectors
Bac to Fourier series 4. i Fourier coefficients Basis functions Joseph Fourier (768-83) Wide range of signals may be represented by linear combination of harmonic functions of different frequencies so called Fourier series
he problem of function approimation 5 Consider a tas: we wish to approimate a given function g by a weighted sum of n simpler functions f i : g f f n fn i f n i i Linear combination of functions he set of functions f i is usually given, our goal is to find out coefficients i, such that we get best possible approimation of function g by a set of n simpler functions f i
rigonometric Fourier series 6 a t a cos t b sin t where: and: a a b t t t fundamental frequency [rad/s] t dt t t costdt, sintdt,,,,, Inner product of functions
rigonometric Fourier series 7 a t a cos t b sin t +
Fourier serises of a cosinusoid 8 A (t) (f) A= f t f time f frequency
Fourier series - eample 9 t b sin t t 3 sin t. 5 sin t sin t 4.5.5.5 = -.5 + - -.5 -.5 -.5-4 5-5 - 5-5 Fundamental frequency f Fundamental period
Fourier series - eample - t b -4 5 sin t t sin t.5 5 sin t sin t 3 4 = -.5 3 Amplitudes of harmonics {, -.5, } Signal compression!
Fourier series - eample Fundamental pulsation t 4 sin t sin 3t sin 5t 3 5
Fourier series - eample See Fourier Series Animation using Circles: www.youtube.com/watch?v=lznjc4lo7le 4/ Fourier spectrum 3 5 7 9 3 5 7 9
rigonometric Fourier series 3 a t a cos t b sin t 3 -.5.5.5 =??? - -.5 -.5 -.5-3 -4 3 4 5-5 - 5-5
Fourier series of ECG 4 6 5 4 3 7-4 6 8 6 9 8 5 4 3 Fourier spectrum of ECG signal 6 Hz 5 5 f[hz]
Fourier series of ECG 5 9 8 7 6 5 4 3 5 5 f[hz]
Eponential Fourier series from trigonometric series 6 Let: a b c j c c c,,,,,...,, 3,... a c then: t c c c cos t jc c sin t and finally: t c e j t use: e jt cost j sin t
Euler s formula: 7 e jt cost j sin t Im j = o t sin t j t jt j t sin e e cos t Re jt jt cos t e e
Fourier coefficients 8 t c e j t X ( ) e j t where: X t j ( ) e t dt, X () t dt
Fourier ransform 9 Replace by continuous pulsation : t X je j t d X j t e jt dt Comple Fourier coefficients Comple numbers!
Fourier ransform - eample 3 Dirac Impulse White spectrum t F for for t t jt t t dt X j t e dt
Fourier ransform - eample Dirac Impulse 3 constant signal F t X jt j e dt for for
Fourier ransform - eample 3 -/ / t -, t, t F t X j e jt sin dt A signal of finite length has infinitely wide spectrum
Spectrum of a harmonic function 33 (t) F () t cos j t j t e e t
Spectrum of a harmonic function 34 (t) F () t sin j j t j t e e t j
Series of unit impulses 35 (t) F () / - - -4/ -/ / 4/ t t t where
Some properties of Fourier ransform 36. Linearity:. Scaling: 3. Convolution: 4. Multiplication: 5. Parseval s equality: 6. Modulation: a t byt a X j by j a a at X, a t yt X jy j t yt X jy j t dt X j j t te X d
Discrete Fourier ransform 37 Periodic signal (t) is sampled times during its period, ie. =t. Discrete signal (n) of period is obtained: n n (t) t (n) - t t
Discrete Fourier ransform 38 he smallest frequency of Fourier series (fundamental frequency): f t fs Frequencies of succesive -ths harmonics: f t f s (t) f o =/=/(t) t t - f o
Discrete Fourier ransform 39 Frequency/time resolution: X() f f o =/ t fs f o f o 3f o 4f o f o (t) t
Discrete Fourier ransform 4 Frequency/time resolution: f t ' fs X() f o =/ f ' f f o f o 3f o f o (t) t
Discrete Fourier ransform 4 Frequency/time resolution: f '' o t f s X() f o =/ f '' f f o f o f o (t) / t
Discrete Fourier ransform 4 Modifying equations for Fourier series and Fourier coeficients for continuous time: X ( ) X n t t e j t n dt gives corresponding equations for discrete time: ( nt) e X ( ) e t j n j X ( ) e n t j n t t j t n n=,,,, - ( n) e =,,,, -
Discrete Fourier ransform 43 X Direct: n ( n) e j n Sample inde in time =,,,, - Inverse: Sample inde in frequency n X ( ) e j n n =,,,, -
DF amplitude and phase spectrum 44 X ( ) n X ( ) X ( ) e ( n) e jarg j n / X Where: Amplitude spectrum X ( ) ImX ( ) X ( ) Re Phase spectrum arg X ( ) arctan Im Re X ( ) X ( )
DF properties 45 For a real valued signal (n) the following property holds for its -point DF: X ( ) X ( ) Im Hence for the amplitude spectrum (even symmetry): X ( ) X ( ) * - Re and for the phase spectrum (odd symmetry): arg X ( ) argx ( )
46 ] 4 [ 3 4 n 3 / ) ( ) ( n n j e n X j X X j X e n X n n j 3 4?... (3) 4?... 3 4?... () 3 4 4 3 4 3 4 ) ( () 3 / DF-eample Amplitude and phase spectrum?
47 3 n n / j e n X j X X j X X 3 4 3 4 3 4 3 =4 X X * X X arg arg Amplitude spectrum: even symmetry X X Phase spectrum: odd symmetry he symmetry property
48 DF properties DF is periodic: ) ( ) ( X X X e n e e n e n X n n j n n j n j n n j / / / ) ( ) ( ) ( ) ( =?
Discrete Fourier ransform amplitude spectrum 49 - even (=6) -7f f 8f -f - f DC Positive frequencies f s / egative frequencies
Discrete Fourier ransform amplitude spectrum 5 - odd (=5) f 7f -7f -f - f DC Positive frequencies egative frequencies
Discrete Fourier ransform amplitude spectrum 5 const. - t / f f o - t / f
Discrete Fourier ransform amplitude spectrum 5 f o - t / f f=f s / - t / f
Eamples 53 Computer eercise: Create = samples of harmonic signal (t)=asin(f t), where A=, f = Hz, sampled with frequency f s = Hz. Plot the signal, determine its frequency spectra and plot them. Compute the inverse transform and compare the result with the original signal.
f()=sin() Eamples 54 8 6 4 - signal in time domain = #number of samples A= #amplitude f= #sinusoid frequency fs= #sampling frequency =/fs #time range #time scale t=arange(,,./fs) -4-6 #sinusoid sample values =A*sin(*pi*f*t) -8 -...3.4.5.6.7.8.9 #plotting figure() plot(t,) title('signal in time domain') label( ime [s]') ylabel('f()=sin()')
FF(sin()) Eamples #frequency base determination f=float(fs)/ f=arange(,*f,f) #determination of Fourier coefficients X=fft() 6 5 frequency spectrum 55 #plotting figure plot(f,abs(x)) title('frequency spectrum ) label('f') ylabel('ff(sin())') 4 3 3 4 5 6 7 8 9 f
IFF(FF(sin())) Eamples 56 #inverse ix=ifft(x) figure; plot(t,real(ix)) title('reconstructed signal') label('') ylabel('iff(ff(sin())) ) 8 6 Reconstructed signal 4 - -4-6 -8 -...3.4.5.6.7.8.9
Eamples 57 Computer eercise: Add the Gaussian noise of standard deviation = ( *randn(,) ) to the signal created in the previous ecercise. Plot the noised signal. Is it possible to determine the harmonic frequency using the time characteristic? Plot the frequency spectrum of the noised signal and determine the main harmonic component of the signal.
f()=sin()+noise f()=sin() Eamples 58 6 signal in time domain 4 6 signal in time domain - 4-4 -6...3.4.5.6.7.8.9 - -4-6...3.4.5.6.7.8.9
FF(sin()) FF(sin()) f()=sin() f()=sin()+noise Eamples 59 6 signal in time domain 6 signal in time domain 4 4 - - 6-4 -6...3.4.5.6.7.8.9 frequency spectrum DF 5-4 -6...3.4.5.6.7.8.9 frequency spectrum 45 5 4 4 35 3 3 5 5 5 3 4 5 6 7 8 9 f 3 4 5 6 7 8 9 f
FF(sin()) Eamples 6 6 frequency spectrum signal 5 4 threshold 3 noise 3 4 5 6 7 8 9 f
IFF(FF(sin())) Eamples 6 5 Reconstructed signal 5-5 - -5...3.4.5.6.7.8.9
Eamples 6 Computer eercise: Determine and plot the amplitude frequency spectrum of the ECG signal sampled at f s =36 Hz (remember to subtract the mean from the signal prior to Fourier transform. Use 4-point DF). Analyse the ECG signal spectrum. otice the mains frequency.
Eamples 63 6 5 ECG plot mains frequency 6 Hz 4 3 ECG spectrum 8 - - 5 5 5 3 time [s] 6 4 5 5 5 3 35 frequency [Hz]
In practice a Fast Fourier ransform (FF) is used 64 X n j n n e, dla,,, X n n e j n Single coefficient (F) log (FF) Zys /log 6 56 64 4 In FF symmetry and periodicity of comple harmonics is used 56 65535 48 3 5 644 468 64 48 ~4e6 58 86
f()=sin()+noise Short ime Fourier ransform 65 Consider the following non-stationary signal: 6 signal in time domain 4 - -4-6...3.4.5.6.7.8.9
FF(sin()) Short ime Fourier ransform 66 frequency spectrum 5 5 5 3 4 5 6 7 8 f What important information is lost in the frequency spectrum?
f()=sin()+noise Short ime Fourier ransform 67 6 signal in time domain 4 signal - window -4-6...3.4.5.6.7.8.9 DF(signal*window)
f()=sin()+noise Short ime Fourier ransform 68 6 signal in time domain 4 signal - window -4-6...3.4.5.6.7.8.9 DF(signal*window)
f()=sin()+noise Short ime Fourier ransform 69 6 signal in time domain 4 signal - window -4-6...3.4.5.6.7.8.9 DF(signal*window)
f()=sin()+noise Short ime Fourier ransform 7 6 signal in time domain 4 signal - window -4-6...3.4.5.6.7.8.9 DF(signal*window)
Short ime Fourier ransform 7
Short ime Fourier ransform 7 SF( ( n)) X ( m, ) ( n) w( n m) e n jn signal discrete time variable discrete frequency variable window function
Frequency Short ime Fourier ransform 73 35 3 5 mm aaaaaa tttttt llllllll aaaaaaa bbb 5 5.5..5..5.3.35.4.45 ime
Introduction to Matlab - summary 74. Fourier series. Eponential Fourier series 3. Fourier ransform 4. Discrete Fourier ransform 5. Fourier spectrum interpretation 6. Short ime Fourier ransform
SIGAL PROCESSIG Prezentacja multimedialna współfinansowana przez Unię Europejsą w ramach Europejsiego Funduszu Społecznego w projecie pt. Innowacyjna dydatya bez ograniczeń - zintegrowany rozwój Politechnii Łódziej - zarządzanie Uczelnią, nowoczesna oferta eduacyjna i wzmacniania zdolności do zatrudniania osób niepełnosprawnych Politechnia Łódza, ul. Żeromsiego 6, 9-94 Łódź, tel. (4) 63 8 83 www.apitalludzi.p.lodz.pl