fs = 8000; fpass = 2000; fstop = 3500; Fpass = fpass/fs; Fstop = fstop/fs; h = firpm(20,[0 Fpass Fstop 0.5]/0.5, [1 1 0 0]); NFFT = 2^14; F = [0:NFFT-1]/NFFT - 0.5; f = F*fs; % Ploting subplot(221); plot(F,abs(fftshift(fft(h,NFFT)))); axis([0 0.5 0 1.2]); xlabel('F [cycles/sample]'); ylabel('Magnitude'); subplot(222); plot(F,20*log10(abs(fftshift(fft(h,NFFT))))); axis([0 0.5 -90 10]); xlabel('f [cycles/second]'); ylabel('Magnitude (dB)'); subplot(223); plot(f,abs(fftshift(fft(h,NFFT)))); axis([0 0.5*fs 0 1.2]); xlabel('F [cycles/sample]'); ylabel('Magnitude'); subplot(224); plot(f,20*log10(abs(fftshift(fft(h,NFFT))))); axis([0 0.5*fs -90 10]); xlabel('f [cycles/second]'); ylabel('Magnitude (dB)'); print -djpeg90 -r75 c2dfilter.jpg