FIR Filter Type: Custom

NI Signal Generator

FIR Filter Type: Custom

The custom filter lets you define the coefficients of the FIR filter.

Custom Coefficients

You can define the coefficients for the FIR filter and download them to the signal generator with the niFgen Configure Custom FIR Filter Coefficients VI or the niFgen_ConfigureCustomFIRFilterCoefficients function. Coefficients should be scaled correctly and compensate for the CIC Filter roll-off. To use the coefficients you define, specify a custom filter by setting the Filter Type property or the NIFGEN_ATTR_OSP_FIR_FILTER_TYPE attribute. The NI 5441 has 95 symmetrical coefficients defined for the FIR filter.

FIR Coefficient Scaling

The coefficients should be scaled between -1 and 1. NI-FGEN quantizes the floating point inputs and downloads them into the OSP block. The coerced coefficients can be queried with the niFgen Get FIR Filter Coefficients VI or the niFgen_GetFIRFilterCoefficients function. When scaling the coefficients, consider that the FIR is architected for unity gain. This means that if a data set of all full-scale positive values is passed into the FIR and the sum of the coefficients is equal to 1, then positive full scale is output from the FIR. In general, the coefficients should be scaled as high as possible so that the FIR does not overflow the incoming data set and the coefficients are still within the range of -1 to 1.

CIC Compensation in the FIR

In order to flatten the OSP block in the passband, the FIR coefficients should compensate for the roll-off in the CIC filter. The frequency response (in dB) of the CIC follows the following formula:

where

R = CIC Interpolation Rate

f = Frequency (fraction of CIC input sample rate)

The first zero of the CIC filter is always at the same frequency as the output of the FIR filter. The FIR response should be peaked the same amount that the CIC rolls off in the passband of your FIR response. For example, the following diagram shows the desired response from the FIR with 4x interpolation.

Desired FIR Response (4x, Flat 0.4)

But, the CIC has the following response:

CIC response(8x Interp)

The CIC compensated FIR response is:

FIR Response w/ CIC Compensation

The final response after the FIR (with CIC compensation) and CIC filters:

FIR w/CIC Compenation x CIC response (FIR =4x Interp, Flat 0.4, CIC = 8x Interpolation)