Professional Documents
Culture Documents
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.)
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
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)
-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
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
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)
-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