EE123 Digital Signal Processing - inst.eecs.berkeley.edu

37
M. Lustig, EECS UC Berkeley EE123 Digital Signal Processing Lecture 5B Time-Frequency Tiling

Transcript of EE123 Digital Signal Processing - inst.eecs.berkeley.edu

Page 1: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

M. Lustig, EECS UC Berkeley

EE123Digital Signal Processing

Lecture 5BTime-Frequency Tiling

Page 2: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

FREQUENCY ANALYSISFrequency Spectrum

Be basically the frequency components (spectral components) of that signalShow what frequencies exists in the signal

Fourier Transform (FT) One way to find the frequency contentTells how much of each frequency exists in a signal

( ) ( ) knN

N

nWnxkX ⋅+=+ ∑

=

1

011

( ) ( ) knN

N

kWkX

Nnx −

=∑ ⋅+=+

1

0111

⎟⎠⎞

⎜⎝⎛−

= Nj

N ewπ2

( ) ( ) dtetxfX ftjπ2−∞

∞−

⋅= ∫

( ) ( ) dfefXtx ftjπ2⋅= ∫∞

∞−

Page 3: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

STATIONARITY OF SIGNAL

Stationary SignalSignals with frequency content unchanged in timeAll frequency components exist at all times

Non-stationary SignalFrequency changes in timeOne example: the “Chirp Signal”

Page 4: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

STATIONARITY OF SIGNAL

0 0 . 2 0 . 4 0 . 6 0 . 8 1- 3

- 2

- 1

0

1

2

3

0 5 1 0 1 5 2 0 2 50

1 0 0

2 0 0

3 0 0

4 0 0

5 0 0

6 0 0

Time

Mag

nitu

de M

agni

tud

e

Frequency (Hz)

2 Hz + 10 Hz + 20Hz

Stationary

0 0 . 5 1- 1

- 0 . 8

- 0 . 6

- 0 . 4

- 0 . 2

0

0 . 2

0 . 4

0 . 6

0 . 8

1

0 5 1 0 1 5 2 0 2 50

5 0

1 0 0

1 5 0

2 0 0

2 5 0

Time

Mag

nitu

de M

agni

tud

e

Frequency (Hz)

Non- Stationary

0.0-0.4: 2 Hz + 0.4-0.7: 10 Hz + 0.7-1.0: 20Hz

Page 5: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

CHIRP SIGNALS

0 0.5 1-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

0 5 10 15 20 250

50

100

150

Time

Mag

nitu

de Mag

nitu

de

Frequency (Hz)0 0.5 1

-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

0 5 10 15 20 250

50

100

150

Time

Mag

nitu

de Mag

nitu

de

Frequency (Hz)

Different in Time DomainFrequency: 2 Hz to 20 Hz Frequency: 20 Hz to 2 Hz

Same in Frequency Domain

At what time the frequency components occur? FT can not tell!At what time the frequency components occur? FT can not tell!

Page 6: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

NOTHING MORE, NOTHING LESS

FT Only Gives what Frequency Components Exist in the SignalThe Time and Frequency Information can not be Seen at the Same TimeTime-frequency Representation of the Signal is Needed

Most of Transportation Signals are Non-stationary. (We need to know whether and also when an incident was happened.)

ONE EARLIER SOLUTION: SHORT-TIME FOURIER TRANSFORM (STFT)

Page 7: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

SFORT TIME FOURIER TRANSFORM (STFT)

Dennis Gabor (1946) Used STFTTo analyze only a small section of the signal at a time -- a technique called Windowing the Signal.

The Segment of Signal is Assumed Stationary A 3D transform

( )( ) ( ) ( )[ ] dtetttxft ftj

t

π−ω •′−ω•=′ ∫ 2*X ,STFT

( ) functionwindowthe:tω

A function of time and frequency

Page 8: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

DRAWBACKS OF STFTUnchanged WindowDilemma of Resolution

Narrow window -> poor frequency resolution Wide window -> poor time resolution

Heisenberg Uncertainty PrincipleCannot know what frequency exists at what time intervals

Via Narrow Window Via Wide Window

Page 9: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

• Spectrum of a bird chirping– Interesting,.... but...– Does not tell the whole story– No temporal information!

M. Lustig, EECS UC Berkeley

Example: Bird Chirp

Play Sound!

0 0.5 1 1.5 2 2.5

x 104

0

100

200

300

400

500

600

Hz

Spectrum of a bird chirp

No temporal information!

