Simplifying Audio Measurements with LabVIEW

Publisher:TranquilDreamerLatest update time:2011-07-20 Keywords:LabVIEW Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Simplifying Audio Measurements with LabVIEW

Overview
Audio measurements are among the most demanding tasks, requiring high-quality signal acquisition, sophisticated scaling, in-depth analysis, and a variety of graphical representations. Virtual instruments offer new possibilities for customizing audio measurement applications. By leveraging the power of industry-standard computers and the flexibility of LabVIEW, you can create custom audio measurements. This article describes how to use LabVIEW and the Sound and Vibration Toolkit to acquire, analyze, and display audio data. We will demonstrate the most common measurements and LabVIEW code to accomplish multiple tasks in the audio measurement process. Introduction
The
world's first attempt to measure audio signals occurred in 1627 when Francis Bacon attempted to measure the speed of sound in an open space1. Although his idea was a good one, he was unable to obtain valid results due to technical limitations. Today, we have the ability to analyze many characteristics of sound signals, including velocity, using software and hardware. Programming software such as LabVIEW allows us to develop complex measurement applications in a short period of time with easy-to-use, powerful functionality. This article describes the steps to develop an audio system that provides increased performance and scalability. The system will be developed using LabVIEW industry-standard measurement software.



Modern audio measurements are among the most demanding tasks in digital measurement systems. To successfully perform audio measurements, software must be able to perform multiple tasks (such as data scaling, filtering, analysis, and visualization). From acquiring data to displaying data, LabVIEW has the flexibility and modularity to ensure accurate measurements. NI extends LabVIEW functionality with toolkits designed to simplify sound and vibration measurements. NI hardware and software work together seamlessly, replacing many box instruments and providing more room for customization.
The following section provides a general explanation of common tasks in audio measurements. The examples in this article were developed using LabVIEW Development System Professional or Development System Full, and some of them used the LabVIEW Sound and Vibration Toolkit. These examples can be easily integrated into custom audio measurement systems.
Data Acquisition, Scaling, and Weighting
Most measurement systems contain sensors that generate electronic signals in response to certain physical phenomena. The process of measuring these electronic signals and feeding them into a computer for processing is called data acquisition. Dynamic signals such as audio require digitizers with high resolution and high dynamic range. The NI 4461 device provides 24-bit analog-to-digital converters (ADCs) and 24-bit digital-to-analog converters (DACs) that can synchronously acquire and generate analog signals with bandwidths from DC to 92kHz to ensure high-resolution measurements. Figure 1 is a block diagram and partial front panel of a LabVIEW VI that uses 17 4461 devices in a PXI system for synchronous data acquisition. When using a multi-PXI chassis system, the number of synchronized channels can reach more than 1,000. The acquired data is plotted in a chart.



Figure 1: 112 channels are sampled and plotted simultaneously at 24 bits per sample. [page]

Signal Scaling
The LabVIEW Sound and Vibration Toolkit (SVT) provides wrapper VIs that display data in appropriate units, including time domain data in engineering units and frequency domain data in decibels. However, the values ​​collected using data acquisition equipment are often linearly related to the output voltage of the sensor, and the raw data is usually expressed in voltage units. Signal scaling is the process of converting voltage values ​​to the correct engineering units. SVS Scale Voltage to EU.vi provides a simple method to convert voltage signals into units such as Pascals, g, m/s², etc. The scaling VIs are the bridge between the raw data from the digitizer and the useful values ​​associated with the microphone or sensor being used. Figure 2 shows a VI that uses SVT to display data, which uses the appropriate range of units to represent the values ​​corresponding to the actual physical phenomena observed.


Figure 2: Use the LabVIEW Sound and Vibration Toolkit to convert raw data into appropriate engineering units.


