You are on page 1of 64

OT3OS1

10.01.2008.

Sve najbolje u novoj godini


Puno :
Ljubavi
Sree
Poloenih ispita
Telekomunikacije (bar do 3)
Obrada signala (bar do 1, a ima i 2 koga zanima)

Metode projektovanja IIR filtara

Specifikacije za amplitudsku
karakteristiku

Impulsno invarijantna
transformacija (1)
R

uU

uI

C1R1 = 0.0016 s
C2R2 = 0.0159 s
1
1
CR
H a (s ) =
=
1 + sCR
1
s

CR

Impulsno invarijantna
transformacija (2)
R

uU

f3 dB =

uI

3 dB
1 1
=
2
2 CR

C1R1 = 0.0016 s

C2R2 = 0.0159 s

Impulsno invarijantna
transformacija (3)
R
N

Rk
k =1 s sk

H a (s ) =
uU

uI

1
1
CR
H a (s ) =
=
1 + sCR
1
s

CR
k = 1 R1 =

1
1
s1 =
CR
CR

Impulsno invarijantna
transformacija (4)
N

Rk
k =1 s s k

H a (s ) =

N
Rk e sk t , t 0
ha (t ) = k =0

0,
t <0
N

h(n ) = Tha (nT ) = TRk e sk nT u (n )

k = 1 R1 =

1
1
s1 =
CR
CR

1 RC
ha (t ) =
e
RC

k =1

nT

T RC
h(n ) = Tha (nT ) =
e u (n )
RC

Impulsno invarijantna
transformacija (5)
nT

T RC
h(n ) = Tha (nT ) =
e u (n )
RC

H (z ) = h(n )z n
n =0

H (z ) =

T
RC
1 e

T
CR

z 1

C2R2 = 0.0159 s

Impulsno invarijantna
transformacija (6)
nT

T RC
h(n ) = Tha (nT ) =
e u (n )
RC

H (z ) = h(n )z n
n =0

H (z ) =

T
RC
1 e

T
CR

z 1

C1R1 = 0.0016 s

Impulsno invarijantna
transformacija (7)

C2R2 = 0.0159 s

C1R1 = 0.0016 s

Bilinearna transformacija (1)


R

uU

f3 dB =

uI

3 dB
1 1
=
2
2 CR

C1R1 = 0.0016 s
C2R2 = 3.1831e - 004 s

Bilinearna
transformacija
(2)
C1R1 = 0.0016 s

Bilinearna
transformacija
(3)
C2R2 = 3.1831e - 004 s

Bilinearna
transformacija
(4)
gDIG gANALOG
gANALOG _ KORIGOVANO

g
= 2fs tg
2

C2R2 = 2.5000e - 004 s

Bilinearna transformacija (5)


Filter propusnik opsega
Propusni opseg 200 300Hz
Frekvencija odabiranja 2000 Hz
Red filtra 2

Bilinearna transformacija (5)


1 = 2

fg 1
fs

206.8 Hz

fg 1
2 1
rad
1 = tg = 2fs tg = 4000 0.3249 = 1299.6
s
T 2
fs
324.4 Hz
fg 2
rad
2 2

2 = tg = 2fs tg
= 4000 0.5095 = 2038.0

T 2
s
fs


0 = 1 2

W = 2 1

PONF prototip

Red LP analognog
prototip filtra e biti 1!

Bilinearna transformacija (6)


1
H (s ) =
LP
1+ s

NF prototip p=1

