0% found this document useful (0 votes)
36 views62 pages

Ch9-Time Frequency Wavelet

This document discusses time-frequency analysis and wavelet transforms. It begins with definitions of time-frequency analysis and the short-time Fourier transform (STFT). It then introduces wavelet transforms, including the continuous wavelet transform (CWT) and discrete wavelet transform (DWT). The rest of the document discusses properties and applications of these time-frequency analysis techniques, including their ability to provide time-frequency localization that the Fourier transform lacks for non-stationary signals. It also discusses concepts such as scale and translation that are important for understanding wavelet transforms.

Uploaded by

kalajamun
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views62 pages

Ch9-Time Frequency Wavelet

This document discusses time-frequency analysis and wavelet transforms. It begins with definitions of time-frequency analysis and the short-time Fourier transform (STFT). It then introduces wavelet transforms, including the continuous wavelet transform (CWT) and discrete wavelet transform (DWT). The rest of the document discusses properties and applications of these time-frequency analysis techniques, including their ability to provide time-frequency localization that the Fourier transform lacks for non-stationary signals. It also discusses concepts such as scale and translation that are important for understanding wavelet transforms.

Uploaded by

kalajamun
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 62

Advanced signal processing

Dr. Mohamad KAHLIL

Chapter 4: Time frequency and wavelet analysis


Definition Time frequency Shift time fourier transform Winer-ville representations and others Wavelet transform Scalogram Continuous wavelet transform Discrete wavelet transform: details and approximations applications

The Story of Wavelets Theory and Engineering Applications

Time frequency representation Instantaneous frequency and group delay Short time Fourier transform Analysis Short time Fourier transform Synthesis Discrete time STFT

Signal processing
Signal Processing

Time-domain techniques TF domain techniques Filters


Non/Stationary Signals

Freq.-domain techniques Fourier T.


Stationary Signals

STFT

WAVELET TRANSFORMS
CWT DWT MRA 2-D DWT SWT Applications
Denoising Compression Signal Analysis Disc. Detection BME / NDE 4 Other

FT At Work
x1 (t ) = cos(2 5 t )

x2 (t ) = cos(2 25 t )

x3 (t ) = cos(2 50 t )
5

FT At Work
F
X 1 ( )

x1 (t )

x2 (t )

X 2 ( )

x3 (t )

X 3 ( )
6

FT At Work
x4 (t ) = cos(2 5 t ) + cos(2 25 t ) + cos(2 50 t )

x4 (t )

X 4 ( )

Stationary and Non-stationary Signals


FT identifies all spectral components present in the signal, however it does not provide any information regarding the temporal (time) localization of these components. Why? Stationary signals consist of spectral components that do not change in time

all spectral components exist at all times no need to know any time information FT works well for stationary signals
However, non-stationary signals consists of time varying spectral components

How do we find out which spectral component appears when? FT only provides what spectral components exist , not where in time they are located. Need some other ways to determine time localization of spectral

components

Stationary and Non-stationary Signals


Stationary signals spectral characteristics do not change with time
x4 (t ) = cos(2 5 t ) + cos(2 25 t ) + cos(2 50 t )

Non-stationary signals have time varying spectra

x5 (t ) = [ x1 x2 x3 ]
Concatenation

Non-stationary Signals
5 Hz 20 Hz 50 Hz

Perfect knowledge of what frequencies exist, but no information about where these frequencies are located in time

10

FT Shortcomings
Complex exponentials stretch out to infinity in time They analyze the signal globally, not locally Hence, FT can only tell what frequencies exist in the entire signal, but cannot tell, at what time instances these frequencies occur In order to obtain time localization of the spectral components, the signal need to be analyzed locally HOW ?

11

Short Time Fourier Transform (STFT)


1. 2. 3. 4. 5. 6. Choose a window function of finite length Put the window on top of the signal at t=0 Truncate the signal using this window Compute the FT of the truncated signal, save. Slide the window to the right by a small amount Go to step 3, until window reaches the end of the signal For each time location where the window is centered, we obtain a different FT

Hence, each FT provides the spectral information of a separate time-slice of the signal, providing simultaneous time and frequency information

12

STFT

13

STFT
Time parameter Frequency parameter Signal to be analyzed FT Kernel (basis function)

STFTx (t , ) =

[x(t ) W (t t )] e
t

j t

dt

STFT of signal x(t): Computed for each window centered at t=t

Windowing function

Windowing function centered at t=t

14

STFT at Work
1 0.5 0 -0.5 -1 -1.5 0 1 0.5 0 -0.5 -1 -1.5 0