To get an accurate representation of the signal, the system needs to be calibrated. Calibration is done when there is a known relationship between the measured value and a standard value. In audio measurement systems, the calibration process requires an external sound source of known value, which is usually from a pistonphone or an acoustic calibrator. SVT provides calibration VIs that ensure the accuracy of the entire measurement system.
Weighting Filters
Measurement hardware is usually designed to have a linear response in the audio bandwidth. On the other hand, the human ear has a nonlinear response. Because the ultimate sensor in many cases is the human ear, we need to compensate the measurement to the human ear model. Using weighting filters is the best standard method to describe the subjective perception of sound. Weighting filters are usually built using analog components, but SVT provides digital weighting filters for both time domain data and frequency domain data. Figure 3 shows a VI that uses weighting filters, which is combined with NI hardware and conforms to the American National Standards Institute (ANSI) standard.



Figure 3: Applying weighted filters to the scaled data of the SVT.


Audio Measurements Using LabVIEW
After acquiring, scaling, and weighting the audio signal, we can now use the processing power of the computer to perform complex signal analysis. This section describes common audio measurements used in the industry. After a brief description, we will provide example code that demonstrates how to use SVT to perform these measurements. The first part covers standard measurements that can be performed using only LabVIEW; the second part shows how to use simple LabVIEW code to perform advanced audio measurements with the help of SVT.
Single Tone Information
Many standard methods in audio measurement require the use of a single tone signal for stimulation and analysis. LabVIEW provides advanced VIs that extract important information about a certain tone from a signal. Extract Single Tone Information.vi finds the frequency component with the largest amplitude in a signal and calculates its amplitude, frequency, and phase. This VI also provides the option to export the extracted tone or the original signal after removing the tone. This VI can also perform a more detailed search within a frequency band to obtain more accurate results. Figure 4 shows the results of Extract Single Tone Information.vi analyzing a noisy sine wave signal. This example is limited to the analysis of single-channel information, but with slight modifications, it is possible to achieve synchronous analysis of multiple channel signals.


Figure 4: Extracting the frequency, amplitude, and phase of a single tone in a signal.


RMS
For some applications, the signal amplitude does not provide enough information. In many measurements, such as those that require the calculation of gain and power, or the RMS value of a signal, LabVIEW provides a convenient way to calculate the RMS value by squaring the instantaneous signal data, integrating it over a given time, and calculating the square root of the result. Basic Averages DC-RMS.vi can also average the RMS values ​​calculated for a signal. This VI also includes a time window option to obtain better measurement results. Figure 5 shows how to use LabVIEW to calculate linear average DC and RMS values ​​using a Hanning window.


Figure 5: Obtaining the average RMS value of the acquired signal. [page]

Gain
Gain is a basic measurement made in audio systems. The system takes an excitation signal and produces a response signal. The factor by which the system amplifies the signal is called gain. When a series of gain measurements are calculated at different frequencies, a frequency response function of the system can be generated. Figure 6 shows a basic VI that calculates the gain of a system based on an acquired stimulus and response. This example calculates the gain by calculating the ratio of the RMS value of the response to the RMS value of the input. This example expresses the gain in decibels, which is a common way to measure response.



Figure 6: Calculating system gain based on acquired signal.


Crosstalk between channels
Crosstalk is usually defined as the leakage of a signal from one channel to another. To perform this measurement, a signal is applied to one input and the magnitude of the signal in the other non-driven channel is measured. There are different standards for defining this type of measurement for different situations and specific applications. This measurement is usually expressed as a decibel ratio of the non-driven channel to the driven channel. Figure 7 shows a VI that performs crosstalk analysis between two acquired signals.



Figure 7: Calculating the crosstalk from two acquired signals.


Total Harmonic Distortion
Harmonic distortion is unwanted signals that are integer multiples of the input signal. This distortion is often generated by analog circuits and is an important measurement parameter in determining audio quality. Harmonic distortion is calculated as the ratio of the level of a certain order harmonic to the original signal level. Total harmonic distortion (THD) is a measure of the total distortion introduced by the harmonics of the input signal.
Noise and Distortion Signal
Another option for making THD measurements is included in the LabVIEW SINAD analyzer.vi. The signal-to-noise-and-distortion ratio (SINAD) is the ratio of the input signal energy to the energy in the noise and harmonics combined. Audio quality can be evaluated using the SINAD measurement because the result gives us an idea of ​​how much of the measured signal is relative to the unwanted noise and distortion.
Total Harmonic Distortion Plus Noise
Knowing the SINAD of a signal makes other measurements much simpler. For example, total harmonic distortion plus noise (THD+D) can be easily calculated from SINAD. THD+N is usually expressed as a percentage. THD+N expressed in decibels is the complement of SINAD, so a conversion is required to obtain THD+N expressed in percentage. The actual level of the stimulus signal is very important because SINAD and THD+N are related to the applied stimulus signal.
The example in Figure 8 shows how to use the Tone Measurements Express VI in the Sound and Vibration Toolkit to easily obtain THD, SINAD, and THD+N information for an input signal.


