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 件)

Sean de Wolski
Sean de Wolski 2012 年 1 月 5 日

0 投票

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 ExchangeDSP System Toolbox についてさらに検索

タグ

タグが未入力です。

質問済み:

2012 年 1 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by