A method for measuring total harmonic distortion plus noise
By collecting and processing the 100Hz to 16kHz stepping signal, accurately distinguishing harmonics and noise, drawing the total harmonic distortion plus noise frequency curve, the problem of inaccurate measurement results and high complexity in the existing technology is solved, and the Accurate evaluation of audio system performance.
Patent Information
- Application Number
- CN202410365499.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-28
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-03-28
AI Technical Summary
The existing total harmonic distortion plus noise measurement methods cannot accurately distinguish harmonic components and noise, resulting in inaccurate measurement results and require complex calculation processes or special equipment, limiting its application range and feasibility.
The 1/12-octave Zhengxuan stepping signal of 100Hz to 16kHz is collected as the excitation signal, and the output signal is collected through the speaker and the microphone, and preprocessed to obtain the excitation signal and response signal, and perform fundamental wave calculation and harmonic noise calculation respectively. , draw the frequency curve of total harmonic distortion plus noise value, and judge the product qualification based on the threshold set by the manufacturer.
Accurate and efficient evaluation of the total harmonic distortion plus noise of the audio system provides more accurate and reliable measurement results, simplifies the calculation process and reduces dependence on special equipment.
Smart Images

Figure CN118400673B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of signal measurement, and in particular to a total harmonic distortion plus noise measurement method. Background Art
[0002] In audio test systems and related fields, it is crucial to evaluate the distortion and noise introduced into the signal loop system. In particular, total harmonic distortion plus noise (THD+N) is a commonly used indicator to measure the quality of the system output signal.
[0003] There are already some methods for measuring total harmonic distortion plus noise. However, existing methods still have some limitations in terms of accuracy, complexity and efficiency. Among them, existing methods cannot accurately distinguish between harmonic components and noise, resulting in inaccurate measurement results; they require complex calculation processes or special equipment, which limits their scope of application and feasibility.
[0004] In summary, it is necessary to propose a measurement method for total harmonic distortion plus noise to accurately and effectively evaluate the performance of audio systems. Summary of the invention
[0005] The object of the present invention is to provide a total harmonic distortion plus noise measurement method, which realizes accurate and effective evaluation of audio system performance and provides more accurate and reliable total harmonic distortion plus noise measurement results.
[0006] To achieve the above object, the present invention adopts a total harmonic distortion plus noise measurement method, comprising the following steps:
[0007] Collect the signal, take the 1 / 12 octave sinusoidal step signal of 100Hz~16kHz as the excitation signal, use the speaker to play the excitation signal, and collect the output signal through the microphone and acquisition card;
[0008] Preprocessing the collected output signal to obtain the excitation signal and response signal of the sub-signal;
[0009] The pre-processed signal is copied into two copies, and the fundamental wave calculation processing, harmonic and noise calculation processing are performed respectively;
[0010] Select components other than harmonic components in the spectrum diagram and record the noise;
[0011] Calculate the total harmonic distortion plus noise value at each frequency point and plot the total harmonic distortion plus noise value at each frequency point;
[0012] Obtain the curve of total harmonic distortion plus noise value with respect to frequency points, and judge the product qualification according to the threshold set by the testing manufacturer.
[0013] Among them, in the step of preprocessing the collected output signal to obtain the excitation signal and the response signal of the sub-signal, the process of preprocessing the collected output signal is:
[0014] The collected output signal is recorded as Signal0, and a blank signal in front of Signal0 is removed, and only the complete signal from the speaker to the end of pronunciation is retained, and the complete signal is recorded as Signal1;
[0015] Add a 20Hz~20kHz bandpass filter to Signal1, and perform amplitude correction on Signal1 according to the hardware calibration value as the response signal;
[0016] Divide the excitation signal and the response signal into multiple sub-signals according to the frequency of the excitation signal, each sub-signal corresponds to a frequency point in the excitation signal;
[0017] Eliminate the waveforms of the first two cycles and the last cycle of the sub-signal, and only keep the waveform in the middle part.
[0018] Among them, in the step of recording the collected output signal as Signal0, removing a blank signal before Signal0, retaining only the complete signal from the speaker to the end of pronunciation, and recording the complete signal as Signal1:
[0019] The blank signal is the environmental noise collected by the microphone and the capture card.
[0020] Among them, in the steps of copying the pre-processed signal into two copies and performing fundamental wave calculation processing, harmonic and noise calculation processing respectively, the fundamental wave calculation processing process is:
[0021] Add a Hanning time window to the response signal of the sub-signal;
[0022] Performing fast Fourier transform on the response signal of the sub-signal to obtain a frequency domain signal;
[0023] Calculate the fundamental voltage of the current step frequency.
[0024] Among them, in the steps of copying the pre-processed signal into two copies and performing fundamental wave calculation processing and harmonic and noise calculation processing respectively, the harmonic and noise calculation processing process is:
[0025] Using an IIR notch filter to process the signal, inputting the response signal of the sub-signal into the IIR notch filter, and outputting the filtered signal;
[0026] Use fast Fourier transform to perform spectrum analysis on the filtered signal, and obtain the spectrum diagram of the signal after filtering out the fundamental wave through spectrum analysis;
[0027] Find the component corresponding to the target harmonic frequency from the spectrum diagram, and set a threshold of integer multiples of the harmonic frequency to extract the harmonic component;
[0028] Find all frequency components except the filtered fundamental wave from the spectrum, including various harmonics and other non-fundamental wave components;
[0029] For each frequency component, calculate its power and energy.
[0030] The invention discloses a total harmonic distortion plus noise measurement method, which comprises the following steps: collecting signals, taking a sine step signal of 1 / 12 octave of 100 Hz to 16 kHz as an excitation signal, using a loudspeaker to play the excitation signal, and collecting the output signal through a microphone and an acquisition card; preprocessing the collected output signal to obtain an excitation signal and a response signal of a sub-signal; duplicating the preprocessed signal into two copies, respectively performing fundamental wave calculation processing, harmonic and noise calculation processing; selecting other components except harmonic components in a frequency spectrum diagram, and recording noise; calculating the total harmonic distortion plus noise value of each frequency point, and drawing the total harmonic distortion plus noise value of each frequency point; obtaining a curve of the total harmonic distortion plus noise value with respect to the frequency point, and judging the product qualification status according to the threshold value set by the detection manufacturer; through the above-mentioned method, accurate and effective evaluation of audio system performance is achieved, and more accurate and reliable total harmonic distortion plus noise measurement results are provided. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0032] Figure 1 It is a flow chart of the steps of the total harmonic distortion plus noise measurement method of the present invention.
[0033] Figure 2 It is a flow chart of the steps of preprocessing the output signal of the present invention.
[0034] Figure 3 It is a flow chart of the steps of performing fundamental wave calculation processing on the preprocessed signal of the present invention.
[0035] Figure 4 It is a flow chart of the steps of performing harmonic and noise calculation processing on the pre-processed signal of the present invention.
[0036] Figure 5 It is a waveform diagram of the excitation signal obtained by the frequency sweep signal of the present invention.
[0037] Figure 6 It is the time domain diagram and frequency domain diagram of the sub-excitation signal at a frequency point of 1 kHz of the present invention.
[0038] Figure 7 It is the spectrum diagram of the sub-response signal at 1kHz after notching of the present invention.
[0039] Figure 8 It is the time domain diagram and frequency domain diagram of the sub-response signal at the 1kHz frequency point of the present invention.
[0040] Fig. 9 It is a diagram of the harmonic extraction components of the present invention.
[0041] Fig.10 It is the calculated total harmonic distortion plus noise measurement curve of the present invention. DETAILED DESCRIPTION
[0042] See also Figures 1 to 10 ,in Figure 1 is a flow chart of the steps of the total harmonic distortion plus noise measurement method. Figure 2 It is a flow chart of the steps for preprocessing the output signal. Figure 3 It is a flow chart of the steps of calculating the fundamental wave of the pre-processed signal. Figure 4 It is a flow chart of the steps of calculating harmonics and noise of the pre-processed signal. Figure 5 It is the excitation signal waveform obtained by sweeping the frequency signal. Figure 6 It is the time domain and frequency domain diagram of the sub-excitation signal at 1kHz frequency point. Figure 7 This is the spectrum of the sub-response signal at 1kHz after notching. Figure 8 It is the time domain and frequency domain diagram of the sub-response signal at 1kHz frequency point. Fig. 9 is the harmonic extraction component diagram, Fig.10 is the calculated total harmonic distortion plus noise measurement curve.
[0043] The present invention provides a total harmonic distortion plus noise measurement method, comprising the following steps:
[0044] S1: Collect signals, take a 1 / 12 octave sinusoidal step signal from 100Hz to 16kHz as an excitation signal, use a speaker to play the excitation signal, and collect the output signal through a microphone and an acquisition card;
[0045] S2: preprocessing the collected output signal to obtain the excitation signal and response signal of the sub-signal;
[0046] S3: copy the preprocessed signal into two copies, and perform fundamental wave calculation processing, harmonic and noise calculation processing respectively;
[0047] S4: Select components other than harmonic components in the spectrum diagram and record the noise;
[0048] S5: Calculate the total harmonic distortion plus noise value of each frequency point, and plot the total harmonic distortion plus noise value of each frequency point;
[0049] S6: Obtain a curve of the total harmonic distortion plus noise value with respect to the frequency point, and determine the product qualification status according to the threshold value set by the testing manufacturer.
[0050] In this embodiment, a total harmonic distortion plus noise detection system is built, and the total harmonic distortion plus noise detection system includes a PC, a sound card, a power amplifier, a microphone, and a speaker, wherein the PC is used to run the test system, generate an excitation signal and transmit it to the sound card; receive a response signal transmitted back by the sound card, process the response signal, use the algorithm of the present invention to analyze the response signal, and display a curve of the total harmonic distortion plus noise value with respect to the frequency point; the sound card and the PC interactively transmit and transport digital signals; the power amplifier supplies power to the microphone and amplifies the input and output signals in the sound card; the microphone collects the response signal; the speaker plays the excitation signal; about the setting description of the PC generating the excitation signal, there are a total of six parameters that can be set, namely, the sweep amplitude, the starting frequency, the ending frequency, the minimum number of cycles, the minimum duration, and the octave. The starting frequency and the ending frequency can be flexibly selected, the minimum number of cycles should be greater than 10, the minimum duration should be greater than 20ms, and the octave can also be flexibly selected. The amplitude cannot exceed the product speaker specifications, nor should it be too small, such as Figure 5 As shown, Figure 5 The excitation signal waveform diagram obtained by the frequency sweep signal. The measurement method is: first collect the signal, take the 1 / 12 octave sinusoidal step signal of 100Hz~16kHz as the excitation signal, use the speaker to play the excitation signal, and collect the output signal through the microphone and acquisition card; then pre-process the collected output signal to obtain the excitation signal and response signal of the sub-signal; then copy the pre-processed signal into two copies, and perform fundamental wave calculation processing, harmonic and noise calculation processing respectively; noise is the non-harmonic part, select other components except harmonic components in the spectrum diagram, record the noise, and record the noise as N; calculate the total harmonic distortion plus noise value of each frequency point, and draw the total harmonic distortion plus noise value of each frequency point; the calculation formula for calculating the total harmonic distortion plus noise is:
[0051] The IEC standard is used here.
[0052] The total harmonic distortion plus noise can also be calculated according to the IEEE standard, and the calculation formula is:
[0053]
[0054] Finally, the curve of total harmonic distortion plus noise value with respect to frequency points is obtained, and the qualification of the product is judged according to the threshold set by the testing manufacturer.
[0055] Furthermore, in the step of preprocessing the collected output signal to obtain the excitation signal and the response signal of the sub-signal, the process of preprocessing the collected output signal is:
[0056] S21: The collected output signal is recorded as Signal0, and a blank signal in front of Signal0 is removed. The blank signal is the environmental noise collected by the microphone and the acquisition card. Only the complete signal from the speaker to the end of pronunciation is retained, and the complete signal is recorded as Signal1;
[0057] S22: add a 20Hz~20kHz bandpass filter to Signal1, and perform amplitude correction on Signal1 according to the hardware calibration value as the response signal;
[0058] S23: dividing the excitation signal and the response signal into a plurality of sub-signals according to the frequency of the excitation signal, each sub-signal corresponding to a frequency point in the excitation signal;
[0059] S24: Eliminate the waveforms of the first two cycles and the last cycle of the sub-signal, and only retain the waveform in the middle part.
[0060] In this embodiment, the collected output signal is recorded as Signal0, and a blank signal in front of Signal0 is removed. The blank signal is the environmental noise collected by the microphone and the acquisition card. Only the complete signal from the speaker to the end of pronunciation is retained, and the complete signal is recorded as Signal1; then a 20Hz~20kHz bandpass filter is added to Signal1, and the amplitude of Signal1 is corrected according to the hardware calibration value as a response signal, wherein the amplitude correction formula is: Where amp is the waveform amplitude, maxVp is the sound card input calibration value, and MicSen is the microphone sensitivity. Then the excitation signal and the response signal are divided into multiple sub-signals according to the frequency of the excitation signal. Each sub-signal corresponds to a frequency point in the excitation signal, such as Figure 6 and Figure 7 As shown, Figure 6 The time domain and frequency domain diagrams of the sub-excitation signal at 1kHz frequency point are shown below. Figure 7 The time domain and frequency domain diagrams of the sub-response signal at the corresponding 1kHz frequency point, where the units of the excitation signal and the response signal are both voltage V; the waveforms of the first two cycles and the last cycle of the sub-signal are eliminated, and only the waveform in the middle part is retained to prevent the distortion caused by the front and back masking effect due to too large high-frequency frequency steps affecting the test accuracy. The waveform period calculation formula is: Where Sample R ate is the sampling rate and f is the frequency.
[0061] Further, in the step of copying the preprocessed signal into two copies and performing fundamental wave calculation processing, harmonic and noise calculation processing respectively, the fundamental wave calculation processing process is:
[0062] S311: Adding a Hanning time window to the response signal of the sub-signal;
[0063] S312: Perform fast Fourier transform on the response signal of the sub-signal to obtain a frequency domain signal;
[0064] S313: Calculate the fundamental voltage of the current step frequency.
[0065] In this embodiment, the Hanning time window is first added to the response signal of the sub-signal; then the response signal of the sub-signal is subjected to a fast Fourier transform to obtain a frequency domain signal; finally, the fundamental voltage of the current step frequency is calculated, denoted as F 1 .
[0066] Further, in the step of copying the preprocessed signal into two copies and performing fundamental wave calculation processing and harmonic and noise calculation processing respectively, the harmonic and noise calculation processing process is:
[0067] S321: Process the signal using an IIR notch filter, input the response signal of the sub-signal into the IIR notch filter, and output the filtered signal;
[0068] S322: Performing spectrum analysis on the filtered signal using fast Fourier transform, and obtaining a spectrum diagram of the signal after the fundamental wave is filtered out through the spectrum analysis;
[0069] S323: Find the component corresponding to the target harmonic frequency from the spectrum diagram, and set a threshold of integer multiples of the harmonic frequency to extract the harmonic component;
[0070] S324: Find all frequency components except the filtered fundamental wave from the spectrum diagram, the components including various harmonics and other non-fundamental wave components;
[0071] S325: For each frequency component, calculate its power and energy.
[0072] In this embodiment, an IIR notch filter is used to process the signal, the response signal of the sub-signal is input into the IIR notch filter, and the filtered signal is output, wherein the frequency range and bandwidth of the IIR notch filter are 0.5 times the frequency interval of the sweep frequency step, and the allowable passband attenuation and stopband attenuation are selected to be 65dB attenuation to ensure that the baseband is filtered out cleanly, and the Butterworth filter is selected as the built-in filter of the IIR notch filter, and the formula of the square of the Butterworth filter amplitude to frequency is expressed as:
[0073]
[0074] Where n = filter order, w c = Cut-off frequency = frequency at which the amplitude drops to -3 dB, w p = passband edge frequency, Value at the edge of the passband.
[0075] The filter order of the Butterworth filter is selected as 5th order. A higher order can obtain a steeper roll-off characteristic, but it will also increase the computational complexity, thereby increasing the operation time of the algorithm. Here, the 5th order has achieved the desired effect. Convert the bandpass Butterworth filter to a notch filter: The ultra-narrowband notch effect is achieved by converting the Butterworth filter into a notch filter. Introduce a zero point at the center frequency in the transfer function of the bandpass filter and adjust it appropriately. This can form a deep notch near the target frequency, such as Figure 7 As shown, Figure 7 The spectrum of the sub-response signal at 1kHz after notching. Then use the fast Fourier transform to perform spectrum analysis on the filtered signal, and obtain the spectrum of the signal after filtering out the fundamental wave through spectrum analysis; then find the component corresponding to the target harmonic frequency from the spectrum, and set a harmonic frequency integer multiple threshold S 0 Extract the harmonic components; then find all the frequency components except the filtered fundamental wave from the spectrum diagram, including various harmonics and other non-fundamental components; finally, calculate the power and energy of each frequency component, and record the harmonic component voltage as F 2 , F 3 , F 4 , ..., F n .
[0076] What is disclosed above is only a preferred embodiment of the present invention, and it certainly cannot be used to limit the scope of rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made according to the claims of the present invention still fall within the scope of the invention.
Claims
1. A method for measuring total harmonic distortion plus noise, It is characterized in that The steps include: Collect the signal, take the 1 / 12 octave sinusoidal step signal of 100Hz~16kHz as the excitation signal, use the speaker to play the excitation signal, and collect the output signal through the microphone and acquisition card; Preprocessing the collected output signal to obtain the excitation signal and response signal of the sub-signal; The pre-processed signal is copied into two copies, and the fundamental wave calculation processing, harmonic and noise calculation processing are performed respectively; Select components other than harmonic components in the spectrum diagram and record the noise; Calculate the total harmonic distortion plus noise value at each frequency point and plot the total harmonic distortion plus noise value at each frequency point; Obtain the curve of total harmonic distortion plus noise value with respect to frequency points, and judge the product qualification according to the threshold set by the testing manufacturer; In the step of preprocessing the collected output signal to obtain the excitation signal and the response signal of the sub-signal, the process of preprocessing the collected output signal is: The collected output signal is recorded as Signal0, and a blank signal in front of Signal0 is removed, and only the complete signal from the speaker to the end of pronunciation is retained, and the complete signal is recorded as Signal1; Add a 20Hz~20kHz bandpass filter to Signal1, and perform amplitude correction on Signal1 according to the hardware calibration value as the response signal; Divide the excitation signal and the response signal into multiple sub-signals according to the frequency of the excitation signal, each sub-signal corresponds to a frequency point in the excitation signal; Eliminate the waveforms of the first two cycles and the last cycle of the sub-signal, and only keep the waveform in the middle part; In the steps of copying the preprocessed signal into two copies and performing fundamental wave calculation processing, harmonic and noise calculation processing respectively, the harmonic and noise calculation processing process is as follows: Using an IIR notch filter to process the signal, inputting the response signal of the sub-signal into the IIR notch filter, and outputting the filtered signal; Use fast Fourier transform to perform spectrum analysis on the filtered signal, and obtain the spectrum diagram of the signal after filtering out the fundamental wave through spectrum analysis; Find the component corresponding to the target harmonic frequency from the spectrum diagram, and set a threshold of integer multiples of the harmonic frequency to extract the harmonic component; Find all frequency components except the filtered fundamental wave from the spectrum, including various harmonics and other non-fundamental wave components; For each frequency component, calculate its power and energy.
2. The total harmonic distortion plus noise measurement method as claimed in claim 1, It is characterized in that In the step of recording the collected output signal as Signal0, removing a blank signal in front of Signal0, retaining only the complete signal from the speaker to the end of pronunciation, and recording the complete signal as Signal1: The blank signal is the environmental noise collected by the microphone and the capture card.
3. The total harmonic distortion plus noise measurement method as claimed in claim 1, It is characterized in that In the steps of copying the preprocessed signal into two copies and performing fundamental wave calculation processing, harmonic and noise calculation processing respectively, the fundamental wave calculation processing process is: Add a Hanning time window to the response signal of the sub-signal; Performing fast Fourier transform on the response signal of the sub-signal to obtain a frequency domain signal; Calculate the fundamental voltage of the current step frequency.
Citation Information
Patent Citations
Time-domain tracking filter fast detecting acoustic response parameter of sounding body and system
CN101426169A
Audio playing performance test method and device, equipment and storage medium
CN109831733A
