guruone
Newbie level 3
clear all;
close all;
rp=input('enter the pass band ripple');
rs=input('enter the stop band ripple');
fp=input('enter the pass band ferquency');
fs=input('enter the stop band frequency');
f=input('enter the sampling frequency');
wp=2*fp/f;
ws=2*fs/f;
num=-20*log10(sqrt(rp*rs))-13;
dem=14.6*(fs-fp)/f;
n=ceil(num/dem);
n1=n+1;
if (rem(n,2)~=0);
n1=n;
n=n-1;
end
y=boxcar(n1);
b=fir1(n,wp,y);
[h,o]=freqz(b,1,256);
m=20*log10(abs(h));
subplot(2,2,1);
plot(o/pi,m);
hi please give input values also..
i have given the values like
enter the pass band ripple0.06
enter the stop band ripple0.04
enter the pass band ferquency50
enter the stop band frequency40
enter the sampling frequency70
so the matlab shown the error like ;
?? Error using ==> check_order at 19
Order cannot be less than zero.
Error in ==> boxcar at 12
[n,w,trivialwin] = check_order(n_est);
Error in ==> noisefilter at 18
y=boxcar(n1);
so please help me..
thnxz for advance.../';
close all;
rp=input('enter the pass band ripple');
rs=input('enter the stop band ripple');
fp=input('enter the pass band ferquency');
fs=input('enter the stop band frequency');
f=input('enter the sampling frequency');
wp=2*fp/f;
ws=2*fs/f;
num=-20*log10(sqrt(rp*rs))-13;
dem=14.6*(fs-fp)/f;
n=ceil(num/dem);
n1=n+1;
if (rem(n,2)~=0);
n1=n;
n=n-1;
end
y=boxcar(n1);
b=fir1(n,wp,y);
[h,o]=freqz(b,1,256);
m=20*log10(abs(h));
subplot(2,2,1);
plot(o/pi,m);
hi please give input values also..
i have given the values like
enter the pass band ripple0.06
enter the stop band ripple0.04
enter the pass band ferquency50
enter the stop band frequency40
enter the sampling frequency70
so the matlab shown the error like ;
?? Error using ==> check_order at 19
Order cannot be less than zero.
Error in ==> boxcar at 12
[n,w,trivialwin] = check_order(n_est);
Error in ==> noisefilter at 18
y=boxcar(n1);
so please help me..
thnxz for advance.../';