# firhalfband

Halfband FIR filter design

## Syntax

## Description

designs a lowpass `b`

= firhalfband(`n`

,`win`

)`n`

^{th}-order filter using the
truncated windowed-impulse response method instead of the equiripple method.
`win`

should be an `n`

+1 length vector. The function
truncates the ideal response to length `n`

+1, then multiplies it
point-by-point with the window specified in `win`

.

`b = firhalfband(___,'high')`

returns a
highpass halfband FIR filter.

`b = firhalfband(___,'minphase')`

designs
a minimum-phase FIR filter such that the filter is a spectral factor of a halfband filter.
Recall that `h = conv(b,fliplr(b))`

is a halfband filter. This can be
useful for designing perfect reconstruction two-channel FIR filter banks. The ** 'minphase'** option is not available for window-based halfband filter
designs such as

`b = firhalfband(n,win)`

and ```
b =
firhalfband('minorder',fp,dev,'kaiser')
```

.In the minimum phase case, the filter order `n`

must be odd.

## Examples

## Input Arguments

## Output Arguments

## More About

## Algorithms

The `firhalfband`

function uses the equiripple or the Kaiser window
method to design the FIR halfband filter. You can also specify a custom window using the
`win`

argument.

**Halfband Equiripple Design**

In the equiripple method, the algorithm uses a minimax (minimize the maximum error) FIR design to design a fullband linear phase filter with the desired specifications. The algorithm upsamples a fullband filter to replace the even-indexed samples of the filter with zeros and creates a halfband filter. It then sets the filter tap corresponding to the group delay of the filter in samples to 1/2. This yields a causal linear-phase FIR filter approximation to the ideal halfband filter defined in Halfband Filters. See [2] for a description of this filter design method using the Remez exchange algorithm. As you can design a filter using this approximation method with a constant ripple both in the passband and stopband, the filter is also known as the equiripple filter.

**Window-based Design**

In the window-based design method, the algorithm first truncates the ideal halfband filter
defined in Halfband Filters, then it applies the
user-specified window. This yields a causal linear-phase FIR filter approximation to the ideal
halfband filter. If you provide the `'kaiser'`

argument, the function
calculates the window as mentioned in Kaiser Window.

For more information on designing FIR halfband filters, see FIR Halfband Filter Design.

## References

[1] Saramaki, T, “Finite Impulse Response Filter Design,” *Handbook
for Digital Signal Processing*. S.K. Mitra and J.F. Kaiser
Eds. Wiley-Interscience, N.Y., 1993, Chapter 4.

[2] Harris, F.J. *Multirate
Signal Processing for Communication Systems*, Prentice Hall, 2004, pp. 208–209.

## Extended Capabilities

## Version History

**Introduced in R2011a**