Miki Lustig UCB. Based on Course Notes by J.M Kahn Fall 2011, EE123 Digital Signal Processing

Example of spectral analysis

x[n]

n

Page 10: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

• To get temporal information, use part of the signal around every time point

• Mapping from 1D ⇒ 2D, n discrete, w cont.

M. Lustig, EECS UC Berkeley

Time Dependent Fourier Transform

X[n,!) =1X

m=�1x[n+m]w[m]e�j!m

*Also called Short-time Fourier Transform (STFT)

Page 11: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

• To get temporal information, use part of the signal around every time point

M. Lustig, EECS UC Berkeley

Time Dependent Fourier Transform

X[n,!) =1X

m=�1x[n+m]w[m]e�j!m

*Also called Short-time Fourier Transform (STFT)

Page 12: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

M. Lustig, EECS UC Berkeley

Spectrogram

Time, s

Fre

quency, H

z

2 4 6 8 10 12 14 16 180

1000

2000

3000

4000

0 500 1000 1500 2000 2500 3000 3500 4000 45000

5

10

15

20

25

30

Frequency, Hz

0 500 1000 1500 2000 2500 3000 3500 4000 45000

2

4

6

8

10

12

Frequency, Hz

0 500 1000 1500 2000 2500 3000 3500 4000 45000

5

10

15

20

25

30

Frequency, Hz

0 500 1000 1500 2000 2500 3000 3500 4000 45000

2

4

6

8

10

12

Frequency, Hz

Page 13: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

Xr[k] =L�1X

m=0

x[rR+m]w[m]e�j2⇡km/N

M. Lustig, EECS UC Berkeley

Discrete Time Dependent FT

• L - Window length• R - Jump of samples • N - DFT length

• Tradeoff between time and frequency resolution

Page 14: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

t

!

�t · �! � 1

2

�t

�!

M. Lustig, EECS UC Berkeley

Heisenberg Boxes

• Time-Frequency uncertainty principle http://www.jonasclaesson.com

Page 15: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

�! =2⇡

N�t = N

�! ·�t = 2⇡

M. Lustig, EECS UC Berkeley

DFT

X[k] =N�1X

n=0

x[n]e�j2⇡kn/N

!

tone DFT coefficient

Page 16: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

�! =2⇡

N

�t = N

�! ·�t = 2⇡

M. Lustig, EECS UC Berkeley

DFT

X[k] =N�1X

n=0

x[n]e�j2⇡kn/N

!

tQuestion: What is the effect of zero-padding?Answer: Overlapped Tiling!

Page 17: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

X[r, k] =L�1X

m=0

x[rR+m]w[m]e�j2⇡km/N

�! =2⇡

L

�t = L

M. Lustig, EECS UC Berkeley

Discrete STFT

optional

!

tone STFT coefficient

Page 18: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

X[r, k] =L�1X

m=0

x[rR+m]w[m]e�j2⇡km/N

�! =2⇡

L

�t = L

M. Lustig, EECS UC Berkeley

Discrete STFT

optional

!

tone STFT coefficient

Page 19: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

X[r, k] =L�1X

m=0

x[rR+m]w[m]e�j2⇡km/N

�! =2⇡

L

�t = L

M. Lustig, EECS UC Berkeley

Discrete STFT

optional

!

tQuestion: What is the effect of R on tiling? what effect of N?Answer: Overlapping in time or frequency or both!

Page 20: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

Time, s

Fre

quency, H

z

1 2 3 4 5 6 7 80

1000

2000

3000

4000

M. Lustig, EECS UC Berkeley

Applications

• Time Frequency Analysis

Spectrogram of Orca whale

Page 21: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

Time, s

Freq

uenc

y, H

z

2 4 6 8 10 12 14 16 180

1000

2000

3000

4000

M. Lustig, EECS UC Berkeley

Spectrogram

• What is the difference between the

Time, s

Freq

uenc

y, H

z

2 4 6 8 10 12 14 16 180

1000

2000

3000

4000

a) Window size B<Ab) Window size B>A

(B)

(A)

c) Window type is differentd) (A) uses overlapping window

Page 22: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

M. Lustig, EECS UC Berkeley

Windows Examples

Here we consider several examples. As before, the sampling rate is

!s/2⇡ = 1/T = 20 Hz.

Rectangular Window, L = 32

0 5 10 15 20 25 300

0.2

0.4

0.6

0.8

1

1.2

n

w[n

]

Rectangular Window, L = 32

-20 -10 0 10 200

5

10

15

20

25

30

35

