niFgen_GetFIRFilterCoefficients

NI-FGEN C Function

niFgen_GetFIRFilterCoefficients

ViStatus niFgen_GetFIRFilterCoefficients (ViSession vi, ViConstString channelName, ViInt32 arraySize, ViReal64[] coefficientsArray, ViInt32* numberofCoefficientsRead);

Purpose

Returns the FIR filter coefficients used by the onboard signal processing block. These coefficients are determined by NI-FGEN and based on the FIR filter type and corresponding attribute (Alpha, Passband, BT) unless you are using the custom filter. If you are using a custom filter, the coefficients returned are those set with the niFgen_ConfigureCustomFIRFilterCoefficients function coerced to the quantized values used by the device.

The coefficients are between –1.00 and +1.00.

To use this function, first call an instance of the niFgen_GetFIRFilterCoefficients function with the coefficientsArray parameter set to VI_NULL. Calling the function in this state returns the current size of the coefficientsArray as the value of the numberOfCoefficientsRead parameter. Create an array of this size, and call the niFgen_GetFIRFilterCoefficients function a second time, passing the new array as the coefficientsArray parameter and the size as the arraySize parameter. This second function call populate the array with the FIR filter coefficients.

Refer to FIR Filter for more information about FIR filter coefficients.

Default Value: None

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi is obtained from the niFgen_init or the niFgen_InitWithOptions functions and identifies a particular instrument session.
channelName ViConstString Specifies the channel name for which you want to configure the operation mode.

Defined Value: "0"

arraySize ViInt32 Specifies the size of the coefficient array

coefficientsArray ViReal64[] Specifies the array of data the onboard signal processor uses for the FIR filter coefficients. For the NI 5441, provide a symmetric array of 95 coefficients to this parameter. The array must have at least as many elements as the value that you specify in the numberOfCoefficients parameter.

The coefficients should range between -1.00 and +1.00.

numberofCoefficientsRead ViInt32[] Specifies the array of data containing the number of coefficients you want to read.

Return Value

Name Type Description
Status ViStatus Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. You can examine the status code from each call to an NI-FGEN function to determine if an error occurred. To obtain a text description of the status code, call the niFgen_error_message function. To obtain additional information about the error condition, call the niFgen_GetError function. To clear the error information from NI-FGEN, call the niFgen_ClearError function.

The general meaning of the status code is as follows:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors