Sei sulla pagina 1di 10

ECE107L – A12

Sabuco, Mari Karlo R. karlo_5577@yahoo.com

Madrid, Estelito III S. FinalOption23@yahoo.com

MODULE 3: BASIC OPERATIONS AND NON-RECURSIVE FILTER RESPONSE

30
a. x=[-2 4 -1 -3 5 8 2 -5]; 8

t=0:length(x)-1; 6

stem(t-3,x)
4

8
2

6
0
4
-2
2
-4
0
-6
-4 -3 -2 -1 0 1 2 3
-2
c. x=[-2 4 -1 -3 5 8 2 -5];
-4
t=0:length(x)-1;
-6
-3 -2 -1 0 1 2 3 4
stem(-(t-3)-3,x);

b. x=[-2 4 -1 -3 5 8 2 -5];
8
t=0:length(x)-1;
6
stem(-(t-3),x)
4

-2

-4

-6
-7 -6 -5 -4 -3 -2 -1 0
8

d. x=[-2 4 -1 -3 5 8 2 -5];
6
t=0:length(x)-1;
stem((t-3)-4,3*x); 4

25
2

20
0
15

10 -2

5
-4

0
-6
-5
-2 -1.5 -1 -0.5 0 0.5 1

-10
g. x=[-2 4 -1 -3 5 8 2 -5];
-15
-7 -6 -5 -4 -3 -2 -1 0 t=0:length(x)-1;
stem(((t-3)+2)/3,4*x);
e. x=[-2 4 -1 -3 5 8 2 -5];
40
t=0:length(x)-1;
stem((t-3)+3,-2*x); 30

10

20
5

10
0

0
-5

-10 -10

-15 -20
-0.5 0 0.5 1 1.5 2

-20
0 1 2 3 4 5 6 7

2.)
f. x=[-2 4 -1 -3 5 8 2 -5];
x=[-2 0 -1 -3 1 2 -2 -3];
t=0:length(x)-1;
t=0: length(x)-1;
stem((((t-3)-2)/3),x);
stem(t-4,x);
2
6
1.5

1 4

0.5
2
0

-0.5 0
-1

-1.5
-2

-2
-4
-2.5

-3 -6
-4 -3 -2 -1 0 1 2 3

-8
h=[1 2 -1 1 -2]; -8 -6 -4 -2 0 2 4

t=0: length(h)-1;
3.)
stem(t-4,h)
2
a.)

1.5 a=[3 3 2];


1 roots(a)
0.5 ans =
0 -0.5000 + 0.6455i
-0.5 -0.5000 - 0.6455i
-1 b.)
-1.5 b=[4 -9 0 8 -10];
-2
-4 -3.5 -3 -2.5 -2 -1.5 -1 -0.5 0
roots(b)
ans =
conv(x,h);
2.0649
t=0: length(ans)-1;
-1.1204
stem(t-8,ans);
0.6528 + 0.8090i
0.6528 - 0.8090i
4.)
a.)
a=[-5 -3 -5 -3];
poly(a)
ans = 6.
1 16 94 240 225 a) fs=11025;
b.) wavrecord(5*fs,fs,'double');
b=[4 3 5 -2]; wavplay (Sabuco,fs)
poly(b) save Sabuco
ans = plot(Sabuco)
1 -10 23 34 -120
5.) b)
a.) 1

x=[4 2 -1 3]; 0.8

0.6
y=poly([3 -2 1]);
0.4
[a,b,c]=residue(x,y)
0.2
a=
0
12.6000
-0.2
-1.2667
-0.4
-1.3333
-0.6
b=
-0.8
3.0000
-1
0 1 2 3 4 5 6
-2.0000 4
x 10

1.0000 c) ANSWER: The audio signal is a


c= bit noisy.
4 d)
Sabuco1=fft(Sabuco,512);
b.) w=(0:255)/(256*(11025/2));
[x,y]=residue(a,b,c) plot(w,abs([Sabuco1(1:256)]));
x=
4.0000 2.0000 -1.0000 3.0000
y=
1.0000 -2.0000 -5.0000 6.0000

Answer: Yes, it is similar to the original


signal.
x 10
-3 impz(b,a)
9
0.45
8
0.4
7
0.35
6
0.3
5
0.25
4
0.2
3
0.15
2
0.1
1
0.05
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
0
-4
x 10
-0.05
0 1 2 3 4 5 6
7.
a.) freqz(b,a)
0
fs=11025;
-20
Magnitude (dB)

fc=2000;
-40

w=fc/(fs/2) -60

-80
[b,a]=fir1(6,w,'low')
-100
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
b=
Normalized Frequency ( rad/sample)

-0.0027 0.0426 0.2535 0.4130 0.2535 0

-100
Phase (degrees)

0.0426 -0.0027
-200
a= -300

