Overload List
| # | Signature | Description |
|---|---|---|
| 1 | void FirImpulse(TVec *H, DewArray<double> W, TFilterType FilterType, double FS = 2); | Design a FIR filter with rectangular window. |
| 2 | void FirImpulse(TVec *H, DewArray<double> W, double WindowParam, TFilterType FilterType, TSignalWindowType WindowType, double Gain = 1, double FS = 2); | Windowed-sinc FIR impulse response of a preset length. |
Overload 1: void FirImpulse(TVec *H, DewArray<double> W, TFilterType FilterType, double FS = 2);
Design a FIR filter with rectangular window.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | H | TVec * | |
| 2 | W | DewArray<double> | |
| 3 | FilterType | TFilterType | |
| 4 | FS = 2 | double |
Compute a FIR impulse response filter (no window applied) and place the result in H. The transition regions are defined with the W array. There must be at least one (lowpass, highpass) and at most two (bandpass, bandstop) transition regions (2 or 4 elements). Filter type is defined with TFilterType. The length of the filter H.Length must be preset. Filters of even length (odd order), must have a stop band next to the nyquist (FS/2) frequency. 20*Log10(Ripple) is also the required attenuation of the stop band in decibel. FS is the sampling frequency.
Overload 2: void FirImpulse(TVec *H, DewArray<double> W, double WindowParam, TFilterType FilterType, TSignalWindowType WindowType, double Gain = 1, double FS = 2);
Windowed-sinc FIR impulse response of a preset length.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | H | TVec * | |
| 2 | W | DewArray<double> | |
| 3 | WindowParam | double | |
| 4 | FilterType | TFilterType | |
| 5 | WindowType | TSignalWindowType | |
| 6 | Gain = 1 | double | |
| 7 | FS = 2 | double |
Fills H (length preset by the caller) with the linear-phase windowed-sinc FIR taps for the given FilterType, then multiplies by the chosen window and by Gain. The ideal kernel about the centre alpha=(N-1)/2 is, e.g. for a lowpass with normalised cutoff omega_c = (W[0]+W[1])/ FS,
h[n] = (sinbig(pi omega_c (n-alpha)big))/(pi (n-alpha)), h[alpha] = omega_c
with highpass, bandpass and bandstop using the matching spectral complements, and the Hilbert/differentiator types using their odd-symmetric kernels. WindowType selects the taper (WindowParam carries its parameter, e.g. the Kaiser beta); wtRectangular leaves the raw sinc. H.FloatPrecision sets the working precision. Domain: H.Length must be at least 4 (an exception is raised otherwise); W must supply 1-2 band edges for lowpass/highpass and 2-4 for bandpass/bandstop; integrator types are rejected. FS is the sampling frequency (default 2, so cutoffs are in cycles per Nyquist). Finite input yields finite taps.