Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

DC and RMS Measurements (FPGA Module)

LabVIEW 8.5 FPGA Module Help
August 2007

NI Part Number:
371599C-01

»View Product Info

Calculates the DC (Mean) and/or RMS values of an input signal. You also can use this VI to calculate the intermediate Sum, Mean Square, and Square Sum values in order to save FPGA resources.

Details  

Dialog Box Options
Block Diagram Inputs
Block Diagram Outputs

Dialog Box Options

ParameterDescription
Measurement Time SetupContains the following options:
  • Measurement time (s)—Specifies the measurement time (averaging time) in seconds for the Measurements you select. This Express VI always coerces the Measurement time (s) so it corresponds to an integer Actual number of measurement samples.
  • Expected sample rate (S/s)—Specifies the sample rate of the input signal. This Express VI uses the rate you specify to calculate the normalized notch frequency, which is Notch frequency/Expected sample rate.
    Caution  The actual sample rate is specified elsewhere in the application. If the sample rate changes, you must change the Expected sample rate in this VI. Otherwise, this VI might not behave as expected.
  • Actual number of measurement samples—Specifies the number of samples used to calculate the Measurements you select. If you want to save resources on the FPGA, enter a value that is a power of two for the Actual number of measurement samples.
WindowingContains the following option:
  • Apply Hanning window—Specifies whether to apply a Hanning window to the input signal before calculating the measurement results. Selecting this option can reduce spectral leakage and achieve more accurate and stable results if the input signal contains periodic components. If you select this option, you cannot select the Square Sum measurement.
ImplementationContains the following option:
  • Input resolution—Specifies the range of the input signal in number of bits. This option determines the data type of the input signal and allows LabVIEW to optimize the implementation. Contains the following options:
    • 16 bit—Input data is represented as a signed 16-bit integer.
    • 24 bit—Input data range is limited to 24 bits aligned to the least significant bit, although this Express VI represents the data as a signed 32-bit integer. Select 24 bit if the input data is from a 24-bit input module.
    • 32 bit—Input data is represented as a signed 32-bit integer and covers a range that is greater than 24 bits.
MeasurementsContains the following options:
  • DC (Mean)—Specifies whether to return the DC value of the input signal.
  • Sum—Specifies whether to return the sum of the input samples.
  • RMS—Specifies whether to return the RMS (Root Mean Square) value of the input signal.
  • Mean Square—Specifies whether to return the mean value of the squared input samples.
  • Square Sum—Specifies whether to return the sum of the squared input samples. You cannot select this option if you place a checkmark in the Apply Hanning window checkbox.

Block Diagram Inputs

ParameterDescription
resetResets the measurement process if TRUE.
input dataSpecifies the input signal to measure. You can wire a 16- or 32-bit signed integer to this input depending on the Input resolution you specify in the configuration dialog box.

Block Diagram Outputs

ParameterDescription
results validSpecifies whether this Express VI returns valid measurement results. The output is TRUE once for every Actual number of measurement samples call to the VI. If TRUE, the values this Express VI returns are valid. If FALSE, the values this Express VI returns are equal to zero.
DC resultReturns the DC value of the input signal when results valid is TRUE.
Sum resultReturns the sum of the input samples when results valid is TRUE.
RMS resultReturns the RMS (Root Mean Square) value of the input signal when results valid is TRUE.
Mean Square resultReturns the mean value of the squared input samples when results valid is TRUE.
Square Sum resultReturns the sum of the squared input samples when results valid is TRUE. The representation of Square Sum result depends on the Input resolution you select in the configuration dialog box.
  • If you select an Input resolution of 16 bit or 24 bit, Square Sum result directly returns the result in a 64-bit unsigned integer. For example, a 16- or 24-bit DC input signal of value A calculated over N samples returns the value N * A2.
  • If you select an Input resolution of 32 bit, Square Sum result scales down by 16 bits, which corresponds to a division by 65,536, in order to fit in a 64-bit unsigned indicator. For example, a 32-bit DC input signal of value A calculated over N samples returns the value N * A2/ 216 = N * A2/65536.

DC and RMS Measurements Details

The DC and RMS Express VI can calculate the DC and RMS values of an input signal. However, some of the operations for the calculation require significant FPGA resources. You can save FPGA resources by splitting the operations into two groups that run on the FPGA VI and the host VI, respectively. In the following calculations, you can perform the operations in bold in the host VI.

DC = Sum/Actual number of measurement samples

RMS = sqrt(Mean square)

RMS = sqrt(Square Sum/Actual number of measurement samples)

You also can save FPGA resources if Actual number of measurement samples is a power of two.

If you select 24 bit from the Input resolution menu but the input data is greater than 24 bits, overflow might occur for the RMS, Mean Square, and Square Sum measurements.

DC and RMS measurements contain common error sources.

Refer to the Developer Zone for more information about the accuracy of the DC and RMS Measurements VI.


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit