SignalUtils.FirInit Method

procedure FirInit(const FirTaps: TVec; var FIRState: TFirState; UpSample: Integer; UpDelay: Integer; DownSample: Integer; DownDelay: Integer);

Initialize a FIR filter.

#NameTypeDescription
1FirTapsTVec
2FIRStateTFirState
3UpSampleInteger
4UpDelayInteger
5DownSampleInteger
6DownDelayInteger

Result: stored in self (calling object)

Remarks:

Initialize the FIR filter by initializing the FirState variable. FirTaps must hold the filter impulse. FirState variable must be initialized with zeros. UpSample and DownSample define the sampling frequency change by an integer factor. UpDelay defines the initial FIR filter delay when upsampling and DownDelay defines the initial FIR filter delay when downsampling. IF Upsample or DownSample are different from 1, a multirate FIR filter is initialized. Multirate FIR filters avoid computing samples which will be discarded, because of the sampling rate change. The multirate filter first performs the upsampling and then the downsampling. Fir filters convolve an impulse response with the signal [1] p. 165:

y[i] = sum_(k=0)^(M-1) h[k] x[i-k]

x.. input signal.
h.. impulse response
y.. output signal

Convolution can also be written as y[i] = h[k] * x[i]. In frequency domain, convolution becomes multiplication: Y[I] = X[I] H[I]

Y.. frequency spectrum of the output signal.
X.. frequency spectrum of the input signal.
H.. frequency spectrum of the impulse response

Impulse response for typical filter types can be designed with

OptimalFir.remez, SignalUtils.KaiserImpulse,
OptimalFir.RemezImpulse and SignalUtils.SavGolayImpulse.

References:

[1] Understanding digital signal processing, Richard G. Lyons, Prentice Hall, 2001.

See Also: SignalUtils.FirFilter, SignalUtils.FirFree, SignalUtils.IirInit, OptimalFir.RemezImpulse