Sie sind auf Seite 1von 26

Fundamentals of Digital Signal Processing

Fourier Transform of continuous time signals


X ( F ) FT x(t )

x(t ) IFT X ( F )

j 2 Ft
x
(
t
)
e
dt

j 2 Ft
X
(
F
)
e
dF

with t in sec and F in Hz (1/sec).


Examples:

T sinc FT
F F
FT e

FT rect

t
T0

j 2 F0 t

FT cos 2 F0t 12 e j F F0 12 e j F F0

Discrete Time Fourier Transform of sampled signals


X ( f ) DTFT x[n]

j 2 fn
x
[
n
]
e

x[n] IDTFT X ( f ) 1 X ( f )e j 2 fn df
1
2

with f the digital frequency (no dimensions).


Example:

( f f

DTFT e j 2 f0 n

since, using the Fourier Series,

(t k ) e

j 2 nt

k)

Property of DTFT

f is the digital frequency and has no dimensions


X ( f ) X ( f 1) is periodic with period f = 1.
X(f )

1
2

1
2

we only define it on one period 12 f


X(f )

1
2

1
2

Sampled Complex Exponential: no aliasing

x(t ) e

x[n] x(nTs ) e

j 2 F0 t

j 2

F0
n
Fs

Fs 1 / Ts

1. No Aliasing

Fs
F0
2

X (F )

Fs
2

X(f )
F0

Fs
2

f0

1
2

digital frequency f 0

f
F0
Fs

Sampled Complex Exponential: aliasing

x(t ) e

x[n] x(nTs ) e

j 2 F0 t

j 2

F0
n
Fs

Fs 1 / Ts

2. Aliasing

Fs
F0
2
X(f )

X (F )

F
s
2

Fs
2

F0

f0

digital frequency

f0

1
2

F
F0
round 0
Fs
Fs

Mapping between Analog and Digital Frequency

x[n] x(nTs ) e j 2 f0 n

x(t ) e j 2 F0t
Fs 1 / Ts

F0
F0

f0
round
Fs
Fs

Example
x(t ) e j 2 1000t
Fs 3kHz

Then:
analog frequency

F0 1000 Hz

FT: X FT ( F ) ( F 1000)
digital frequency
DTFT:

f0

F0
Fs

round

X DTFT ( f ) f 13


F0
Fs

for | f |

1
3

1
2

round 13

1
3

Example
x(t ) e j 2 2000t
Fs 3kHz

Then:
analog frequency

F0 2000 Hz

FT: X FT ( F ) ( F 2000)
digital frequency
DTFT:

f0

F0
Fs

round

X DTFT ( f ) f 13

for


F0
Fs

2
3

| f |

round 23 13
1
2

Example
x(t ) cos(8000 t 0.1 ) 12 e j 0.1 e j 8000 t 12 e j 0.1 e j 8000 t
Fs 3kHz

Then:
analog frequencies
FT:

F0 4000 Hz, F1 4000 Hz

X FT ( F ) 12 e j 0.1 ( F 4000) 12 e j 0.1 ( F 4000)

digital frequencies

f 0 43 round 43 43 1

1
3

f1 43 round 43 43 ( 1) 13
DTFT

X DTFT ( f ) 12 e j 0.1 f 13 12 e j 0.1 f 13

| f |

1
2

Linear Time Invariant (LTI) Systems and z-Transform

x[n]

h[n]

y[n]

If the system is LTI we compute the output with the convolution:

y[n] h[n] * x[n]

h[m]x[n m]

If the impulse response has a finite duration, the system is called FIR
(Finite Impulse Response):

y[n] h[0]x[n] h[1]x[n 1] ... h[ N ]x[n N ]

Z-Transform

X ( z ) Z x[n]

n
x
[
n
]
z

Facts:

x[n]

H (z )

y[n]

Y ( z) H ( z) X ( z)
Frequency Response of a filter:

H ( f ) H ( z ) z e j 2f

Digital Filters
x[n]
Ideal Low Pass Filter
constant magnitude
in passband

H (z )

y[n]

H( f )
12

A
fP

1
2

H( f )
fP
and linear phase

12

1
2

passband

Impulse Response of Ideal LPF


Assume zero phase shift,
1
2

hideal [n] 1 H ( f )e

j 2 fn

df

fP

fP

Ae j 2 fn df

hideal [n] 2 Af P sinc 2 f P n


h[n ]
f P 0.1
A 1

fp=0.1

0.2

0.15

0.1

0.05

-0.05
-50

-40

