Top Banner
Basics of Signal Processing
40

Basics of Signal Processing. frequency = 1/T speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

Dec 23, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

Basics of Signal Processing

Page 2: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.
Page 3: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

frequency = 1/T

speed of sound × T, where T is a period

sine wave •period (frequency)•amplitude•phase

Page 4: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

f (t) = Asin(2πt /T + φ)

f (t) = Asin(ωt + φ)

Asin(ωt + π /2)

= Acos(ωt)

sine cosinePhase

Page 5: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

Sinusoidal grating of image

Page 6: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

• Fourier idea– describe the

signal by a sum of other well defined signals

TO

Page 7: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

Fourier Series

A periodic function as an infinite weighted sum of simpler periodic functions!

f (t) = wi

i= 0

∑ f i(t)

Page 8: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

A good simple function

Ti=T0 / i

f i(t ) = sin(iω 0t + φ),

where ω 0 = 2π / T0

Page 9: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

f (t) = ki sin(iω0

i=1

∑ + ϕ n )

= [bi

i=1

∑ sin(iω0) + ai cos(iω0)]

= Re ˆ c i ⋅e− jω0n

i= 0

∑ , ˆ c − complex

Page 10: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

e.t.c. ad infinitum

Page 11: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

f (t) = ki sin(iω0

i=1

∑ + ϕ n ) = [bi

i=1

∑ sin(iω0) + ai cos(iω0)]

T=1/f

e.t.c……

T=1/f

e.t.c……

Page 12: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

Fourier’s Idea

Describe complicated function as a weighted sum of simpler functions!-simpler functions are known-weights can be found

Simpler functions - sines and cosines are orthogonal on period T, i.e.

f(mt)⋅ f(nt) 0

T

∫ dt = 0 for m ≠ n

period T period T

Page 13: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

Orthogonality

sinnωt ⋅cosmωtdt = 00

T

cosnωt ⋅cosmωtdt = 0 for n ≠ m and T2

0

T

∫ for n = m

sinnωt ⋅sin mωtdt = 0 for n ≠ m and T2

0

T

∫ for n = m

Page 14: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

0+

-

0+

-

0+

-

x

0 + +--

x

0

+ +

=

0 + +- -

=

area is positive (T/2) area is zero

Page 15: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

f(t) = 1.5 + 3sin(2πt/T) + 4sin(4πt/T)

= + +0 T

1

Tf(t)dt

0

T

∫ =1.50 T

1.5

b1 =2

Tf

0

T

∫ (t)sin(2πt

T)dt = 3 = + +0 T

0 3 0

One example of a function

Page 16: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

=

f(t) = DC + a i cos(2πit

T) + b1 sin(

2πit

T)

⎡ ⎣ ⎢

⎤ ⎦ ⎥=

i=1

∑ DC + a1 cos(2πt

T) + b1 sin(

2πt

T) + a2 cos(

4πt

T) + b2 sin(

4πt

T) + a3 cos(

6πt

T) + b3 sin(

6πt

T) + .........

f(t)sin(2πt

T)dt

0

T

∫ = {DC0

T

∫ sin(2πt

T) + a1 cos(

2πt

T)sin(

2πt

T) + b1 sin(

2πt

T)sin(

2πt

T) + a2 cos(

4πt

T)sin(

2πt

T) + b2 sin(

4πt

T)sin(

2πt

T) + .........}dt

0 0 b1T/2 0 0 ……………

area=b1T/2

area=b2T/2

Page 17: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

f(t) = DC + f1(t) + f2(t) = DC + b1 • sinωt + b2 • sin2ωt

sin2

0

T

∫ (t

T) dt =

T

2

T=2

+

-+ +

+ + + +

+ + + +

+ +- -

- - - -

f(t) f(t) sin(2πt) f(t) sin(4πt)

area = DC area = b1T/2 area = b2T/2

Page 18: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

Spacing of spectral components is 1/T

Periodicity in one domain (here time) implies discrete representation in the dual domain (here frequency)

0 1/T 2/Tfrequency

0 1/T 2/Tfrequency

Phase spectrumMagnitude spectrum

Page 19: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

Aperiodic signal

T0 →∞ ⇒ frequency spacing f0 → 0

Discrete spectrum becomes continuous (Fourier integral)

0 1/T0 2/T0frequency0 1/T0 2/T0frequency

Phase spectrumMagnitude spectrum

Spacing of spectral components is f0 =1/T0

Page 20: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

Magnitude spectrum of voiced speech signal

frequency

log | S() |

F1

F2 F3

F4

f0

Page 21: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

1/f0

1/F11/F2

Waveform

Logarithmic power spectrum

f0

F1

F2 F3

Page 22: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

Going digital

Page 23: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

sampling

22 samples per 4.2 ms 0.19 ms per sample 5.26 kHz

ts=1/fs

Page 24: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

Sampling

> 2 samples per period,fs > 2 f

T = 10 ms (f = 1/T=100 Hz)

Sinusoid is characterized by three parameters1.Amplitude2.Frequency3.Phase

We need at least three samples per the period

Page 25: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

T = 10 ms (f = 1/T=100 Hz)

ts = 7.5 ms (fs=133 Hz < 2f )

Undersampling

T’ = 40 ms(f’= 25 Hz)

Page 26: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

Sampling at the Nyquist frequency

2 samples per period,fs = 2 f

Nyquist rate

ts = 5 ms (fs=200 Hz)

?

??

fs > 2 f

Page 27: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

Sampling of more complex signals

period period

highest frequencycomponent

Sampling must be at the frequency which is higher than the twice the highest frequency component in the signal !!!

fs > 2 fmax

Page 28: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

Sampling

1. Make sure you know what is the highest frequency in the signal spectrum fMAX

2. Chose sampling frequency fs > 2 fMAX

NO NEED TO SAMPLE ANY FASTER !

Page 29: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

Periodicity in one domain implies discrete representation in the dual domain

0 1/T 2/Tfrequency

Magnitude spectrumT

Page 30: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

frequency

F =1/ts

fs = 1/T

time

ts

T

Sampling in time implies periodicity in frequency !

1

0

21 )()(

N

n

N

knj

N ekXnx

1

0

21 )()(

N

n

N

knj

N enxkX

Discrete and periodic in both domains (time and frequency)

DISCRETE FOURIER TRANSFORM

Page 31: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

Recovery of analog signalDigital-to-analog converter (“sample-and-hold”)

Low-pass filtering

Page 32: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

0.0000000000000000.3090167420035500.5877848229325430.8090165264524070.9510561882928811.0000000000000000.9510570082965530.8090180861922140.5877869697305400.3090192657165440.000000000000000-0.309014218288380-0.587782676130406-0.809014966706903-0.951055368282511-1.000000000000000-0.951057828293529-0.809019645926324-0.587789116524398-0.309021789427363-0.000000000000000

Page 33: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

Quantization

11 levels

21 levels

111 levels

Page 34: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

a part of vowel /a/

16 levels (4 bits) 32 levels (5 bits) 4096 levels (12 bits)

Page 35: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

Quantization

• Quantization error = difference between the real value of the analog signal at sampling instants and the value we preserve

• Less error less “quantization distortion”

Page 36: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

Homework 2

• Create for your fun (and education) various periodic functions using Fourier principle (and listen to the created signals)

Page 37: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

Homework 3

• What happens if the signal is not periodic and why?

Page 38: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

Homework 4

• How would you transmit the signal below and why?

t0 t0

Page 39: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.

Homework 5

• A signal generator produced a triangular wave which was sampled as indicated below. Was the signal samples correctly? If not, what went wrong and how would you fix it?

time

Page 40: Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.