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.

Réponses (1)

Sean de Wolski
Sean de Wolski le 5 Jan 2012

0 votes

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

Catégories

En savoir plus sur DSP System Toolbox dans Centre d'aide et File Exchange

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by