1 -400

-500
zplane(b,a) 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
10

8 b.
6
Sabucofilter=filter(b,a,Sabuco);
4
Sabucofft=fft(Sabucofilter,512);
Imaginary Part

0
6 w=(0:255)/256*(fs/2);
-2
plot(w,abs([Sabucofft(1:256)']));
-4

-6

-8

-10
0 5 10 15 20
Real Part
x 10
-3
zplane(b,a)
9

5
8

4
7

6
3

5 2

Imaginary Part
4 1
6
3 0

2 -1

1 -2

0 -3
0 1000 2000 3000 4000 5000 6000

-4
c. ANSWER: It is clearer than the
-5
original signal. -6 -4 -2 0 2 4
Real Part

8.
impz(b,a);
fs=11025;
1.2
fc=1000;
x=fc/(fs/2); 1

[b,a]=fir1(6,x,'high')
0.8

0.6
b=
-0.0083 -0.0444 -0.1309 0.8103 -0.1309 - 0.4

0.0444 -0.0083
0.2

a= 0

1 -0.2
0 1 2 3 4 5 6
freqz(c,d); fc2=3000;
0
c1=fc1/(fs/2)
Magnitude (dB)

-2
c2=fc2/(fs/2);
-4

-6
[b,a]=fir1(30,[c1,c2],'bandpass')
-8
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
0
b=
Columns 1 through 9
Phase (degrees)

-200

-400

-0.0002 -0.0057 0.0004 0.0135 -0.0008


-600
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
-0.0299 0.0013 0.0545 -0.0017

b.)
Columns 10 through 18
Sabucofilter=filter(b,a,Sabuco);
Sabucofft=fft(Sabucofilter,512);
-0.0837 0.0017 0.1115 -0.0013 -0.1316
w=(0:255)/256*(fs/2);
0.0005 0.1390 0.0005 -0.1316
plot(w,abs([Sabucofft(1:256)']))
-3
x 10
4 Columns 19 through 27
3.5

3 -0.0013 0.1115 0.0017 -0.0837 -0.0017


2.5 0.0545 0.0013 -0.0299 -0.0008
2

1.5 Columns 28 through 31


1

0.5 0.0135 0.0004 -0.0057 -0.0002


0
0 1000 2000 3000 4000 5000 6000

a=
c.) Answer: The audio signal seems
clearer but the volume decreased.
1

9.
a.
fs=11025;
fc1=2500;
zplane(b,a) freqz(b,a)
0
10

Magnitude (dB)
8
-50
6

4 -100
Imaginary Part

2
30 -150
0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-2
Normalized Frequency ( rad/sample)
500
-4

Phase (degrees)
-6
0
-8

-10 -500
-25 -20 -15 -10 -5 0
Real Part
-1000
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

Impz(b,a)
0.15 b.

0.1 Sabucofilter=filter(b,a,Sabuco);

0.05
Sabucofft=fft(Sabucofilter,512);
w=(0:255)/256*(fs/2);
0

plot(w,abs([Sabucofft(1:256)']))
-0.05
-3
x 10
-0.1
2.5

-0.15
2
-0.2
0 5 10 15 20 25 30

1.5

0.5

0
0 1000 2000 3000 4000 5000 6000
c. ANSWER: The volume of the audio signal zplane(b,a)
decreases.
3

2
10.
a. 1

Imaginary Part
fs=11025; 30
0

fc1=1500;
-1
fc2=3000;
c1=fc1/(fs/2); -2

c2=fc2/(fs/2); -3

[b,a]=fir1(30,[c1 c2],'stop') -4 -3 -2 -1 0 1 2 3 4
Real Part
b=
Columns 1 through 9
freqz(b,a)
-0.0004 0.0008 -0.0022 -0.0077 0.0004
20
0.0173 0.0095 -0.0072 0.0072
0
Magnitude (dB)

-20

-40
Columns 10 through 18
-60
-0.0063 -0.0822 -0.0542 0.1415 0.1936 -80
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-0.0744 0.7290 -0.0744 0.1936 Normalized Frequency ( rad/sample)
0

-500
Phase (degrees)

Columns 19 through 27 -1000

-1500
0.1415 -0.0542 -0.0822 -0.0063 0.0072
-2000
-0.0072 0.0095 0.0173 0.0004 -2500
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

Columns 28 through 31
-0.0077 -0.0022 0.0008 -0.0004 b.
Sabucofilter=filter(b,a,Sabuco);
a= Sabucofft=fft(Sabucofilter,512);
1 w=(0:255)/256*(fs/2);
plot(w,abs([Sabucofft(1:256)']))
-3
x 10
6

0
0 1000 2000 3000 4000 5000 6000

c. ANSWER: It is clearer than the original signal.

Potrebbero piacerti anche