Amplitude response of a symetrical or antisymetrical FIR filter (linear phase).

Namespace: dsp::filter

Prototype

tuple<Vecf, Vecf> firamp(const Vecf &h, int L=1024, bool symetrical=true)

Parameters

LFrequency resolution.
hFilter coefficients.
symetricalTrue if the coefficients are symetrical around \((N-1)/2\) (FIR filter of type I or II). Otherwise, a filter of type III or IV is assumed.

Returns

A tuple of two vectors: frequency vector (normalized, between 0 and 0.5), and the amplitude response vector.

Description

This function computes the amplitude response \(A(\omega)\), for a real FIR filter with linear phase (the coefficients must be symetrical or antisymetrical around the central point).

For a symetrical filter, the response is: \[ A(\omega) = h_M + 2 \sum_{n=0}^{M-1} h_n \cos((M-n)\omega) \]

Warning
The real symetry (or antisymetry) of the coefficients is not checked checked!

See also

frmag(), frphase()