Google Search

Wednesday, December 7, 2011

DSP program for the design of chebyshev high pass filter



High Pass: -

%program for the design of chebyshev high pass filter
clc;
close all;
clear all;
format long
rp=input('enter the passband ripple...');
rs=input('enter the stopband ripple...');
wp=input('enter the passband freq.....');
ws=input('enter the stopband freq.....');
fs=input('ente the sampling freq......');
w1=2*wp/fs;
w2=2*ws/fs;
[n,wn]=cheb1ord(w1,w2,rp,rs,'s');
[b,a]=cheby1(n,rp,wn,'high','s');
w=0:0.01:pi;
[h,om]=freqs(b,a,w);
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1);
plot(om/pi,m);
ylabel('GainindB-->');
xlabel('(a) Nomralised frequency-->');
subplot(2,1,2);
plot(om/pi,an);
xlabel('(b) Normalised frequency')
ylabel('Phase in radians')

  
Output: -

enter the passband ripple...0.3
enter the stopband ripple...60
enter the passband freq.....1500
enter the stopband freq.....2000
ente the sampling freq......9000




0 comments:

Post a Comment