unexpected error
2 views (last 30 days)
Show older comments
clear all
Fs = 10000;
Fn = Fs/2;
N = 200;
B = 16;
fc1 = 4911/Fn; %lower cutoff
fc2 = 5645/Fn;
Fc = [ fc1 fc2];
w = bartlett(N+1);
w = w/max(w);
w = round(w.*((2^(B-1))-1));
b = FIR1(N,Fc,'bandpass',w);
Hd = dfilt.dffir(b);
Hd.arithmetic = 'fixed'; % Requires the Fixed-Point Toolbox
coewrite(Hd,16,'bar22_filtercoefile');
error :Error using ==> fir1 at 77
Frequencies must fall in range between 0 and 1.
Error in ==> nw_filbart at 12
b = FIR1(N,Fc,'bandpass',w);
sir, i can't resolve the error, please fix it.
0 Comments
Answers (1)
Sean de Wolski
on 5 Jan 2012
From the doc for fir1 ( doc fir1):
Wn is a number between 0 and 1, where 1 corresponds to the Nyquist frequency.
Here you are giving it the variable Fc as Wn and
Fc =
0.9822 1.1290
0 Comments
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!