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.

Antworten (1)

Sean de Wolski
Sean de Wolski am 5 Jan. 2012

0 Stimmen

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

Kategorien

Mehr zu DSP System Toolbox finden Sie in Hilfe-Center und File Exchange

Tags

Noch keine Tags eingegeben.

Gefragt:

am 5 Jan. 2012

Community Treasure Hunt

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

Start Hunting!

Translated by