Figure 8: Using LabVIEW to measure total harmonic distortion (THD), signal noise and distortion (SINAD), and total harmonic distortion plus noise (THD+N)


Dynamic Range
Dynamic range is a common metric for audio systems. It is the ratio of the total signal range to the smallest signal in the system. Dynamic range can be thought of as the signal-to-noise ratio, since the smallest signal in a system is usually noise, the main difference being that dynamic range is calculated using the background noise of the system in the presence of the signal. Dynamic range is usually expressed in decibels and can be calculated in the weighted background signal to get the weighted dynamic range. Figure 11 calculates the dynamic range of a single audio signal. This can be weighted using the SVT Weighting VI to get an A-weighted dynamic range measurement.



Figure 9: Determining the dynamic range of a single-pitch signal.


Sound Intensity Measurements
Probably the most common audio measurement is sound intensity. Sound intensity is defined as the dynamic change in sound pressure. Usually the measurement is measured relative to the threshold of human hearing (usually 20µP) and expressed in decibels on a logarithmic intensity scale. When making sound intensity measurements, you typically use weighted filtering and averaging. SVT makes it easy to make a variety of sound intensity measurements. In Figure 12, we show the calculations for different sound pressures based on the collected data. It is also possible to make repeated measurements and calculate the number of reverberations or equivalent noise intensity over a period of time.


Figure 10: Using SVT to calculate multiple sound intensity measures from acquired data.

[page]


Scale Analysis
Fractional scale analysis is a widely used technique for analyzing audio and acoustic signals because it exhibits characteristics that are analogous to the response of the human ear. The process involves sending a time-domain signal through a bandpass filter, calculating the mean square value of the signal, and displaying these values ​​on a block diagram. ANSI and International Electrotechnical Commission (IEC) standards define the specifications for scale analyzers. The bandpass filter characteristics and graphs are defined by the desired frequency band and the desired scale fraction. NI DSA boards and SVT provide the ability to create fractional scale analyzers that are fully compliant with international standards. SVT includes VIs that comply with the ANSI and IEC standards and can perform full-tone scale analysis down to 1/24th scale analysis. Figure 11 shows a one-third scale analysis using SVT.


Figure 11: 1/3 scale analysis based on ANSI standards.


Band Power
Frequency measurements are often used in audio applications. SVT includes powerful tools for frequency analysis. We have tools for baseband FFT, baseband subset analysis, and zoom FFT, which can obtain power spectrum, power spectral density, and more. SVT Power in band.vi is one of the frequency spectrum analysis VIs. It calculates the total power in a specified frequency range. As shown in Figure 12, you can obtain the band power from the power spectrum, power spectral density, amplitude spectrum, or continuous output power spectrum. The result is expressed in appropriate units based on the input units.



Figure 12: Finding the power in a specified frequency band.


Frequency Response
The goal of performing a frequency response analysis is usually to characterize the frequency response function (FRF) of the system under test. The FRF represents the ratio of the output to the input in the frequency domain. The FRF curve is a typical specification in audio equipment. There are several methods to obtain the FRF, and two-channel frequency analysis is probably the fastest of them all. The cross-spectrum method generates a frequency curve based on two inputs, which are usually the stimulus and response of the unit under test (UUT).
The common configuration required for frequency response analysis requires a broadband stimulus to the UUT (usually a noise signal or a multi-pitch signal). The stimulus and response of the UUT are then acquired simultaneously. Completing a two-channel frequency analysis allows you to obtain the frequency response and phase response of the UUT as well as signal continuity. To improve the FRF measurement, you can average the response. By averaging the FRF, you can obtain a more accurate response curve. The advantage of this method is that it can overcome noise, distortion, and non-correlated effects. Its only limitation is that the frequency signal-to-noise ratio may be lower than that of a swept frequency measurement. Figure 13 shows the VI based on SVT to obtain a Bode plot from the acquired stimulus and response.



