ECE107L-A12-11-E3
description
Transcript of ECE107L-A12-11-E3
301.
x=[-2 4 -1 -3 5 8 2 -5]; t=0:length(x)-1;
a. x(n)
stem(t-3, x);
b. x(-n)
stem(-(t-3), x);
c. x(-n+3)
stem(-(t-3)-3,x);
d. 3x(n+4)
stem((t-3)-4,3*x);
Calaquian, Carl Alvin M. – [email protected], Raymond T. – [email protected]
e. -2x(n-3)
stem((t-3)+3,-2*x);
f. x(3n+2)
stem((t-3)/3-2,x);
g. 4x(3n-2)
stem((t-3)/3+2,4*x);
2.
x = [-2 0 -1 -3 1 2 -2 -3];
t=0:length(x)-1;
stem(t-4,x)
h=[1 2 -1 1 -2];
t=0:length(h)-1;
stem(t-4,h)
3.
a.
a=[3 3 2]; roots(a)
ans =
-0.5000 + 0.6455i
-0.5000 - 0.6455i
b.
b=[4 -9 0 8 -10]; roots(b)
ans =
2.0649
-1.1204
0.6528 + 0.8090i
0.6528 - 0.8090i
4.
a.
A=[-5 -3 -5 -3]; poly(A)
ans =
1 16 94 240 225
b.
B=[4 3 5 -2];poly(B)
ans =
1 -10 23 34 -120
5.
a.
x=[4 2 -1 3]; y=poly([3 -2 1]); [a,b,c]=residue(x,y)
a =
12.6000
-1.2667
-1.3333
b =
3.0000
-2.0000
1.0000
c =
4
b.
[x,y]=residue(a,b,c)
x =
4.0000 2.0000 -1.0000 3.0000
y =
1.0000 -2.0000 -5.0000 6.0000
roots(y)
ans =
-2.0000
3.0000
1.0000
Yes it is similar to the original equation.
6.a
>> Fs=11025;
>> mondero2=wavrecord(5*Fs,Fs, 'double');
b
plot(mondero2)
c.
Give comments: The audio has some background noise.
d.
Npoint=512; Yfft=fft(mondero,Npoint); w=(0:Npoint/2-1)/(Npoint/2*(Fs/2)); figure(2);plot(w,abs([Yfft(1:Npoint/2)']));
7. Lowpass
a
fs=11025; fc=2000; w=fc/(fs/2);[b,a]=fir1(6,w);zplane(b,a)
a =
1
b =
-0.0027 0.0426 0.2535 0.4130 0.2535 0.0426 -0.0027
impz(b,a)
freqz(b,a)
b.
[b,a]=fir1(6,2* 2000/Fs); yfilter=filter(b,a,mondero);
Npoint=512; Yfft=fft(yfilter,Npoint); w=(0:Npoint/2-1)/(Npoint/2*(Fs/2)); figure(2);plot(w,abs([Yfft(1:Npoint/2)']));
Describe the waveform: The high frequency signal was attenuated.
c.
Play the audio and describe what you hear: High pitch sound seems to have been reduced..
8. Highpass
fs=11025; fc=1000; w=fc/(fs/2);[b,a]=fir1(6,w,'high');zplane(b,a)
a =
1
b =
-0.0083 -0.0444 -0.1309 0.8103 -0.1309 -0.0444 -0.0083
impz(b,a)
freqz(b,a)
b.
yfilter=filter(b,a,mondero2); Npoint=512; Yfft=fft(yfilter,Npoint); w=(0:Npoint/2-1)/(Npoint/2*(Fs/2)); figure(2);plot(w,abs([Yfft(1:Npoint/2)']));
Describe the waveform: The magnitude of the low frequency signal was attenuated compared to the original waveform.
c.
Play the audio and describe what you hear:
Low pitch sound seems to have been reduced.
9. Bandpass
[b,a]=fir1(30,2*[2500 3000]/(Fs),'bandpass'); zplane(b,a)
a =
1
b =
-0.0002 -0.0057 0.0004 0.0135 -0.0008 -0.0299 0.0013 0.0545 -0.0017 -0.0837 0.0017 0.1115 -0.0013 -0.1316 0.0005 0.1390 0.0005 -0.1316 -0.0013 0.1115 0.0017 -0.0837 -0.0017 0.0545 0.0013 -0.0299 -0.0008 0.0135 0.0004 -0.0057 -0.0002
impz(b,a)
freqz(b,a)
b.
yfilter=filter(b,a,mondero2); Npoint=512; Yfft=fft(yfilter,Npoint); w=(0:Npoint/2-1)/(Npoint/2*(Fs/2)); figure(2);plot(w,abs([Yfft(1:Npoint/2)']));
Describe the waveform: Signals outside the cutoff frequency was attenuated.
c.
Play the audio and describe what you hear:
Barely recognizable sound was heard.
10.
[b,a]=fir1(30,2*[1500 3000]/(Fs),'stop');zplane(b,a)
a =
1
b =
-0.0004 0.0008 -0.0022 -0.0077 0.0004 0.0173 0.0095 -0.0072 0.0072 -0.0063 -0.0822 -0.0542 0.1415 0.1936 -0.0744 0.7290 -0.0744 0.1936 0.1415 -0.0542 -0.0822 -0.0063 0.0072 -0.0072 0.0095 0.0173 0.0004 -0.0077 -0.0022 0.0008 -0.0004
impz(b,a)
Freqz(b,a)
yfilter=filter(b,a,mondero2); Npoint=512; Yfft=fft(yfilter,Npoint); w=(0:Npoint/2-1)/(Npoint/2*(Fs/2)); figure(2);plot(w,abs([Yfft(1:Npoint/2)']));
Describe the waveform: Signals inside the cutoff frequency was attenuated.
c.
Play the audio and describe what you hear:
We didn’t noticed a significant difference from the original recorded sound.