firhalfband (Digital Filter Design Toolkit, MathScript Function)
Owning Class: multirate
Syntax
b = firhalfband(n, f)
b = firhalfband(n, f, 'high')
b = firhalfband('minorder', f, ripple)
b = firhalfband('minorder', f, ripple, 'kaiser')
b = firhalfband('minorder', f, ripple, 'kaiser', 'high')
Description
Designs a halfband, finite impulse response (FIR) filter.
Inputs
Name | Description |
n | Specifies the order of the filter. n is an even, positive number. If you do not specify n, you must specify a valid value for 'minorder'. |
f | Specifies the passband edge frequency. f is a double-precision, floating-point number that must fall in the range (0, 0.5). |
'high' | Specifies that b returns a highpass, halfband FIR filter. If you do not specify 'high', b returns a lowpass, halfband FIR filter. |
'minorder' | Specifies that b returns a filter with the minimum order that meets the design requirements. If you do not specify 'minorder', you must specify a valid value for n. |
ripple | Specifies the maximum ripple in the passband and stopband. ripple is a double-precision, floating-point number that must fall in the range (0, 1). |
'kaiser' | Specifies whether to use the Kaiser Window method to design the filter. If you do not specify 'kaiser', this function uses the Remez method to design the filter. |
Outputs
Name | Description |
b | Returns the coefficients of the designed FIR filter. b is a real vector with a length of n+1 or 'minorder'+1. |
Examples
b = firhalfband(20, 0.4);figure;
freqz(b);
b = firhalfband('minorder', 0.4, 0.001);
figure;
freqz(b);