Compensating Magnitude and Phase in LabVIEW Sound and Vibration Toolkit

Updated Nov 19, 2024

Environment

Software

  • LabVIEW Sound and Vibration Toolkit
  • LabVIEW

The following guide explains how to compensate or correct the microphone measurements using LabVIEW Sound and Vibration Toolkit, according to a known magnitude and phase response of a particular microphone that is used (specifications). 

There are different approaches from a mathematical perspective to achieve this, depending on the format of the data. In this case we are assuming that: 

  • The theoretical or known frequency response (magnitude and phase) values of the microphone are already in LabVIEW in an array format. Also each point is equally spaced in the horizontal axis (same frequency resolution or df). 
  •  Real microphone measurements are acquired with a dynamic signal acquisition device (DSA), such as the PXIe-4464 and then processed with an FFT function to get the frequency spectrum (magnitude and phase). However, the hardware and data acquisition part does not affect this calculation. 
  • The frequency resolution (df) of the known frequency response and the FFT output of the measurement data is the same, so both the measurements and the correction data (known frequency response) have the same number of data points in the frequency spectrum. 

1.Make sure the Magnitude and Phase data of your known Frequency Response data is in the correct units. 

  • Magnitude data should be a ratio. It is typically in dBV, so it needs to be converted into a ratio. For example dB = 20 * log10 (ratio). 
    ratio = 10^(dB/20). 
    Let's assume a -5dBV magnitude response at a specific point of the spectrum:
    10 ^ (-5/20) = 0.562. 
    So instead of using -5dBV as a magnitude, use 0.562.  
  • Phase should be in radians, not in degrees. 

2.Once your data has the correct units, convert the known frequency response data into a complex number Z using the LabVIEW >> Numeric functions, or using Sound and Vibration Toolkit >> FFT >> Spectrum Spectrum Measurements functions:

AlternativeStep1 - Copy.PNG 

3.For the measurements acquired by the DSA hardware, assuming a Sound and Vibration FFT (Complex) function is processing the data acquired by the data acquisition device, extract the Complex Spectrum array data from the Complex Spectrum data output of the Sound and Vibration FFT (Complex) function. Use LabVIEW Unbundle by Name feature:

ComplexSpectrum.PNG

4. Divide The Complex Spectrum output from the FFT (step 2) by the complex number output of the known frequency response (step 1).  

Division.PNG

5.Build the new Complex Spectrum using bundle by name feature in LabVIEW: 

New Complex Spectrum.PNG