Designs an FIR linear phase bandstop filter.
KWBSTOP(order, rate, fp1, fs1, fs2, fp2, attn, "unity_dc")
order |
- |
Optional. An integer, the filter length. If not specified, the filter order is automatically estimated. |
rate |
- |
A real, the sample rate of the filter in Hertz. |
fp1 |
- |
A real, the first passband edge in Hertz. |
fs1 |
- |
A real, the first stopband edge in Hertz. |
fs2 |
- |
A real, the second stopband edge in Hertz. |
fp2 |
- |
A real, the second passband edge in Hertz. |
attn |
- |
A real, the stopband attenuation in dB. |
"unity_dc" |
- |
Optional. A string, "unity_dc" explicitly sets f(0) to 1.0 |
A series, the bandstop filter coefficients. The filter coefficients are identical to the impulse response of the FIR filter.
W1: kwbstop(1000.0, 180.0, 200.0, 280.0, 300.0, 40.0)
W2: 20*log10(filtmag(W1, {1}, 1024))
W1 creates a bandstop filter with a sample rate of 1000 Hz and a stopband that extends from 200 Hz to 280 Hz. The first passband is 180 Hz and the last passband is set to 300 Hz. The resulting filter is 119 samples long with a stopband attenuation of 40 dB. W2 displays the frequency response of the filter.
W1: kwbstop(1000.0, 180.0, 200.0, 280.0, 300.0, 40.0)
W2: gsin(1000, 1/1000, 10) + gsin(1000, 1/1000, 230)
W3: firfilterF(W2, W1)
Creates the same FIR bandstop filter as the previous example. W2 contains a series with two sinusoids and W3 applies the filter to recover the lower frequency sinewave.
W2: kwbstop(140, 1000.0, 180.0, 200.0, 280.0, 300.0, 40.0)
Creates a similar filter except the filter order is set to 140 samples resulting in a narrower transition band.
W3: kwbstop(140, 1000.0, 180.0, 200.0, 280.0, 300.0, 40.0, "unity_dc")
Same as above except the DC frequency response value, f(0), is explicitly set to 1.0 (0.0 dB).
The KWBSTOP filter specifications are depicted as follows:
KWBSTOP designs a stopband filter using a Kaiser window method. The impulse response of the ideal filter is multiplied by a Kaiser window to produce a linear phase FIR filter with a flat passband. The filter is non-causal and time symmetric about t = 0 and the offset is equal to:
- (length-1) / (rate * 2)
The filter order refers to the number of resulting filter coefficients, though the order will always be odd for a bandstop filter.
The optional "unity_dc" flag guarantees the resulting filter has a frequency response of 1.0 (i.e. 0 dB) at f(0).
The band edges must lie between 0.0 and 0.5 * rate (the Nyquist frequency). Overlapping band edges are not permitted.
Although a filter designed with the Kaiser window method exhibits a flat passband response, the resulting filter generally has more coefficients than the Remez Exchange method. See BANDSTOP to design a linear phase FIR bandstop filter using the Remez Exchange algorithm.
See BESSEL, BUTTERWORTH, CHEBY1, CHEBY2 and ELLIPTIC to design IIR filters using the Bilinear Transform method.
KWBSTOP requires the DADiSP/Filters Module.
Oppenheim and Schafer
Discrete Time Signal Processing
Prentice Hall, 1989
Digital Signal Processing Committee
Programs for Digital Signal Processing
I.E.E.E. Press, 1979
Bateman & Yates
Digital Signal Processing Design
Computer Science Press, 1989