Windowed sinusoid allows FT to be computed only through the support of the windowing function
100 200 300

100

200

300

1 0.5 0 -0.5 -1 -1.5 0

1 0.5 0 -0.5 -1 -1.5 0

100

200

300

100

200

300

15

STFT
STFT provides the time information by computing a different FTs for consecutive time intervals, and then putting them together

Time-Frequency Representation (TFR) Maps 1-D time domain signals to 2-D timefrequency signals
Consecutive time intervals of the signal are obtained by truncating the signal using a sliding windowing function How to choose the windowing function?

What shape? Rectangular, Gaussian, Elliptic? How wide?


Wider window require less time steps low time resolution Also, window should be narrow enough to make sure that the portion of the signal falling within the window is stationary 16 Can we choose an arbitrarily narrow window?

Selection of STFT Window


STFTx (t , ) = [x(t ) W (t t )] e jt dt
t
Two extreme cases: W(t) infinitely long: W (t ) = 1 STFT turns into FT, providing excellent frequency information (good frequency resolution), but no time information W(t) infinitely short: W (t ) = (t ) j t j t

STFTx (t , ) = [x(t ) (t t )] e
t

dt = x(t ) e

STFT then gives the time signal back, with a phase factor. Excellent time information (good time resolution), but no frequency information

Wide analysis window poor time resolution, good frequency resolution Narrow analysis windowgood time resolution, poor frequency resolution Once the window is chosen, the resolution is set for both time and frequency. 17

Heisenberg Principle
t f 1 4

Time resolution: How well two spikes in time can be separated from each other in the transform domain

Frequency resolution: How well two spectral components can be separated from each other in the transform domain

Both time and frequency resolutions cannot be arbitrarily high!!!


We cannot precisely know at what time instance a frequency component is located. We can only know what interval of frequencies are present in which time

intervals

http://engineering.rowan.edu/~polikar/WAVELETS/WTpart2.html 18

STFT
Amplitude

..
t0 t1 tk tk+1

..
tn

time

Frequency

..

..
19

The Short Time Fourier Transform


Take FT of segmented consecutive pieces of a signal. Each FT then provides the spectral content of that time segment only Spectral content for different time intervals Time-frequency representation
Time parameter Frequency parameter Signal to be analyzed FT Kernel (basis function)

STFT x ( , ) =
STFT of signal x(t): Computed for each window centered at t= (localized spectrum)

[x (t ) W (t ) ] e
t

j t

dt

Windowing function Windowing function (Analysis window) centered at t=

20

Properties of STFT

Linear Complex valued Time invariant Time shift Frequency shift Many other properties of the FT also apply.

21

Alternate Representation of STFT


~ ~ ~ j 2ft j 2ft * ( ) STFTx (t , f ) = e X ( f ) ( f f )e df f ~t ( ) j ~ STFTx (t , ) = e j t ~ X ( ) ( )e d *

~ STFT : The inverse FT of the windowed spectrum, X ( f )* ( f f ) with a phase factor

22

Filter Interpretation of STFT


1

~ ~ j 2ft * X ( f ) ( f f ) = X ( f ) ( f f )e df
* f *

~ j 2ft X ( f ) ( f f ) x(t ) (t )e

X(t) is passed through a bandpass filter with a center frequency of f Note that (f) itself is a lowpass filter.
23

Filter Interpretation of STFT


e j 2ft
x(t)

(t )e
e j 2ft

j 2ft

( ) STFTx (t , f )

x(t)

(t )

( ) STFTx (t , f )
24

Resolution Issues
Amplitude
(t k )
(t k )

All signal attributes located within the local window interval around t will appear at t in the STFT

time

Frequency

25

Time-Frequency Resolution
Closely related to the choice of analysis window Narrow window good time resolution Wide window (narrow band) good frequency resolution Two extreme cases: (T)=(t) excellent time resolution, no frequency resolution (T)=1 excellent freq. resolution (FT), no time info!!! How to choose the window length? Window length defines the time and frequency resolutions Heisenbergs inequality Cannot have arbitrarily good time and frequency resolutions. One must trade one for the other. Their 26 product is bounded from below.

Time-Frequency Resolution

Frequency

Time
27

Time Frequency Signal Expansion and STFT Synthesis


Basis functions

~ ~ ~ j 2ft ( ) x(t ) = STFTx ( , f ) g (t )e ddf ~ f


Synthesized signal Coefficients (weights) Synthesis window

g ( t ) * ( t ) dt = 1

