You are on page 1of 2

x = randn(1,2000);

h = [-0.0027928282048433417
0.019611402535225413
-0.030152862174348958
0.0029132557258558086
0.017650541562226386
0.0085447193421139475
-0.010909288458712635
-0.019212438548429953
-0.0038524182976162383
0.021126406534701801
0.024552069749564261
-0.0055720948067067783
-0.039186658257994847
-0.029796339375519676
0.02868659196131226
0.076243662326389072
0.033418529048071036
-0.1161982896819789
-0.29063219528516504
0.63196267707565978
-0.29063219528516504
-0.1161982896819789
0.033418529048071036
0.076243662326389072
0.02868659196131226
-0.029796339375519676
-0.039186658257994847
-0.0055720948067067783
0.024552069749564261
0.021126406534701801
-0.0038524182976162383
-0.019212438548429953
-0.010909288458712635
0.0085447193421139475
0.017650541562226386
0.0029132557258558086
-0.030152862174348958
0.019611402535225413
-0.0027928282048433417 ];
b = h;
a = [1];
W=0:pi/1000:pi;
fs = 16000;
H=freqz(b,a,W);
HdB = 10*log(abs(H));

subplot(4,4,[1 2, 5 6]);
plot(W*fs/(2*pi),HdB);
grid; title('Respuesta en Amplitud');
axis([0 fs/2 -90 5]);
ylabel('|H(e^jw)|(dB)'); xlabel('f(Hz)');

y = filter(b,a,x);
Y = freqz(y,a,W);
YdB = 10*log(abs(Y)/120);

subplot(4,4,[3 4, 7 8]);
x1 = filter(a,a,x);
X = freqz(x1,a,W);
XdB = 10*log(X);
plot(W*fs/(2*pi),abs(X));
grid; title('Espectro de la Se�al de Entrada X');
axis([0 fs/2 0 120]);
ylabel('|H(e^jw)|'); xlabel('f(Hz)');

subplot(4,4,[9 10, 13 14]);


plot(W*fs/(2*pi),abs(Y));
axis([0 fs/2 -1 120]);
grid; title('Respuesta en Amplitud con Entrada X');
ylabel('|H(e^jw)|'); xlabel('f(Hz)');

subplot(4,4,[11 12, 15 16]);


plot(W*fs/(2*pi),YdB);
grid; title('Respuesta en Amplitud con Entrada X (dB)');
axis([0 fs/2 -90 5]);
ylabel('|H(e^jw)|(dB)'); xlabel('f(Hz)');

You might also like