# Kaiser window FIR filter

Syntax
`Hd = firkaiser(Frequencies,Rs,Type,DFormat)`

Description
Designs an FIR filter based on the Kaiser window method.

The method automatically determines the required filter order (499 (professional) and up to 128 (educational) edition) and returns coefficients in Hd.

Frequencies: lowpass and highpass are specified via two frequencies (i.e. cut-off and cut-off + transition width), whereas bandpass, bandstop and hilbert filters require four frequencies (i.e. lower cut-off, lower+transition, upper cut-off, upper cut-off + transition). All frequencies must be ascending in order and < Nyquist (see the example below). Type: The firkaiser method facilitates the design of lowpass, highpass, bandpass, bandstop, hilbert3 (Type 3 Hilbert), hilbert4 (Type 4 Hilbert), integrator3, integrator4, differentiator3 and differentiator4 filters respectively.

Hd: the firkaiser method designs an FIR window filter based on the entered specifications and places the transfer function (i.e. numerator and gain) into a digital filter object, Hd. The digital filter object can then be combined with other methods if so required. For a digital filter object, Hd, calling getnum(Hd) and getgain(Hd) will extract the numerator and gain coefficients respectively – see below.

DFormat: allows you to specify the display format of resulting digital filter object.

 `symbolic` Display a symbolic representation of the filter object. If the order > 10, the symbolic display option will be overridden and set to numeric. `numeric` Display a matrix representation of the filter object `void` Create a filter object, but do not display output

Examples

```ClearH1;  // clear primary filter from cascade
ShowH2DesignMarkers;

interface F = {10,80,2,40}; // cut-off frequency
interface TW ={10,40,2,20}; // Band transition width

Main()

Freq={F,F+TW,100+TW,125+TW};   // BSF frequency specification
Hd=firkaiser(Freq,60,"bandstop","numeric");

FreqLPF = {F,F+TW};   // LPF specification
//Hd=firkaiser(Freq,60,"lowpass","numeric");

Num=getnum(Hd);
Den={1};
Gain=getgain(Hd);

```