Forums

BandPass FIR filter using Windowing

Started by mike...@comcast.net May 5, 2009
I am working on a school project, and I need to create a Linear phase, causal, digital Bandpass FIR filter using windowing methods. with the following specifications.

Sampling fs= 24khz
Passband freq= p1= 2*pi*4000, and p2= 2*pi*8000 rad/sec
stopband freq= st1=2*pi*3000 st2=2*pi*9000 rad/sec
Minimum stopband attenuation = 40db

having the lowest possible filter length.

I found this code online and was trying to adapt it too my specifications.

fs 000; % sampling rate
F=[3000 4000 6000 8000]; % band limits
A=[0 1 0]; % band type: 0='stop', 1='pass'
dev=[0.0001 10^(0.1/20)-1 0.0001]; % ripple/attenuation spec
[M,Wn,beta,typ]= kaiserord(F,A,dev,fs); % window parameters
b=fir1(M,Wn,typ,kaiser(M+1,beta),'noscale'); % filter design
So far I have

fs$000; % sampling rate
F=[3000 4000 8000 9000]; % band limits
A=[0 1 0]; % band type: 0='stop', 1='pass'
dev=[0.0001 10^(0.1/20)-1 0.0001]; % ripple/attenuation spec
[M,Wn,beta,typ]= kaiserord(F,A,dev,fs); % window parameters
b=fir1(M,Wn,typ,kaiser(M+1,beta),'noscale'); % filter design

I don't understand the DEV in this code.

any help would be awesome.
--- In m..., mike_st.vincent@... wrote:
>
> I am working on a school project, and I need to create a Linear phase, causal, digital Bandpass FIR filter using windowing methods. with the following specifications.
>
> Sampling fs= 24khz
> Passband freq= p1= 2*pi*4000, and p2= 2*pi*8000 rad/sec
> stopband freq= st1=2*pi*3000 st2=2*pi*9000 rad/sec
> Minimum stopband attenuation = 40db
>
> having the lowest possible filter length.
>
> I found this code online and was trying to adapt it too my specifications.
>
> fs 000; % sampling rate
> F=[3000 4000 6000 8000]; % band limits
> A=[0 1 0]; % band type: 0='stop', 1='pass'
> dev=[0.0001 10^(0.1/20)-1 0.0001]; % ripple/attenuation spec
> [M,Wn,beta,typ]= kaiserord(F,A,dev,fs); % window parameters
> b=fir1(M,Wn,typ,kaiser(M+1,beta),'noscale'); % filter design
> So far I have
>
> fs$000; % sampling rate
> F=[3000 4000 8000 9000]; % band limits
> A=[0 1 0]; % band type: 0='stop', 1='pass'
> dev=[0.0001 10^(0.1/20)-1 0.0001]; % ripple/attenuation spec
> [M,Wn,beta,typ]= kaiserord(F,A,dev,fs); % window parameters
> b=fir1(M,Wn,typ,kaiser(M+1,beta),'noscale'); % filter design
>
> I don't understand the DEV in this code.

you didn't understand even after typing
help kaiserord

Ubaid Abdullah
http://dspdotcomm.blogspot.com
I am working on a school project, and I need to create a Linear phase, causal, digital Bandpass FIR filter using windowing methods. with the following specifications.
>
>Sampling fs= 24khz
>Passband freq= p1= 2*pi*4000, and p2= 2*pi*8000 rad/sec
>stopband freq= st1=2*pi*3000 st2=2*pi*9000 rad/sec
>Minimum stopband attenuation = 40db
>
>having the lowest possible filter length.
>
>I found this code online and was trying to adapt it too my specifications.
>
>fs 000; % sampling rate
>F=[3000 4000 6000 8000]; % band limits
>A=[0 1 0]; % band type: 0='stop', 1='pass'
>dev=[0.0001 10^(0.1/20)-1 0.0001]; % ripple/attenuation spec
>[M,Wn,beta,typ]= kaiserord(F,A,dev,fs); % window parameters
>b=fir1(M,Wn,typ,kaiser(M+1,beta),'noscale'); % filter design
>So far I have
>
>fs$000; % sampling rate
>F=[3000 4000 8000 9000]; % band limits
>A=[0 1 0]; % band type: 0='stop', 1='pass'
>dev=[0.0001 10^(0.1/20)-1 0.0001]; % ripple/attenuation spec
>[M,Wn,beta,typ]= kaiserord(F,A,dev,fs); % window parameters
>b=fir1(M,Wn,typ,kaiser(M+1,beta),'noscale'); % filter design
>
>I don't understand the DEV in this code.
>
>any help would be awesome.
>

Have you considered typing "help kaiserord" in Matlab?

The reason why you dont understand is because you 'found' the code online, although there are so many examples in Help for Signal Processing Toolbox. You should first go through the help provided by The Mathworks