Anda di halaman 1dari 1

N = 25;

f1 = 3e3;
f2 = 7e3;
fs = 2e4;
wn1 = 2 * f1 / fs;
wn2 = 2 * f2 / fs;
b = fir1(N, [wn1 wn2], hamming(N + 1));
[h, fq] = freqz(b, 1, 512, fs);
%[h, w] = freqz(b, 1);
%fq = w / (2 * pi);
amp = 20 * log10(abs(h));
phase = unwrap(angle(h)) * 180 / pi;
figure;
subplot(221);
plot(fq, amp);
axis([0 max(fq) min(amp) 10])
xlabel('Frequency [Hz]');
ylabel('Amplitude [dB]');
grid;
subplot(223);
plot(fq, phase);
%axis([0 max(fq) 1.2 * min(phase) 1.2 * max(phase
xlabel('Frequency [Hz]');
ylabel('Phase []');
grid;
subplot(222);
impz(b, 1);
xlabel('n')
subplot(224);
zplane(b, 1);

Anda mungkin juga menyukai