Simplify Audio Measurements Using LabVIEW and Industry-Standard Computers

Publisher:dfdiqcLatest update time:2010-06-21 Source: 美国国家仪器有限公司Keywords:LabVIEW Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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. Leveraging the power of industry-standard computers and the flexibility of LabVIEW, you can perform 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 perform multiple tasks in the audio measurement process.

introduce

The world's first attempt to measure an audio signal 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 measurements due to technical limitations. Today, we use software and hardware to analyze many characteristics of sound signals, including speed. Programming software such as LabVIEW allows us to develop complex measurement applications in a short period of time with easy-to-use, powerful features. This article describes the steps to develop an audio system that provides higher performance and scalability. The system will be developed based on LabVIEW industry-standard measurement software.

Developed based on LabVIEW industry-standard measurement software

Modern audio measurement is one of the most demanding tasks in digital measurement systems. To successfully complete audio measurements, the software must be able to complete multiple tasks (such as data conversion, filtering, analysis, and visualization). From acquiring data to displaying data, LabVIEW has the flexibility and modularity to ensure accurate measurements. NI provides toolkits designed to simplify sound and vibration measurements to extend LabVIEW capabilities. NI hardware and software can be seamlessly integrated, replacing a large number of box instruments and providing more room for functional 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 incorporated into a custom audio measurement system.
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 simultaneously 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 synchronized 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 graph.

Simultaneous sampling and plotting of 112 channels at 24 bits per sample

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

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 way to convert voltage signals to units such as Pascals, g, m/s², etc. The scaling VI is 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 present data, which uses the appropriate range of units to represent the values ​​corresponding to the actual physical phenomena observed.

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

In order to obtain accurate signal conversion, the system needs to be calibrated. Calibration can be performed when there is a known relationship between the measured value and the standard value. In audio measurement systems, the calibration process requires an external sound source with a known value, which usually comes from a pistonphone or an acoustic calibrator. SVT provides a calibration VI that can ensure the accuracy of the entire measurement system. [page]

Weighted Filter

Measurement hardware is usually designed to have a linear response across 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 model the human ear. Using weighted filters is the best standard way to describe the subjective perception of sound. Weighted filters are usually built using analog components, but SVT provides digital weighted filters for both time and frequency domain data. Figure 3 shows a VI that uses weighted filters combined with NI hardware to comply with the American National Standards Institute (ANSI) standard.

Apply weighted filter to SVT scaled data

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 SVT.

Single frequency information

Many standard methods in audio measurement require the use of single audio signals for stimulation and analysis. LabVIEW provides advanced VIs to extract important information about a certain audio frequency from a signal. Extract Single Tone Information.vi can find the frequency component with the largest amplitude in the signal and calculate its amplitude, frequency, and phase. This VI also provides the option to export the extracted audio or the original signal after removing this audio. This VI can also perform a more detailed search within a certain frequency band to obtain more accurate results. As shown in Figure 4, the result 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 a little modification, it can achieve synchronous analysis of multiple channel signals.

Extract the frequency of a single tone in a signal

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.

Get the average RMS value of the acquired signal

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

Gain

Gain is a basic measurement made in an audio system. 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.

Calculate system gain based on the acquired signal

Figure 6: Calculating system gain based on the acquired signal. [page]

Crosstalk between channels

Crosstalk is generally 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, undriven 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 undriven channel to the driven channel. Figure 7 shows a VI that performs crosstalk analysis of two acquired signals.

Calculate the crosstalk from 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 usually 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 distorted signals

Another option for making THD measurements is included in the LabVIEW SINAD analyzer.vi. Signal-to-noise and distortion (SINAD) is the ratio of the input signal energy to the sum of the energy in noise and harmonics. Audio quality can be evaluated using SINAD measurements because the result gives us an idea of ​​how much of the measured signal is present relative to unwanted noise and distortion.

Total Harmonic Distortion plus Noise

Knowing the SINAD of a signal makes other measurements much easier. 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 complementary of SINAD, so a conversion is required to obtain THD+N expressed as a 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 of an input signal.

Measuring Total Harmonic Distortion Using LabVIEW

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. It can be weighted using the SVT Weighting VI to get an A-weighted dynamic range measurement.

Determining the dynamic range of a single-pitch signal

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

Sound intensity measurement

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 usually use weighted filtering and averaging. SVT makes it easy to make a variety of sound intensity measurements. In Figure 12, we show the calculation of 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 certain period of time.

Using SVT to calculate multiple sound intensity measurements from acquired data

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

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.

Complete 1/3 scale analysis based on ANSI standards

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.

Find the power in a specified frequency band

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

Frequency Response

The purpose 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. FRF curves are typical specifications in audio equipment. There are many 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).

A 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. Performing a dual-channel frequency analysis can 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.

Obtaining the frequency response function using the cross-spectrum method

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

in conclusion

The measurements discussed here are just an introduction to using LabVIEW for audio measurements. Integrate hardware and software to complete the entire measurement process, including data acquisition, analysis, and display. The power and flexibility of LabVIEW can expand the system, generate multiple measurement results, automate tests, and generate reports, thereby improving performance and reducing overall costs.

Keywords:LabVIEW Reference address:Simplify Audio Measurements Using LabVIEW and Industry-Standard Computers

Previous article:Fuze Software Safety Test System Based on Virtual Instrument Technology
Next article:Application of LabVIEW in HVAC Data Acquisition and Control System

Recommended ReadingLatest update time:2024-11-16 21:59

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号