Design a FIR filter with the Remez algorithm.
filter=remezFIRFilter(0, 2 kHz, [
{
gain: 1, // passband
ripple: 5dB,
start: 0Hz,
stop: 400Hz
},
{
gain: 0, // stopband
atten: -40dB,
start: 500Hz,
stop: 1000Hz
}
]);
filter=remezFIRFilter(0, 2 kHz, [
{
gain: 0, // stopband
atten: -40dB,
start: 0Hz,
stop: 400Hz
},
{
gain: 1, // passband
ripple: 5dB,
start: 500Hz,
stop: 1000Hz
}
]);
filter=remezFIRFilter(0, 2 kHz, [
{
gain: 0, // stopband
atten: -40dB,
start: 0Hz,
stop: 200Hz
},
{
gain: 1, // passband
ripple: 5dB,
start: 300Hz,
stop: 500Hz
},
{
gain: 0, // stopband
atten: -40dB,
start: 600Hz,
stop: 1000Hz
},
]);
filter=remezFIRFilter(0, 2 kHz, [
{
gain: 1, // passband
ripple: 5dB,
start: 0Hz,
stop: 200Hz
},
{
gain: 0, // stopband
atten: -40dB,
start: 300Hz,
stop: 500Hz
},
{
gain: 1, // passband
ripple: 5dB,
start: 600Hz,
stop: 1000Hz
},
]);
filter.plot()
numTaps | the number of taps wanted. If 0 or null, the smallest number of taps will be used. |
sampFreq | the sample frequency. |
bands | the band specification array. |
return value | linear system container (TransferFunction). |
If num_taps is zero or null, algorithm will try to find the minimal suitable tap number.
Bands are specified by the ibands argument. It is a list of frequency specifications. Every element is an object with the following fields:
You can use arbitary number of bands.
It returns a signals.containers-1/TransferFunction structure.
filter.num.length
filter.num
For further details on FIR filters, see http://en.wikipedia.org/wiki/Finite_impulse_response.
Read more about the Remez algorithm at http://en.wikipedia.org/wiki/Remez_algorithm.