CD2 Filter Script
Size 1 kB - File type text/plainFile contents
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
Copyright 2008,
by the Contributing Authors.
Cite/attribute Resource.
admin. (2006, June 28). CD2 Filter Script. Retrieved August 28, 2008, from Free Online Course Materials — USU OpenCourseWare Web site: http://ocw.usu.edu/Electrical_and_Computer_Engineering/Communication_Systems_I/c2dfilter.m.
This work is licensed under a
Creative Commons License.


















Click here to get the file