40

Z/2S (Hz)

|W(ej ZT)|

DTFT of Rectangular Window

0 5 10 15 20 25 30

-1.5

-1

-0.5

0

0.5

1

1.5

n

v[n

]

Sampled, Windowed Signal, Rectangular Window, L = 32

-20 -10 0 10 200

5

10

15

20

Z/2S (Hz)

|V(ej ZT)|

DTFT of Sampled, Windowed Signal

Miki Lustig UCB. Based on Course Notes by J.M Kahn Fall 2011, EE123 Digital Signal Processing

Sidelobes of Hann vs rectangular windowWindows Examples

Hamming Window, L = 32

0 5 10 15 20 25 300

0.2

0.4

0.6

0.8

1

1.2

n

w[n

]

Hamming Window, L = 32

-20 -10 0 10 200

5

10

15

20

Z/2S (Hz)

|W(ej ZT)|

DTFT of Hamming Window

0 5 10 15 20 25 30

-1.5

-1

-0.5

0

0.5

1

1.5

n

v[n]

Sampled, Windowed Signal, Hamming Window, L = 32

-20 -10 0 10 200

2

4

6

8

10

Z/2S (Hz)

|V(ej ZT)|

DTFT of Sampled, Windowed Signal

Miki Lustig UCB. Based on Course Notes by J.M Kahn Fall 2011, EE123 Digital Signal Processing

Page 23: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

Time, s

Freq

uenc

y, H

z

2 4 6 8 10 12 14 16 180

1000

2000

3000

4000

M. Lustig, EECS UC Berkeley

Spectrogram

• What is the difference between the

Time, s

Freq

uenc

y, H

z

2 4 6 8 10 12 14 16 180

1000

2000

3000

4000

a) Window size B<Ab) Window size B>A

c) Window type is differentd) (A) uses overlapping window

(A)

(B)

Page 24: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

M. Lustig, EECS UC Berkeley

SpectrogramWindows Examples

Hamming Window, L = 32

0 5 10 15 20 25 300

0.2

0.4

0.6

0.8

1

1.2

n

w[n

]

Hamming Window, L = 32

-20 -10 0 10 200

5

10

15

20

Z/2S (Hz)

|W(ej ZT)|

DTFT of Hamming Window

0 5 10 15 20 25 30

-1.5

-1

-0.5

0

0.5

1

1.5

n

v[n]

Sampled, Windowed Signal, Hamming Window, L = 32

-20 -10 0 10 200

2

4

6

8

10

Z/2S (Hz)

|V(ej ZT)|

DTFT of Sampled, Windowed Signal

Miki Lustig UCB. Based on Course Notes by J.M Kahn Fall 2011, EE123 Digital Signal Processing

Windows Examples

Hamming Window, L = 64

0 10 20 30 40 50 600

0.2

0.4

0.6

0.8

1

1.2

n

w[n

]

Hamming Window, L = 64

-20 -10 0 10 200

5

10

15

20

25

30

35

40

Z/2S (Hz)

|W(ej ZT)|

DTFT of Hamming Window

0 10 20 30 40 50 60

-1.5

-1

-0.5

0

0.5

1

1.5

n

v[n]

Sampled, Windowed Signal, Hamming Window, L = 64

-20 -10 0 10 200

5

10

15

20

Z/2S (Hz)

|V(ej ZT)|

DTFT of Sampled, Windowed Signal

Miki Lustig UCB. Based on Course Notes by J.M Kahn Fall 2011, EE123 Digital Signal Processing

Page 25: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

M. Lustig, EECS UC Berkeley

Spectrogram of FM

n

Original Signal

Overlapping

Hann Windows

N Samples

M Samples

Figure 6: Extracting segments of a long signal with a Hann window

how the frequency resolution improves, while the temporal resolution degrades.

Task 5: Time-Frequency plots of the radio-frequency spectrum with the SDR.

The samples that are obtained by the SDR represent a bandwidth of the spectrum around a center fre-quency. Hence, when demodulating to base-band (i.e. zero frequency) the signal must be imaginary sinceit has a non symmetric Fourier transform. In this case, we would like to display both sides of the spectrum.

Modify the function myspectrogram(x,m,fs) such that it detects if the input signal x is complex. Inthat case, it will compute a double sided spectrum that is centered around DC. For this, it would we usefulto use the matlab commands: isreal and fftshift.