Each (2D) point on the STFT plane shows how strongly a time frequency point (t,f) contributes to the signal. Typically, analysis and synthesis windows are chosen to be identical. 28

STFT Example
300 Hz 200 Hz 100Hz 50Hz

29

STFT Example

(t ) = e

at 2 / 2

30

STFT Example

a=0.01

31

STFT Example

a=0.001

32

STFT Example

a=0.0001

33

STFT Example

a=0.00001

34

Discrete Time Stft


( ) STFTx (nT , kF ) = x(t ) * (t nT )e j 2kFt dt t
( ) x(t ) = STFTx (nT , kF ) g (t nT )e j 2kFt n k

35

The Story of Wavelets Theory and Engineering Applications

Time frequency resolution problem Concepts of scale and translation The mother of all oscillatory little basis functions The continuous wavelet transform Filter interpretation of wavelet transform Constant Q filters
36

Time Frequency Resolution


Time frequency resolution problem with STFT Analysis window dictates both time and frequency resolutions, once and for all Narrow window Good time resolution Narrow band (wide window) Good frequency resolution When do we need good time resolution, when do we need good frequency resolution?

37

Scale & Translation


Translation time shift f(t) f(a.t) a>0 If 0<a<1 dilation, expansion lower frequency If a>1 contraction higher frequency f(t)f(t/a) a>0 If 0<a<1 contraction low scale (high frequency) If a>1 dilation, expansion large scale (lower frequency) Scaling Similar meaning of scale in maps Large scale: Overall view, long term behavior 38 Small scale: Detail view, local behavior

The Mother of All Oscillatory Little Basis Functions


The kernel functions used in Wavelet transform are all obtained from one prototype function, by scaling and translating the prototype function. This prototype is called the mother wavelet

t b 1 a,b (t ) = ( ) a a
1 a

Translation parameter Scale parameter

Normalization factor to ensure that all wavelets have the same energy

( a ,b) (t ) dt = (1,0) (t ) dt = (t ) dt
2 2 2

1,0 (t ) = (t )
39

Continuous Wavelet Transform


Mother wavelet translation

( ) CWTx ( a, b) = W ( a, b) =

1 t b x(t ) dt a a
Scaling: Changes the support of the wavelet based on the scale (frequency)

CWT of x(t) at scale a and translation b Note: low scale high frequency

Normalization factor

40

Computation of CWT
Amplitude Amplitude
W (1, b0 )

W (10, b0 )

W (10, bN )

b0

bN
W (1, b N )

time Amplitude

b0

bN

time

Amplitude

W (5, b0 )
W ( 5, b N )

W ( 25, b0 )

W (25, bN )

b0

bN

time

b0

bN

time
41

1 ( ) t b CWTx x t ( a, b) = W ( a, b) = ( ) dt a a

WT at Work
High frequency (small scale)

Low frequency (large scale)

42

Why Wavelet?
We require that the wavelet functions, at a minimum, satisfy the following:

Wave

(t )dt = 0
2

(t )

dt <

let

43

The CWT as a Correlation


Recall that in the L2 space an inner product is defined as
< f (t ), g (t ) >= f (t ) g (t )dt

W (a, b) =< x(t ), a,b (t ) >


then Cross correlation: then
Rxy ( ) = x(t ) y (t )dt =< x(t ), y (t ) >

W (a, b) =< x(t ), a,0 (t b) > = Rx, a ,o (b)


44

The CWT as a Correlation

Meaning of life: W(a,b) is the cross correlation of the signal x(t) with the mother wavelet at scale a, at the lag of b. If x(t) is similar to the mother wavelet at this scale and lag, then W(a,b) will be large.

45

Filtering Interpretation of Wavelet Transform


Recall that for a given system h[n], y[n]=x[n]*h[n]
y (t ) = x(t ) * h(t ) = x( )h(t )d

W (a, b) = x(b) * a,0 (b)


Observe that Interpretation:For any given scale a (frequency ~ 1/a), the CWT W(a,b) is the output of the filter with the impulse response a ,0 ( b) to the input x(b), i.e., we have a continuum of filters, parameterized by the scale factor a.
46

What do Wavelets Look Like???


Mexican Hat Wavelet Haar Wavelet Morlet Wavelet

47

Constant Q Filtering
A special property of the filters defined by the mother wavelet is that they are so called constant Q filters. Q Factor:
center frequency bandwidth

w (rad/s)

We observe that the filters defined by the mother wavelet increase their bandwidth, as the scale is reduced (center frequency is increased) 48

Constant Q
B STFT B B B B B

f0 B CWT

2f0 2B

3f0 4B

4f0

5f0

6f0 8B

f Q= B

f0

2f0

4f0

8f0
49

Inverse CWT
1 x(t ) = C

a = b = a

1
2

W (a, b) a,b (t )dadb

C=

( )

provided that

(t ) dt = 0
50

Properties of Continuous Wavelet Transform


Linearity Translation Scaling Wavelet shifting Wavelet scaling Linear combination of wavelets

51

Example

52

Example

53

Example

54

Spectrogram & Scalogram


Spectrogram is the square magnitude of the STFT,

PS = SPEC =

( ) x (t,

f ) = STFT

( ) x (t, 2

f)

j 2 ft x ( t ) ( t t ) e dt 0 t

which provides the distribution of the energy of the signal in the time-frequency plane. Similarly, scalogram is the square magnitude of the CWT, and provides the energy distribution of the signal in the time-scale plane:

PW = =

) SCAL(x ( a , b)

2 ( ) CWTx ( a, b) 2

1 (t b) x t dt ( ) a a t

55

Energy
It can be shown that

CWT ( a , b ) da db = 2 a

x (t )

dt = E x

which implies that the energy of the signal is the same whether you are in the original time domain or the scale-translation space. Compare this the Parsevals theorem regarding the Fourier transform.

56

CWT in Terms of Frequency


Time-frequency version of the CWT can also be defined, though note that this form is not standard,

CWT x ( , f ) =

f f f 0 x ( t ) (t ) dt f0 t

where is the mother wavelet, which itself is a bandpass function centered at t=0 in time and f=f0 in frequency. That is f0 is the center frequency of the mother wavelet. The original CWT expression can be obtained simply by using the substitution a=f0 / f and b= In Matlab, you can obtain the pseudo frequency corresponding to any given scale by fs is the sampling rate and fo f o Ts where Ts is the sampling period. = f =

a fs

57

Discretization of Time & Scale Parameters


Recall that, if we use orthonormal basis functions as our mother wavelets, then we can reconstruct the original signal by

x ( t ) = W ( a , b ), a ,b ( t )
where W(a,b) is the CWT of x(t) Q: Can we discretize the mother wavelet a,b(t) in such a way that a finite number of such discrete wavelets can still form an orthonormal basis (which in turnallows us to reconstruct the original signal)? If yes, how often do we need to sample the translation and scale parameters to be able to reconstruct the signal? A: Yes, but it depends on the choice of the wavelet! 58

Dyadic Grid
Note that, we do not have to use a uniform sampling rate for the translation parameters, since we do not need as high time sampling rate when the scale is high (low frequency). Lets consider the following sampling grid:
b
where a is sampled on a log scale, and b is sampled at a higher rate when a is small, that is,

a = a 0j
where a0 and b0 are constants, and j,k are integers. log a
59

b = k a 0j b0

Dyadic Grid
If we use this discretization, we obtain,

1 tb a ,b ( t ) = a a

t ka0j b0 j ,k ( t ) = j j a a0 0 1
j/2 j = a0 a0 t kb0

A common choice for a0 and b0 are a0 = 2 and b0 = 1, which lend themselves to dyadic sampling grid

j ,k

( t ) = 2 j / 2 2 j t k

j, k Z

Then, the discret(ized) wavelet transform (DWT) pair can be given as

W ( a, b) x (t ) j ,k ( t )dt = d j ,k
DWT

1 x (t ) = c

j = k =

d j ,k j ,k (t )
60

Inverse DWT

Note that
We have only discretized translation and scale parameters, a and b; time has not been discretized yet. Sampling steps of b depend on a. This makes sense, since we do not need as many samples at high scales (low frequencies) For small a0, say close to 1, and for small b0, say close to zero, we obtain a very fine sampling grid, in which case, the reconstruction formula is very similar to that of CWT
x(t ) = 1 C
a = b = a

1
2

W (a, b) a,b (t )dadb

1 x (t ) = c

j = k =

d j ,k j ,k ( t )

For dense sampling, we need not place heavy restriction on (t) to be able reconstruct x(t), whereas sparse sampling puts heavy restrictions on (t). It turns out that a0 = 2 and b0 = 1 (dyadic / octave sampling) provides a nice trade-off. For this selection, many orthonormal basis functions (to be used as mother wavelets) are available.
61

Discrete Wavelet Transform

We have computed a discretized version of the CWT, however, we still cannot implement the given DWT as it includes a continuous time signal integrated over all times. We will later see that the dyadic grid selection will allow us to compute a truly discrete wavelet transform of a given discrete time signal.

62

You might also like