H (s ) = H (s ) s =(s 2 + 2 ) (s
0

2 1 z 1
s=
T 1 + z 1

H ( z ) = H S (s )

W s
= 2
s + W s + 02

BP

Red BP analognog
filtra e biti 2!

cija
a
rm
o
f
ns iltar
a
r
a t lni f
n
r
e a ig i t a
n
i
l
d
Bi

s=

2 z 1
T z +1

1 z 2
= 0.1367
1 1.2362 z 1 + 0.7265 z 2

Bilinearna transformacija (7)


0

MATLAB
proracun

-10
-20

[b,a]=butter(1,[200 300]/1000);
b1=0.1367*[1 0 -1];
a1=[1 -1.2362 0.7265];
[H,w]=freqz(b,a,1000,2000);
[H1,w]=freqz(b1,a1,1000,2000);
plot(w,20*log10(abs(H)),
w,20*log10(abs(H1)));

|H(ejw )|[dB]

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

200

400

600
f [Hz]

800

1000

Primer 1 - LP
f0=8000;
fp=1000;
fs=2000;
wp=fp/(f0/2);
ws=fs/(f0/2);
rp=1;
rs=40;
[nb,wnb]=buttord(wp,ws,rp,rs)
[nc1,wnc1]=cheb1ord(wp,ws,rp,rs)
[nc2,wnc2]=cheb2ord(wp,ws,rp,rs)
[ne,wne]=ellipord(wp,ws,rp,rs)
[bb,ab]=butter(nb,wnb);
[bc1,ac1]=cheby1(nc1,rp,wnc1);
[bc2,ac2]=cheby2(nc2,rs,wnc2);
[be,ae]=ellip(ne,rp,rs,wne);

***ord ista lista


ulaznih podataka

Projektovanje filtra
razliita lista
ulaznih podataka

Primer 1 rezultati1
nb =
6
wnb =
0.2767
nc1 =
4
wnc1 =
0.2500
nc2 =
4
wnc2 =
0.5000
ne =
4
wne =
0.2500

U optem sluaju red


eliptikog filtra e biti najmanji

Primer 1 rezultati2
1.4

Butt
Cheb1
Cheb2
ellip

1.2

|H(ejw )|

ebievljev I i eliptiki
talasanje u propusnom opsegu

0.8

0.6

0.4

0.2

1000

2000
f [Hz]

3000

4000

Primer 1 rezultati3
50

Butt
Cheb1
Cheb2
ellip

0
-50

ebievljev II i eliptiki
talasanje u nepropusnom opsegu

|H(ejw )|[dB]

-100
-150
-200
-250
-300
-350

1000

2000
f [Hz]

3000

4000

Primer 1 rezultati4
1

Butt

Imaginary Part

0.5

-0.5

-1
-1

-0.5

0
Real Part

0.5

Primer 1 rezultati5
1

Cheb1

Imaginary Part

0.5

-0.5

-1
-1

-0.5

0
Real Part

0.5

Primer 1 rezultati6
1

Cheb2

Imaginary Part

0.5

-0.5

-1
-1

-0.5

0
Real Part

0.5

Primer 1 rezultati7
1

ellip

Imaginary Part

0.5

-0.5

-1
-1

-0.5

0
Real Part

0.5

Primer 2
f0=80000;
Promenjeno f0
fp=1000;
fs=2000;
wp=fp/(f0/2);
ws=fs/(f0/2);
rp=1;
rs=40;
[nb,wnb]=buttord(wp,ws,rp,rs)
[nc1,wnc1]=cheb1ord(wp,ws,rp,rs)
[nc2,wnc2]=cheb2ord(wp,ws,rp,rs)
[ne,wne]=ellipord(wp,ws,rp,rs)
[bb,ab]=butter(nb,wnb);
[bc1,ac1]=cheby1(nc1,rp,wnc1);
[bc2,ac2]=cheby2(nc2,rs,wnc2);
[be,ae]=ellip(ne,rp,rs,wne);

Primer 2 rezultati1
nb =
8
wnb =
0.0282
nc1 =
5
wnc1 =
0.0250
nc2 =
5
wnc2 =
0.0500
ne =
4
wne =
0.0250

Primer 2 rezultati2
1.4

Butt
Cheb1
Cheb2
ellip

1.2

|H(ejw )|

0.8

0.6

0.4

0.2

2
f [Hz]

4
4

x 10

Primer 2 rezultati3
100

Butt
Cheb1
Cheb2
ellip

|H(ejw )|[dB]

-100

-200

-300

-400

-500

-600

2
f [Hz]

4
4

x 10

Primer 2 rezultati4
1

Butt

Imaginary Part

0.5

-0.5

-1
-1

-0.5

0
Real Part

0.5

Primer 2 rezultati5
1

Cheb1

Imaginary Part

0.5

-0.5

-1
-1

-0.5

0
Real Part

0.5

Primer 2 rezultati6
1

Cheb2

Imaginary Part

0.5

-0.5

-1
-1

-0.5

0
Real Part

0.5

Primer 2 rezultati7
1

ellip

Imaginary Part

0.5

-0.5

-1
-1

-0.5

0
Real Part

0.5

Primer 3 - HP
f0=8000;
fp=2000;
fs=1000;
wp=fp/(f0/2);
ws=fs/(f0/2);
rp=1;
rs=40;
[nb,wnb]=buttord(wp,ws,rp,rs)
[nc1,wnc1]=cheb1ord(wp,ws,rp,rs)
[nc2,wnc2]=cheb2ord(wp,ws,rp,rs)
[ne,wne]=ellipord(wp,ws,rp,rs)
[bb,ab]=butter(nb,wnb,'high');
[bc1,ac1]=cheby1(nc1,rp,wnc1,'high');
[bc2,ac2]=cheby2(nc2,rs,wnc2,'high');
[be,ae]=ellip(ne,rp,rs,wne,'high');

Kljuna re high

Primer 3 rezultati1
nb =
6
wnb =
0.4638
nc1 =
4
wnc1 =
0.5000
nc2 =
4
wnc2 =
0.2500
ne =
4
wne =
0.5000

Primer 3 rezultati2
1.4

Butt
Cheb1
Cheb2
ellip

1.2

|H(ejw )|

0.8

0.6

0.4

0.2

1000

2000
f [Hz]

3000

4000

Primer 3 rezultati3
50

Butt
Cheb1
Cheb2
ellip

0
-50

|H(ejw )|[dB]

-100
-150
-200
-250
-300
-350
-400

1000

2000
f [Hz]

3000

4000

Primer 3 rezultati4
1

Butt

Imaginary Part

0.5

-0.5

-1
-1

-0.5

0
Real Part

0.5

Primer 3 rezultati5
1

Cheb1

Imaginary Part

0.5

-0.5

-1
-1

-0.5

0
Real Part

0.5

Primer 3 rezultati6
1

Cheb2

Imaginary Part

0.5

-0.5

-1
-1

-0.5

0
Real Part

0.5

Primer 3 rezultati7
1

ellip

Imaginary Part

0.5

-0.5

-1
-1

-0.5

0
Real Part

0.5

Primer 4 - BP
f0=8000;
fp=[2000 3000];
fp i fs - vektori
fs=[1000 3500];
wp=fp/(f0/2);
ws=fs/(f0/2);
rp=1;
rs=40;
[nb,wnb]=buttord(wp,ws,rp,rs)
[nc1,wnc1]=cheb1ord(wp,ws,rp,rs)
[nc2,wnc2]=cheb2ord(wp,ws,rp,rs)
[ne,wne]=ellipord(wp,ws,rp,rs)
[bb,ab]=butter(nb,wnb);
[bc1,ac1]=cheby1(nc1,rp,wnc1);
[bc2,ac2]=cheby2(nc2,rs,wnc2);
[be,ae]=ellip(ne,rp,rs,wne);

Primer 4 rezultati1
nb =
5
wnb =
0.4641

0.7744

nc1 =
4
wnc1 =
0.5000

0.7500

nc2 =
4
wnc2 =
0.2500

0.8750

ne =
3
wne =
0.5000

0.7500

n* - red NF (LP) prototipa

wn* - vektori

Primer 4 rezultati2
1

Butt
Cheb1
Cheb2
ellip

0.9
0.8
0.7

|H(ejw )|

0.6
0.5
0.4
0.3
0.2
0.1
0

1000

2000
f [Hz]

3000

4000

Primer 4 rezultati3
0

Butt
Cheb1
Cheb2
ellip

-50

|H(ejw )| [dB]

-100

-150

-200

-250

-300

-350

1000

2000
f [Hz]

3000

4000

Primer 4 rezultati4
1

Butt

Imaginary Part

0.5

3
2

-0.5

-1
-1

-0.5

0
Real Part

0.5

Primer 4 rezultati5
1

Cheb1

Imaginary Part

0.5

-0.5

-1
-1

-0.5

0
Real Part

0.5

Primer 4 rezultati6
1

Cheb2

Imaginary Part

0.5

-0.5

-1
-1

-0.5

0
Real Part

0.5

Primer 4 rezultati7
1

ellip

Imaginary Part

0.5

-0.5

-1
-1

-0.5

0
Real Part

0.5

Primer 5 - BS
f0=8000;
fp=[1000 3500];
fp i fs - vektori
fs=[2000 3000];
wp=fp/(f0/2);
ws=fs/(f0/2);
rp=1;
rs=40;
[nb,wnb]=buttord(wp,ws,rp,rs)
[nc1,wnc1]=cheb1ord(wp,ws,rp,rs)
[nc2,wnc2]=cheb2ord(wp,ws,rp,rs)
[ne,wne]=ellipord(wp,ws,rp,rs)
[bb,ab]=butter(nb,wnb,'stop');
[bc1,ac1]=cheby1(nc1,rp,wnc1,'stop');
Kljuna re stop
[bc2,ac2]=cheby2(nc2,rs,wnc2,'stop');
[be,ae]=ellip(ne,rp,rs,wne,'stop');

Primer 5 rezultati1
nb =
5
wnb =
0.3364

0.8490

nc1 =
4
wnc1 =
0.2500

0.8750

nc2 =
4
wnc2 =
0.5000

0.7500

ne =
3
wne =
0.2500

0.8750

n* - red NF (LP) prototipa

wn* - vektori

Primer 5 rezultati2
1.4

Butt
Cheb1
Cheb2
ellip

1.2

|H(ejw )|

0.8

0.6

0.4

0.2

1000

2000
f [Hz]

3000

4000

Primer 5 rezultati3
50

Butt
Cheb1
Cheb2
ellip

0
-50

|H(ejw )| [dB]

-100
-150
-200
-250
-300
-350

1000

2000
f [Hz]

3000

4000

Primer 5 rezultati4
1

Butt

Imaginary Part

0.5

-0.5

-1
-1

-0.5

0
Real Part

0.5

Primer 5 rezultati5
4

Cheb1

Imaginary Part

0.5

-0.5
4
-1
-1

-0.5

0
Real Part

0.5

Primer 5 rezultati6
1

Cheb2

Imaginary Part

0.5

-0.5

-1
-1

-0.5

0
Real Part

0.5

Primer 5 rezultati7
1

ellip

Imaginary Part

0.5

-0.5

-1
-1

-0.5

0
Real Part

0.5

Primer 6 notch IIR filter


Projektovati notch IIR filtar koji zadovoljava:
1. Potiskuje se frekvencija 50 Hz
2. 3 dB propusni opseg je +/- 5 Hz u odnosu na frekvenciju koja se
potiskuje
3. Frekvencija odabiranja je 500 Hz

Primer 6 reenje1
1. Postavimo nulu na 2*pi*50/500
1
0.8

Koeficijenti b (uz x)
1.0000
-0.8090 - 0.5878i

0.6

Imaginary Part

0.4

Magnitude (dB)

200
0

0
-0.2
-0.4
-0.6

-200

-0.8
-400

50

100
150
Frequency (Hz)

200

100
150
Frequency (Hz)

200

250

50
0
-50
-100

50

-1
-1

100
Phase (degrees)

0.2

250

-0.5

0
Real Part

0.5

Primer 6 reenje2
2. Dodamo konjugovano kompleksnu nulu

1
0.8
0.6

Koeficijenti b (uz x)
1.0000 -1.6180 1.0000

Imaginary Part

0.4

Magnitude (dB)

20

0
-0.2

-0.4

-20

-0.6
-0.8

-40
-60

-1
0

50

100
150
Frequency (Hz)

200

250

50

100
150
Frequency (Hz)

200

250

150
Phase (degrees)

0.2

100
50
0
-50

-1

-0.5

0
Real Part

0.5

Primer 6 reenje3
2. Dodamo konjugovano kompleksne polove
Koeficijenti a (uz z)
1.0000 -1.5164 0.8783

1
0.8
0.6
0.4
Imaginary Part

Magnitude (dB)

10
0
-10

-20

Phase (degrees)

0
-0.2
-0.4
-0.6

50

100
150
Frequency (Hz)

200

250

-0.8
-1

100

-1

50
0
-50
-100

0.2

50

100
150
Frequency (Hz)

200

250

-0.5

0
Real Part

0.5

Primer 6 - reenje - kod


close all
clear
fs=500;
bw=10;
w0=2*pi*50/500;
z0=exp(j*w0);
figure,zplane(z0);
b0=poly(z0)
figure,freqz(b0,1,fs,fs)
z1=exp(-j*w0);
z_uk=[z0;z1];
figure,zplane(z_uk);
b1=poly(z_uk)
figure,freqz(b1,1,fs,fs)
ro=1-(bw/fs)*pi
p_uk=ro*[exp(j*w0);exp(-j*w0)]
figure,zplane(z_uk,p_uk);
a1=poly(p_uk)
figure,freqz(b1,a1,fs,fs)

You might also like