DFD FXP Quantize Coef VI

Digital Filter Design VIs and Functions

DFD FXP Quantize Coef VI

Owning Palette: Fixed-Point Tools VIs

Installed With: Digital Filter Design Toolkit

Quantizes the coefficients of a floating-point filter and generates a fixed-point filter. You must manually select the polymorphic instance you want to use.

Use the DFD FXP Coef Report VI to generate a report on the effect that quantization has on the filter.

Details  Examples

Use the pull-down menu to select an instance of this VI.

 Place on the block diagram  Find on the Functions palette

DFD FXP Quantize Coef (Easy)

coefficients b/v word length specifies the word length, in number of bits, that the quantizer uses to represent coefficients b/v.
coefficients a/k word length specifies the word length, in number of bits, that the quantizer uses to represent coefficients a/k.
filter in specifies the input floating-point filter.
error in describes error conditions that occur before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurred before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.
status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.
code is the error or warning code. The default is 0. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source specifies the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.
gain settings specifies the settings for the filter gain.
gain processing specifies whether you want to process the filter gain on a host machine or a fixed-point target, such as an NI Reconfigurable I/O (RIO) target. If you want to generate C code from the resulting fixed-point filter, you must set gain processing to On Target.

0On Target—Specifies to process the filter gain on a fixed-point target.
1On Host (default)—Specifies to process the filter gain on a host machine.
gain word length specifies the word length, in number of bits, that this VI uses to represent the filter gain if you set gain processing to On Target. The valid range is [1, 32]. The default is 16.
filter out returns a fixed-point filter.
error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out front panel indicator and select Explain Error from the shortcut menu for more information about the error.
status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.
code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning.

DFD FXP Quantize Coef (Advanced)

coefficients b/v quantizer specifies the settings for the coefficients b/v quantizer.
source specifies the quantizer source.

0Coefficients a/k
1Input
2Output
3Multiplicand
4Product
5Sum
6Delay
7Coefficients b/v (default)
wl specifies the word length, in number of bits, that the quantizer uses to represent a fixed-point number. The valid range is [1, 32]. If you specify an invalid value, this VI uses the same quantizer settings as you specified in the Coefficients a/k quantizer. The default is –1.
iwl specifies the integer word length, in number of bits, within wl that the quantizer uses to represent the integer part of a fixed-point number. The default is 1. iwl can be any integer value.
overflow mode specifies how this VI handles overflows and underflows in the quantizer.

0Saturation
1Wrap (default)
rounding mode specifies the rounding mode this VI uses in the quantizer.

0Nearest
1Truncation (default)
signed? specifies if the fixed-point number is a signed number. This VI supports signed numbers only. If you remove the checkmark from the signed? checkbox, the result you obtain might not be correct.
coefficients a/k quantizer specifies the settings for the coefficients a/k quantizer.
source specifies the quantizer source.

0Coefficients a/k (default)
1Input
2Output
3Multiplicand
4Product
5Sum
6Delay
7Coefficients b/v
wl specifies the word length, in number of bits, that the quantizer uses to represent a fixed-point number. The valid range is [1, 32]. If you specify an invalid value, this VI uses the same quantizer settings as you specified in the Coefficients b/v quantizer. The default is 16.
iwl specifies the integer word length, in number of bits, within wl that the quantizer uses to represent the integer part of a fixed-point number. The default is 1. iwl can be any integer value.
overflow mode specifies how this VI handles overflows and underflows in the quantizer.

0Saturation
1Wrap (default)
rounding mode specifies the rounding mode this VI uses in the quantizer.

0Nearest
1Truncation (default)
signed? specifies if the fixed-point number is a signed number. This VI supports signed numbers only. If you remove the checkmark from the signed? checkbox, the result you obtain might not be correct.
filter in specifies the input floating-point filter.
error in describes error conditions that occur before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurred before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.
status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.
code is the error or warning code. The default is 0. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source specifies the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.
gain settings specifies the settings for the filter gain.
gain processing specifies whether you want to process the filter gain on a host machine or a fixed-point target, such as an NI Reconfigurable I/O (RIO) target. If you want to generate C code from the resulting fixed-point filter, you must set gain processing to On Target.

0On Target—Specifies to process the filter gain on a fixed-point target.
1On Host (default)—Specifies to process the filter gain on a host machine.
gain word length specifies the word length, in number of bits, that this VI uses to represent the filter gain if you set gain processing to On Target. The valid range is [1, 32]. The default is 16.
filter out returns a fixed-point filter.
error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out front panel indicator and select Explain Error from the shortcut menu for more information about the error.
status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.
code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning.

DFD FXP Quantize Coef Details

You can represent an integer, or binary number, with a length wl as b1b2b3…bwl where bi is a binary digit. Both wl and iwl determine the position of the binary point and the range the binary number can represent.

For a signed fixed-point number in two's complement, the value of the fixed-point number is defined by the following equation:

The highest representable number is 2iwl(2–1–2wl) and the lowest representable number is –2iwl–1.

For an unsigned fixed-point number, the value of the fixed-point number is defined by the following equation:

For unsigned fixed-point numbers, the highest representable number is 2iwl(1–2wl) and the lowest representable number is 0.

The rounding mode input controls the operation of quantizing to wl bits. If you set rounding mode to Nearest, the quantizer rounds the result to the closest representable number. If the two closest representable numbers are equidistant, the quantizer rounds the result to the closest representable number with a least significant bit of 0. If you set rounding mode to Truncation, the quantizer rounds to the closest representable number lower than the original value.

overflow mode determines the quantized value when an overflow or underflow occurs. If you set overflow mode to Saturation, the quantizer converts the specified value to the highest representable number for overflow or to the lowest representable number for underflow. If you set overflow mode to Wrap, the quantizer wraps around the specified value from the highest representable number to the lowest representable number for overflow or from the lowest representable number to the highest representable number for underflow. The size of the error does not increase as abruptly with Saturation as the size does with Wrap when overflow or underflow occurs.

Examples

Refer to the following VIs for examples of using the DFD FXP Quantize Coef VI:

  • How to Build Coefficients Quantizer VI: labview\examples\Digital Filter Design\Getting Started\Apply Filters

     Open example  Browse related examples

  • Analyze Coefficients-Quantized Filter VI: labview\examples\Digital Filter Design\Fixed-Point Filters\Single-Rate

     Open example  Browse related examples

  • Easy Fixed-Point Filter Modeling and Simulation VI: labview\examples\Digital Filter Design\Fixed-Point Filters\Single-Rate

     Open example  Browse related examples

  • Structure Selection and Quantization VI: labview\examples\Digital Filter Design\Fixed-Point Filters\Single-Rate

     Open example  Browse related examples