unexpected error

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.

回答(1 个)

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

类别

帮助中心File Exchange 中查找有关 DSP System Toolbox 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by