Figure 13: Frequency response function obtained using the cross-spectrum method.


Conclusion
The measurements discussed here are just an introduction to using LabVIEW for audio measurements. Integrating hardware and software together completes the entire measurement process, including data acquisition, analysis, and display. The power and flexibility of LabVIEW can improve performance and reduce overall costs by scaling systems, generating multiple measurements, automating tests, and generating reports.

Keywords:LabVIEW Reference address:Simplifying Audio Measurements with LabVIEW

Previous article:Aircraft Jet Noise Measurements Using NI LabVIEW Software and PXI Hardware
Next article:Digital earthquake monitoring system for nuclear power plants based on LabVIEW and PXI technology

Recommended ReadingLatest update time:2024-11-16 20:36

Develop a complete production test solution using NI hardware and software
Challenge: Develop a flexible production test solution for Danfoss solar inverter products and printed circuit boards (PCBs) to better facilitate contract manufacturing on a global scale. Solution: Combine NI PXI and PCI hardware with NI TestStand and LabVIEW software to develop a standard test system for testing pr
[Test Measurement]
Development of a portable automobile instrument tester based on LabVIEW -- purpose and term explanation
  The content of this paper is a portable automobile instrument test system based on LabviEW. Therefore, we must first study the types and structures of instruments, understand and analyze the structural principles and display principles of the speedometer, tachometer, water temperature meter, fuel meter, odometer, va
[Test Measurement]
Development of a portable automobile instrument tester based on LabVIEW -- purpose and term explanation
Distributed Speed ​​Detection System Based on LabVIEW Virtual Instrument Technology
0 Introduction In actual production and life, it is often necessary to detect the speed of an object. At present, there are two main ways to measure the speed of a general object moving at a constant speed: one is to measure the average speed, such as the average speed obtained by determining the time taken betw
[Test Measurement]
Distributed Speed ​​Detection System Based on LabVIEW Virtual Instrument Technology
Labview array application
Example: Select an appropriate array operation function to calculate the number of elements in an array; extract the elements in the second row of an array and shift them 3 places in a loop; calculate the maximum and minimum values ​​of the array and transpose the array.   The selected function, program flowchart and
[Test Measurement]
Labview array application
Developing Algorithms with LabVIEW MathScript: Part 2 - MathScript Interactive Window
Overview This series of articles provides you with exercises to get familiar with LabVIEW MathScript. This article describes an example of using the LabVIEW MathScript window. Table of contents MathScript Meaning LabVIEW MathScript Window Using the MathScript Window for Algorithm Development Related Links
[Test Measurement]
Developing Algorithms with LabVIEW MathScript: Part 2 - MathScript Interactive Window
LabVIEW cannot connect to the data acquisition card
Question: After installing Labview and the DAQ-MAX data acquisition card related content on the computer, when you open the corresponding Labview program, the related channels of the data acquisition card cannot be recognized, as shown in the figure If it is in a gray state, you can take the following steps to sol
[Test Measurement]
A corner about xcontrol
Recently, I accidentally saw some applications of Xcontrol, and I felt that this control changed my view of labview interface. This space will make my labview interface colorful and simplify the program at the same time. Let’s start exploring. Create a new Xcontrol. The steps are as follows (with my own ideas): 1.
[Test Measurement]
Interface Design of Handheld Digital Waveform Table Based on LabVIEW8.6 and S3C2440
The virtual instrument program designed by LabVIEW is transplanted to the portable handheld device running WindowsCE. It can greatly improve the efficiency of embedded system software development. Specifically, an interface design that effectively solves the problem of alternating display of data waveforms is propos
[Test Measurement]
Interface Design of Handheld Digital Waveform Table Based on LabVIEW8.6 and S3C2440
Latest Test Measurement Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号