# Basics of Signal Processing

AI and Robotics

Nov 24, 2013 (4 years and 7 months ago)

110 views

Basics of Signal Processing

SIGNAL

SOURCE

describe waves in terms of their significant features

understand the way the waves originate

effect of the waves

will the people in the boat notice ?

ACTION

frequency = 1/T

l =

speed of sound
×

T, where T is a period

sine wave

period (frequency)

amplitude

phase

f
(
t
)
=
A
sin(
2

t
/
T

)

f
(
t
)
=
A
sin(

t

)

A
sin(

t

/
2
)
=
A
cos(

t
)
sine

cosine

Phase
F

Sinusoidal grating of image

Fourier idea

describe the
signal by a sum
of other well
defined signals

T
O

Fourier Series

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

f
(
t
)
=
w
i
i
=
0

f
i
(
t
)

A good simple function

T
i
=T
0
/ i

f
i
(
t
)
=
sin(
i

0
t

),
where

0
=
2

/
T
0

f
(
t
)
=
k
i
sin(
i

0
i
=
1

n
)
=
[
b
i
i
=
1

sin(
i

0
)

a
i
cos(
i

0
)]
=
Re
ˆ
c
i

e

j

0
n
i
=
0

,
ˆ
c

complex
e.t.c

f
(
t
)
=
k
i
sin(
i

0
i
=
1

n
)
=
[
b
i
i
=
1

sin(
i

0
)

a
i
cos(
i

0
)]
T=1/f

e.t.c……

T=1/f

e.t.c……

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

0

+

-

0

+

-

0

+

-

x

0

+

+

-

-

x

0

+

+

=

0

+

+

-

-

=

area is positive (T/2)

area is zero

=

f
(
t
)

=

DC

a
i
cos(
2

it
T
)

b
1
sin(
2

it
T
)

=
i
=
1

DC

a
1
cos(
2

t
T
)

b
1
sin(
2

t
T
)

a
2
cos(
4

t
T
)

b
2
sin(
4

t
T
)

a
3
cos(
6

t
T
)

b
3
sin(
6

t
T
)

.........

f
(
t
)
sin(
2

t
T
)
dt
0
T

=
{
DC
0
T

sin(
2

t
T
)

a
1
cos(
2

t
T
)
sin(
2

t
T
)

b
1
sin(
2

t
T
)
sin(
2

t
T
)

a
2
cos(
4

t
T
)
sin(
2

t
T
)

b
2
sin(
4

t
T
)
sin(
2

t
T
)

.........}
dt
0

0

b
1
T/2

0

0 ……………

area=b
1
T/2

area=b
2
T/2

f
(
t
)
=
DC

f
1
(
t
)

f
2
(
t
)
=
DC

b
1

sin

t

b
2

sin
2

t

sin
2
0
T

(
t
T
)

dt
=
T
2
T=2

+

-

+

+

+

+

+

+

+

+

+

+

+

+

-

-

-

-

-

-

f(t)

f(t) sin(2πt)

f(t) sin(4πt)

area = DC

area = b
1
T/2

area = b
2
T/2

Aperiodic signal

T
0

frequency spacing
f
0

0
Discrete
spectrum becomes
continuous

(Fourier integral)

0

1/T
0

2/T
0

frequency

0

1/T
0

2/T
0

frequency

Phase spectrum

Magnitude spectrum

Spacing of spectral components is f
0

=1/T
0

sampling

22 samples per 4.2 ms

0.19 ms per sample

5.26 kHz

t
s
=1/f
s

Sampling

> 2 samples per period,

f
s

> 2 f

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

Sinusoid is characterized by three parameters

1.
Amplitude

2.
Frequency

3.
Phase

We need at least three samples per the period

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

t
s

= 7.5 ms (f
s
=133 Hz < 2f )

Undersampling

T’ = 40 ms

(f’= 25 Hz)

Sampling of more complex signals

period

period

highest frequency

component

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

f
s

> 2 f
max

Sampling

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

2.
Chose sampling frequency f
s

> 2 f
MAX

NO NEED TO SAMPLE ANY FASTER !

Periodicity in one domain implies discrete representation in the dual domain

0

1/T

2/T

frequency

Magnitude spectrum

T

frequency

F

=1/t
s

f
s
= 1/T

time

t
s

T

Sampling in time implies periodicity in frequency !

=

=
1
0
2
1
)
(
)
(
N
n
N
kn
j
N
e
k
X
n
x

=

=
1
0
2
1
)
(
)
(
N
n
N
kn
j
N
e
n
x
k
X

Discrete and periodic in both domains (time and frequency)

DISCRETE FOURIER TRANSFORM

Recovery of analog signal

Digital
-
to
-
analog converter (“sample
-
and
-
hold”)

Low
-
pass filtering

0.000000000000000

0.309016742003550

0.587784822932543

0.809016526452407

0.951056188292881

1.000000000000000

0.951057008296553

0.809018086192214

0.587786969730540

0.309019265716544

0.000000000000000

-
0.309014218288380

-
0.587782676130406

-
0.809014966706903

-
0.951055368282511

-
1.000000000000000

-
0.951057828293529

-
0.809019645926324

-
0.587789116524398

-
0.309021789427363

-
0.000000000000000

Quantization

11 levels

21 levels

111 levels

a part of vowel /a/

16 levels (4 bits)

32 levels (5 bits)

4096 levels (12 bits)

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”