We will first look at radio FM spectrum. In the US the broadcast FM radio band is 88.1-107.9Mhz.It is split into 200KHz slots. This is relatively a large bandwidth and therefor it is also called widebandFM as opposed to narrowband FM which can be as low as 5 Khz. In FM radio the information is encodedby modulating the frequency of the carrier,

yc(t) = A cos✓2⇡fct+ 2⇡�f

Z t

0x(⌧)d⌧

◆.

Here, fc is the carrier frequency, �f is the frequency deviation and x(t) is a normalized baseband signal.

The broadcast FM baseband signal, x(t), consists of mono (Left+Right) Channels from 30Hz to 15 KHz,a pilot signal at fp = 19 KHz, amplitude modulated Stereo (Left - Right) channels around 2 · fp = 38KHzand digital RBDS, which encodes the station information, song name etc. at 3 · fp = 57KHz. (See

8

http://en.wikipedia.org/wiki/FM_broadcasting for more information). The baseband signal is:

x(t) = (L+R)| {z }

mono

+0.1 · cos(2⇡fpt)| {z }pilot

+(L�R) cos(2⇡(2fp)t)| {z }stereo

+0.05 · RBDS(t) cos(2⇡(3fp)t)| {z }digital RBDS

.

The signal RBDS(t) is a signal consists of ±1 at constant intervals which encode 0, and 1 bits. This is thespectrum of x(t):

Now, the SDR already demodulates by the carrier frequency fc, so the samples you get are actually

y[n] = y(nT ) = A exp

j2⇡�fZ nT

0x(⌧)d⌧

!

,

where T is the sampling rate.

Pick your favorite radio station (make sure there is good reception where you live! Don’t try it in thebasement or in rooms inside Cory that do not have windows). I’ve tested good reception from Cory hall5th floor at 88.5Mhz and 94.1Mhz. Acquire 4 seconds of data at a sampling rate of 200,000 Hz. Youcan use either rtl_tcp or rtl_sdr for that. Compute and display a spectrogram with a window of 500samples. Include the spectrogram in your report. What is the spectral and temporal resolution? Explainwhat you see. Don’t forget to play with di↵erent dynamic ranges of the spectrogram for best visualization.

In many analog radio systems, FM demodulation is performed by implementing a phased-locked loopthat tracks the frequency of the signal and extract the message x(t). However, it is very easy to implementan FM demodulation when the samples are discrete. Note, that the signal x(t) is proportional to theinstantaneous frequency of the signal. It is also proportional to the derivative of the phase! We can imple-ment this by computing the finite di↵erences of the phase of our signal angle(y[n])-angle(y[n-1]). Analternative that is robust to phase wrapping is to compute the product y[n]y⇤[n� 1] and then compute itsphase. Convince yourself that it works! In matlab it can be simply implemented by:

>> x = angle(y[2:end].*conj(y[1:end-1]));

FM demodulate the samples you got from the SDR and display the spectrogram. Note, that afterFMdemodulating the signal should be real and hence only half the spectrum should be displayed. Identify themono audio, the pilot, the stereo and the RBDS signals. Note, that the RBDS signal may be too weak todetect or may need better spectral resolution.

9

Spectrogram of FM radio

t=0 t=2sec

88.5

88.6

88.4

Page 26: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

M. Lustig, EECS UC Berkeley

Spectrogram of FM radio Baseband

http://en.wikipedia.org/wiki/FM_broadcasting for more information). The baseband signal is:

x(t) = (L+R)| {z }

mono

+0.1 · cos(2⇡fpt)| {z }pilot

+(L�R) cos(2⇡(2fp)t)| {z }stereo

+0.05 · RBDS(t) cos(2⇡(3fp)t)| {z }digital RBDS

.

The signal RBDS(t) is a signal consists of ±1 at constant intervals which encode 0, and 1 bits. This is thespectrum of x(t):

Now, the SDR already demodulates by the carrier frequency fc, so the samples you get are actually

y[n] = y(nT ) = A exp

j2⇡�fZ nT

0x(⌧)d⌧

!

,

where T is the sampling rate.

Pick your favorite radio station (make sure there is good reception where you live! Don’t try it in thebasement or in rooms inside Cory that do not have windows). I’ve tested good reception from Cory hall5th floor at 88.5Mhz and 94.1Mhz. Acquire 4 seconds of data at a sampling rate of 200,000 Hz. Youcan use either rtl_tcp or rtl_sdr for that. Compute and display a spectrogram with a window of 500samples. Include the spectrogram in your report. What is the spectral and temporal resolution? Explainwhat you see. Don’t forget to play with di↵erent dynamic ranges of the spectrogram for best visualization.

In many analog radio systems, FM demodulation is performed by implementing a phased-locked loopthat tracks the frequency of the signal and extract the message x(t). However, it is very easy to implementan FM demodulation when the samples are discrete. Note, that the signal x(t) is proportional to theinstantaneous frequency of the signal. It is also proportional to the derivative of the phase! We can imple-ment this by computing the finite di↵erences of the phase of our signal angle(y[n])-angle(y[n-1]). Analternative that is robust to phase wrapping is to compute the product y[n]y⇤[n� 1] and then compute itsphase. Convince yourself that it works! In matlab it can be simply implemented by:

>> x = angle(y[2:end].*conj(y[1:end-1]));

FM demodulate the samples you got from the SDR and display the spectrogram. Note, that afterFMdemodulating the signal should be real and hence only half the spectrum should be displayed. Identify themono audio, the pilot, the stereo and the RBDS signals. Note, that the RBDS signal may be too weak todetect or may need better spectral resolution.

9

http://en.wikipedia.org/wiki/FM_broadcasting for more information). The baseband signal is:

x(t) = (L+R)| {z }

mono

+0.1 · cos(2⇡fpt)| {z }pilot

+(L�R) cos(2⇡(2fp)t)| {z }stereo

+0.05 · RBDS(t) cos(2⇡(3fp)t)| {z }digital RBDS

.

The signal RBDS(t) is a signal consists of ±1 at constant intervals which encode 0, and 1 bits. This is thespectrum of x(t):

����� ����� ����

�� �����

�� �������

���������

��������� !" #���#��� ��$���

Now, the SDR already demodulates by the carrier frequency fc, so the samples you get are actually

y[n] = y(nT ) = A exp

j2⇡�fZ nT

0x(⌧)d⌧

!

,

where T is the sampling rate.

Pick your favorite radio station (make sure there is good reception where you live! Don’t try it in thebasement or in rooms inside Cory that do not have windows). I’ve tested good reception from Cory hall5th floor at 88.5Mhz and 94.1Mhz. Acquire 4 seconds of data at a sampling rate of 200,000 Hz. Youcan use either rtl_tcp or rtl_sdr for that. Compute and display a spectrogram with a window of 500samples. Include the spectrogram in your report. What is the spectral and temporal resolution? Explainwhat you see. Don’t forget to play with di↵erent dynamic ranges of the spectrogram for best visualization.

In many analog radio systems, FM demodulation is performed by implementing a phased-locked loopthat tracks the frequency of the signal and extract the message x(t). However, it is very easy to implementan FM demodulation when the samples are discrete. Note, that the signal x(t) is proportional to theinstantaneous frequency of the signal. It is also proportional to the derivative of the phase! We can imple-ment this by computing the finite di↵erences of the phase of our signal angle(y[n])-angle(y[n-1]). Analternative that is robust to phase wrapping is to compute the product y[n]y⇤[n� 1] and then compute itsphase. Convince yourself that it works! In matlab it can be simply implemented by:

>> x = angle(y[2:end].*conj(y[1:end-1]));

FM demodulate the samples you got from the SDR and display the spectrogram. Note, that afterFMdemodulating the signal should be real and hence only half the spectrum should be displayed. Identify themono audio, the pilot, the stereo and the RBDS signals. Note, that the RBDS signal may be too weak todetect or may need better spectral resolution.

9

http://en.wikipedia.org/wiki/FM_broadcasting for more information). The baseband signal is:

x(t) = (L+R)| {z }

mono

+0.1 · cos(2⇡fpt)| {z }pilot

+(L�R) cos(2⇡(2fp)t)| {z }stereo

+0.05 · RBDS(t) cos(2⇡(3fp)t)| {z }digital RBDS

.

The signal RBDS(t) is a signal consists of ±1 at constant intervals which encode 0, and 1 bits. This is thespectrum of x(t):

Now, the SDR already demodulates by the carrier frequency fc, so the samples you get are actually

y[n] = y(nT ) = A exp

j2⇡�fZ nT

0x(⌧)d⌧

!

,

where T is the sampling rate.

Pick your favorite radio station (make sure there is good reception where you live! Don’t try it in thebasement or in rooms inside Cory that do not have windows). I’ve tested good reception from Cory hall5th floor at 88.5Mhz and 94.1Mhz. Acquire 4 seconds of data at a sampling rate of 200,000 Hz. Youcan use either rtl_tcp or rtl_sdr for that. Compute and display a spectrogram with a window of 500samples. Include the spectrogram in your report. What is the spectral and temporal resolution? Explainwhat you see. Don’t forget to play with di↵erent dynamic ranges of the spectrogram for best visualization.

In many analog radio systems, FM demodulation is performed by implementing a phased-locked loopthat tracks the frequency of the signal and extract the message x(t). However, it is very easy to implementan FM demodulation when the samples are discrete. Note, that the signal x(t) is proportional to theinstantaneous frequency of the signal. It is also proportional to the derivative of the phase! We can imple-ment this by computing the finite di↵erences of the phase of our signal angle(y[n])-angle(y[n-1]). Analternative that is robust to phase wrapping is to compute the product y[n]y⇤[n� 1] and then compute itsphase. Convince yourself that it works! In matlab it can be simply implemented by:

>> x = angle(y[2:end].*conj(y[1:end-1]));

FM demodulate the samples you got from the SDR and display the spectrogram. Note, that afterFMdemodulating the signal should be real and hence only half the spectrum should be displayed. Identify themono audio, the pilot, the stereo and the RBDS signals. Note, that the RBDS signal may be too weak todetect or may need better spectral resolution.

9

Spectrogram of Demodulated FM radio (Adele on 96.5 MHz)

0

19KHz

38KHz

57KHz

Page 27: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

M. Lustig, EECS UC Berkeley

Subcarrier FM radio (Hidden Radio Stations)

19KHz

38KHz

57KHz 57KHz67KHz

92KHz

0

spelled wrong!

spelled wrong!

Page 28: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

M. Lustig, EECS UC Berkeley

Applications

• Time Frequency AnalysisSpectrogram of digital communications - Frequency Shift Keying JT65

https://gm7something.wordpress.com/2012/12/09/nov-radio-days/

http://www.sigidwiki.com/wiki/Category:ActiveSignal Wiki:

Page 29: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

x[rR+m]wL[m] =1

N

N�1X

k=0

X[n, k]ej2⇡km/N

M. Lustig, EECS UC Berkeley

STFT Reconstruction

• For non-overlapping windows, R=L :

• What is the problem?

x[n] =x[n� rL]

wL[n� rL]

rL n (r + 1)R� 1

Page 30: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

x[rR+m]wL[m] =1

N

N�1X

k=0

X[n, k]ej2⇡km/N

M. Lustig, EECS UC Berkeley

STFT Reconstruction

• For non-overlapping windows, R=L :

• For stable reconstruction must overlap window 50% (at least)

x[n] =x[n� rL]

wL[n� rL]

rL n (r + 1)R� 1

Page 31: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

M. Lustig, EECS UC Berkeley

STFT Reconstruction

• For stable reconstruction must overlap window 50% (at least)

• For Hann, Bartlett reconstruct with overlap and add. No division!

Page 32: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

M. Lustig, EECS UC Berkeley

Applications

• Noise removal

• Recall bird chirp x[n]

n

Example: Bird Chirp

Play Sound!

0 0.5 1 1.5 2 2.5

x 104

0

100

200

300

400

500

600

Hz

Spectrum of a bird chirp

No temporal information!

Miki Lustig UCB. Based on Course Notes by J.M Kahn Fall 2011, EE123 Digital Signal Processing

Page 33: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

M. Lustig, EECS UC Berkeley

Application

• Denoising of Sparse spectrograms

• Spectrum is sparse! can implement adaptive filter, or just threshold!

Time, s

Fre

qu

en

cy,

Hz

2 4 6 8 10 12 14 16 180

1000

2000

3000

4000

Page 34: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

M. Lustig, EECS UC Berkeley

DenoisingChirp with Gaussian Noise

Thresholded Spectrogram

reconstructed time signal

Page 35: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

M. Lustig, EECS UC Berkeley

Limitations of Discrete STFT

• Need overlapping ⇒ Not orthogonal

• Computationally intensive O(MN log N)

• Same size Heisenberg boxes

Page 36: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

M. Lustig, EECS UC Berkeley

From STFT to Wavelets

• Basic Idea:–low-freq changes slowly - fast tracking unimportant

–Fast tracking of high-freq is important in many apps.

–Must adapt Heisenberg box to frequency

• Back to continuous time for a bit.....

Page 37: EE123 Digital Signal Processing - inst.eecs.berkeley.edu

�t

�!

u

M. Lustig, EECS UC Berkeley

From STFT to Wavelets

• Continuous time�t

�!

u

�t

�!

�t

�!

�t

�!