-30

-20

-10

0
n

10

20

30

40

50

This has Infinite Impulse Response, non recursive and it is noncausal. Therefore it cannot be realized.

Non Ideal Ideal LPF


The good news is that for the Ideal LPF

lim hideal [n] 0

h[n]

h[n]

2L

Frequency Response of the Non Ideal LPF

ripple

| H( f )|

1 1
1 1

f P f STOP
stop

pass

stop

transition region

LPF specified by:


passband frequency

fP
1 1
10 1 1

dB
1 or RP 20 log
stopband frequency f STOP
stopband attenuation 2 or RS 20 log10 2 dB
passband ripple

attenuation

Best Design tool for FIR Filters: the Equiripple algorithm (or Remez). It
minimizes the maximum error between the frequency responses of the
ideal and actual filter.
| H( f )|
1 1
ripple

1 1

f1

attenuation

1
2

f2

h firpm N , 0, f1 , f 2 , f 3 / f 3 , 1,1, 0, 0 , w1 , w2
impulse response
h h[0],..., h[ N ]

/ w1

/ w2

f1

f2

f3

1
2

Linear Interpolation

The total impulse response length N+1 depends on:


transition region
attenuation in the stopband

| H( f )|

Example:
we want

f1 f 2

Passband: 3kHz

f f 2 f1

Stopband: 3.5kHz

f ~

Attenuation: 60dB

20 log10 ( 2 )
22

Sampling Freq: 15 kHz


Then: from the specs f

3.5 3.0
15.0

We determine the order the filter

301
N~

60
22

30 82

1
N

Frequency response

magnitude

20

-20

dB

N=82

-40

-60

-80

-100

magnitude

20

0.1

0.2
0.3
digital frequency

0
-20

N=98

dB

-40
-60
-80
-100
-120

0.1

0.2
0.3
digital frequency

0.4

0.5

0.4

0.5

Example: Low Pass Filter


Passband f = 0.2
Stopband f = 0.25 with attenuation 40dB
Choose order N=40/(22*(0.25-0.20))=37
magnitude

20

| H( f ) |

0
-20

Almost 40dB!!!

dB

-40
-60
-80
-100
-120

0.1

0.2
0.3
digital frequency

0.4

0.5

Example: Low Pass Filter


Passband f = 0.2
Stopband f = 0.25 with attenuation 40dB
Choose order N=40 > 37
magnitude

10

| H( f ) |

0
-10

dB

-20

OK!!!

-30
-40
-50
-60
-70
-80

0.1

0.2
0.3
digital frequency

0.4

0.5

General FIR Filter of arbitrary Frequency Response


w1
H0
H1 H w2
f [0, f1 , f 2 ,..., f M ]
2

H [ H 0 , H1 ,..., H M ]
Weights for Error:

H3
0

f1 f 2

f3

w( M 1) / 2
HM

H M 1

f M 1 f M

w [ w1 , w2 ,..., w( M 1) / 2 ]
Then apply:

h firpm N , f / f M , H , w
and always check frequency response if it is what you expect!

1
2

Example:

H ( f ) 1/ sinc( f )

for

H( f ) 0

0 f 0.2
0.25 f 0.5

A 40dB
0

0.2 0.25

0.5

fp=0:0.01:0.2;

% vector of passband frequencies

fs=[0.25,0.5];

% stopband frequencies

M=[1./sinc(fp), 0, 0];
% desired magnitudes
Df=0.25-0.2;
% transition region
N=ceil(A/(22*Df));
% first guess of order
h=firpm(N, [ fp, fs]/0.5,M);
% impulse response

magnitude

1.4

not very good here!

1.2
1
0.8
0.6
0.4
0.2
0

0.1

0.2
0.3
digital frequency

0.4

0.5

10
0

dB

-10
-20
-30

N 37

-40
-50
-60
-70
-80
-90

0.1

0.2

0.3

0.4

0.5

To improve it:
1. Increase order
2. Add weights

A 40dB
0

w 1

0.2 0.25

w 0.2

0.5

w=[1*ones(1,length(fp)/2), 0.2*ones(1, length(fs)/2)];


h=firpm(N, [fp, fs]/0.5,M,w);

magnitude

1.4
1.2
1
0.8
0.6
0.4
0.2
0

0.1

0.2
0.3
digital frequency

0.4

0.5
20
0

N 100

dB

-20
-40
-60
-80
-100
-120
-140
-160

0.1

0.2

0.3

0.4

0.5

Das könnte Ihnen auch gefallen