Audio system fault detection method and device based on dual-mode audio recovery
By employing a dual-mode audio re-sampling method, combined with data processing from the sound card and built-in microphone, precise fault location of the audio system is achieved, solving the problem of inaccurate fault detection in existing technologies and improving fault response efficiency.
Patent Information
- Application Number
- CN202511237921.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-01
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-09-01
AI Technical Summary
Existing technologies struggle to pinpoint faults in audio systems, especially in areas such as decoding, digital-to-analog conversion, signal amplification, and speaker playback.
A dual-mode audio retrieval method is adopted. The left channel data of the sound card is mixed with a preset sine wave and output to the power amplifier. A fast Fourier transform is performed, and the cosine similarity is compared with the data of the speaker collected by the built-in microphone to realize the fault detection of the audio system.
It enables precise location of audio system faults, reduces maintenance time and costs, improves fault response efficiency, and is suitable for real-time monitoring of broadcast systems and conference audio.
Smart Images

Figure CN120980433A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of audio fault detection, and in particular to an audio system fault detection method and device based on dual-mode audio back sampling. BACKGROUND
[0002] In the field of audio fault detection, the core goal is to monitor and diagnose the entire link from signal transmission, decoding processing to playback output, to ensure the continuous, stable and reliable operation of the audio system. The field of audio fault detection widely involves real-time communication, broadcast system, conference audio and public broadcast, etc. application scenarios, and puts forward higher requirements for real-time discovery and accurate positioning of faults.
[0003] In the prior art, a transmission layer detection mechanism based on RTP (Real-time Transport Protocol) and RTCP (RTP Control Protocol) is usually used, or an audio packet checking method similar to label insertion based. This kind of method mainly checks the sequence number continuity, timestamp synchronization and packet loss rate of the audio data packet to determine whether the data is complete and arrives on time in the transmission process. However, this kind of method is limited to detecting the packet integrity of the network transmission stage, and cannot cover the faults that may occur in the key links such as audio decoding, digital-to-analog conversion (DAC), signal amplification, speaker playback, etc. such as audio distortion, noise interference, intermittent, no output, etc. Therefore, the existing method is difficult to realize the end-to-end comprehensive diagnosis of the audio playback link, and there are often faults in the actual application. Missing judgment or inaccurate positioning. SUMMARY
[0004] The present application provides an audio system fault detection method and device based on dual-mode audio back sampling, which can solve the problem that it is difficult to determine whether the audio system is faulty while accurately positioning the fault position in the audio system in the prior art.
[0005] In a first aspect, the present application embodiment provides an audio system fault detection method based on dual-mode audio back sampling, which is suitable for the audio system, the audio system includes a sound card, a power amplifier, an output speaker, a built-in microphone and a switch, and the fault detection method comprises: Obtain first network audio data and left channel audio data of the sound card, and mix the left channel audio data and the first network audio data to obtain first audio data; Mix the first preset sinusoidal wave audio data and the first input audio data to obtain second audio data, and output the second audio data to the power amplifier through the sound card, and then obtain the right channel audio data of the power amplifier through a link back sampling method; performing fast Fourier transform on the right-channel audio data to obtain a signal energy value, and obtaining a first fault detection result according to a first preset threshold and the signal energy value; obtaining second network audio data, mixing second preset sinusoidal wave audio data and the second input audio data to obtain third audio data; connecting the left channel of the sound card to the built-in microphone through the switch, and collecting fourth audio data of the output loudspeaker through the built-in microphone; processing the third audio data and the fourth audio data by using a cosine similarity comparison method to obtain a cosine similarity, and obtaining a second fault detection result according to a second preset threshold and the cosine similarity; comparing the first fault detection result and the second fault detection result to output a final fault detection result of the audio system.
[0006] The embodiment of the present application obtains first network audio data and sound card left-channel audio data, mixes them, and then outputs them to the power amplifier after mixing in preset sinusoidal wave data. At the same time, the right-channel audio data of the power amplifier is obtained by link back sampling and is processed by fast Fourier transform to obtain a first fault detection result. On the other hand, second network audio data is obtained and mixed with preset sinusoidal wave data. The output loudspeaker audio data is collected by connecting the built-in microphone through the switch. The second fault detection result is obtained by combining the aforementioned audio data mixed with preset sinusoidal wave data and by using cosine similarity comparison. Finally, the final fault detection result is output by comparing the two results. Therefore, the technical solution can solve the problem that it is difficult to determine whether the audio system is faulty and to accurately locate the fault position in the audio system in the prior art.
[0007] As a preferred example of the first aspect, the fast Fourier transform on the right-channel audio data to obtain a signal energy value is specifically: According to the first preset sinusoidal wave audio data, a bin interval calculation method is used to obtain a target bin interval corresponding to the first preset sinusoidal wave audio data. The fast Fourier transform is performed on the right-channel audio data to obtain frequency spectrum data, and the signal energy value is obtained according to the target bin interval and the frequency spectrum data.
[0008] In the preferred example, the combination of bin interval calculation and FFT spectrum extraction solves the problem of target signal energy recognition deviation caused by insufficient frequency resolution of direct FFT. It first calculates the target bin interval according to the first preset sinusoidal frequency, accurately locks the energy concentration range of the sinusoidal wave in the FFT spectrum, and then performs FFT on the right channel data to extract the signal energy value from the target bin interval. This way avoids the detection error caused by the dispersion of energy in non-target intervals after FFT, especially in complex noise environments, it can effectively distinguish target sinusoidal signals from interference signals, and significantly improve the accuracy of signal energy value extraction.
[0009] As a preferred example of the first aspect, the third audio data and the fourth audio data are processed using a cosine similarity comparison method to obtain a cosine similarity, specifically: The third audio data and the fourth audio data are time delay aligned to obtain aligned third audio data subset and fourth audio data subset; the dot product is calculated according to the third audio data subset and the fourth audio data subset using a dot product calculation formula, and the first modulus of the third audio data subset and the second modulus of the fourth audio data subset are obtained according to the third audio data subset and the fourth audio data subset using a modulus calculation formula; the dot product is divided by the product of the first modulus and the second modulus to obtain the cosine similarity.
[0010] In the preferred example, the time delay alignment calculation process solves the problem of similarity miscalculation caused by the time delay of microphone audio and original audio during transmission, playback, and collection. First, the third audio data (original mixed audio) and the fourth audio data (microphone audio) are time delay aligned to eliminate the comparison deviation caused by time difference and ensure that the comparison data is audio of the same period; then the data correlation is calculated by the standard dot product formula and the data amplitude feature is calculated by the modulus formula, which avoids the problem of low similarity caused by subjective judgment or misalignment, improves the accuracy of the second fault detection result (the state of the speaker output link), and accurately identifies the audio distortion and no output caused by speaker failure, providing a reliable basis for speaker link fault detection.
[0011] As a preferred example of the first aspect, the first fault detection result and the second fault detection result are compared, and the final fault detection result of the audio system is output, specifically: If the first fault detection result is an abnormal state and the second fault detection result is an abnormal state, it is determined that the fault is located in the power amplifier of the audio system; if the first fault detection result is a normal state and the second fault detection result is an abnormal state, it is determined that the fault is located in the output speaker of the audio system; if both the first fault detection result and the second fault detection result are normal, it is determined that the entire audio playback link is working normally.
[0012] In the preferred example, by establishing the correspondence between the fault location and the detection result, the core pain point of the prior art that can only determine that there is a fault but cannot locate the fault is solved. Through three scenarios of double abnormal corresponding to power amplifier fault, single abnormal corresponding to speaker fault, and double normal corresponding to whole link normal, a clear fault location path is formed. This logic does not require manual checking of sound cards, power amplifiers, speakers and other components one by one, greatly shortening the fault troubleshooting time and reducing the operation and maintenance labor cost; at the same time, the clear whole link normal determination condition enables the operation and maintenance personnel to quickly confirm the system state and avoid over-repairing. Whether it is remote operation and maintenance of a broadcast system or real-time monitoring of a conference audio, the determination logic can improve the fault response efficiency and ensure the rapid recovery and stable operation of the audio system.
[0013] As a preferred example of the first aspect, the frequency of the first preset sinusoidal wave audio data and the second preset sinusoidal wave audio data is 22 kHz.
[0014] In the preferred example, the first and second preset sinusoidal wave frequencies are limited to 22 kHz, taking into account the detection accuracy and user experience, and solving the problem that the preset sinusoidal wave may interfere with normal audio playback or be affected by environmental noise. 22 kHz is outside the upper limit of human hearing (about 20 kHz) and will not be perceived by users, avoiding interference of the detection signal on the normal audio playback experience, especially suitable for scenarios such as conferences and broadcasts that require high audio purity; at the same time, 22 kHz is within the processing range of common sound cards and can be stably mixed, transmitted and sampled, and this frequency is far away from common interference sources in the environment, reducing the influence of noise on the target signal. This frequency selection ensures that the preset sinusoidal wave can be accurately recognized in the dual-mode detection, without affecting the user experience, achieving the effects of detection without disturbing the public and accurate and non-interfering.
[0015] In a second aspect, the present application provides an audio system fault detection device based on dual-mode audio sampling, comprising: a fault detection module, a sound card, a power amplifier, an output speaker, a built-in microphone and a switch; The fault detection module comprises a first acquisition module, a first processing module, a second processing module, a second acquisition module, a third processing module, a fourth processing module and a result output module; The first acquisition module is configured to acquire first network audio data and left channel audio data of the sound card, mix the left channel audio data and the first network audio data, and obtain first audio data; The first processing module is configured to mix first preset sinusoidal wave audio data and the first input audio data, obtain second audio data, output the second audio data to the power amplifier through the sound card, and further acquire right channel audio data of the power amplifier through a link back sampling method. The second processing module is configured to perform fast Fourier transform on the right channel audio data, obtain a signal energy value, and obtain a first fault detection result according to a first preset threshold and the signal energy value. The second acquisition module is configured to acquire second network audio data, mix second preset sinusoidal wave audio data and the second input audio data, and obtain third audio data. The third processing module is configured to connect the left channel of the sound card to the built-in microphone through the switch, and acquire fourth audio data of the output loudspeaker through the built-in microphone. The fourth processing module is configured to process the third audio data and the fourth audio data by using a cosine similarity comparison method, obtain a cosine similarity, and obtain a second fault detection result according to a second preset threshold and the cosine similarity. The result output module is configured to compare the first fault detection result and the second fault detection result, and output a final fault detection result of the audio system.
[0016] As a preferred example of the second aspect, the second processing module includes a first processing unit and a second processing unit. The first processing unit is configured to obtain a target bin interval corresponding to the first preset sinusoidal wave audio data by using a bin interval calculation method according to the first preset sinusoidal wave audio data. The second processing unit is configured to perform fast Fourier transform on the right channel audio data to obtain spectrum data, and obtain the signal energy value according to the target bin interval and the spectrum data.
[0017] As a preferred example of the second aspect, the fourth processing module includes a third processing unit, a fourth processing unit, and a fifth processing unit. The third processing unit is configured to perform time delay alignment processing on the third audio data and the fourth audio data, and acquire an aligned third audio data subset and an aligned fourth audio data subset. The fourth processing unit is configured to calculate a dot product according to the third audio data subset and the fourth audio data subset by using a dot product calculation formula, and calculate a first module length of the third audio data subset and a second module length of the fourth audio data subset according to the third audio data subset and the fourth audio data subset by using a module length calculation formula; The fifth processing unit is configured to divide the dot product by a product of the first module length and the second module length to obtain the cosine similarity.
[0018] As a preferred example of the second aspect, the result output module comprises a first output unit, a second output unit and a third output unit. The first output unit is configured to determine that a fault is located at the power amplifier of the audio system if the first fault detection result is an abnormal state and the second fault detection result is an abnormal state; the second output unit is configured to determine that a fault is located at the output loudspeaker of the audio system if the first fault detection result is a normal state and the second fault detection result is an abnormal state; and the third output unit is configured to determine that the entire audio playing link is working normally if the first fault detection result and the second fault detection result are both normal.
[0019] As a preferred example of the second aspect, the frequency of the first preset sinusoidal wave audio data and the second preset sinusoidal wave audio data is 22 kHz.
[0020] In summary, the embodiment of the present application obtains first network audio data and sound card left channel audio data, mixes them, and then outputs them to a power amplifier after mixing in preset sinusoidal wave data; at the same time, right channel audio data of the power amplifier is obtained by link back sampling and is processed by fast Fourier transform to obtain a first fault detection result. On the other hand, second network audio data is obtained and mixed with preset sinusoidal wave data, and output loudspeaker audio data is collected by means of a switching switch connected to a built-in microphone. The aforementioned audio data mixed with preset sinusoidal wave data is compared by cosine similarity to obtain a second fault detection result. Finally, the final fault detection result is output by comparing the two results. Therefore, the technical solution can solve the problem that it is difficult to determine whether an audio system is faulty and accurately locate the fault position in the audio system in the prior art.
[0021] Another embodiment of the present application further provides a terminal device, which comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the computer program is executed by the processor, the steps of the audio system fault detection method based on dual-mode audio back sampling are implemented.
[0022] Another embodiment of the present application also provides a computer readable storage medium item, comprising: a stored computer program, when the computer program is running, controlling the device where the computer readable storage medium is located to execute the steps of the audio system fault detection method based on dual-mode audio back mining of the present application. BRIEF DESCRIPTION OF DRAWINGS
[0023] In order to more clearly illustrate the technical solutions of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. Obviously, the drawings described in the following are only some of the embodiments of the present application, and other drawings can also be obtained by those skilled in the art without any creative effort.
[0024] Figure 1 A flowchart of an embodiment of the audio system fault detection method based on dual-mode audio back mining provided by the present application; Figure 2 An audio system structure diagram of an embodiment of the audio system fault detection method based on dual-mode audio back mining provided by the present application; Figure 3 A module structure diagram of an embodiment of the audio system fault detection device based on dual-mode audio back mining provided by the present application. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solutions and advantages of the present application more clear, the following will combine the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without any creative effort are within the scope of protection of the present application.
[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "include" and "have" and any variations thereof in the specification and claims of the present application and the above description of drawings are intended to cover non-exclusive inclusion.
[0027] In the description of the embodiments of the present application, the technical terms "first", "second" and the like are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "a plurality of" is two or more, unless otherwise explicitly specified.
[0028] Reference to an "embodiment" in this document means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are they necessarily mutually exclusive of one another. It is expressly understood that the embodiments described herein are merely examples from among a great variety of embodiments that can be made.
[0029] In the description of the embodiments of the application, the term "and / or" is merely an association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the three cases of A alone, A and B together, and B alone. In addition, the character " / " in this paper generally represents that the front and rear associated objects are a "or" relationship.
[0030] In the description of the embodiments of the application, the term "a plurality of" refers to two or more (including two), and similarly, "a plurality of groups" refers to two or more groups (including two groups), and "a plurality of pieces" refers to two or more pieces (including two pieces).
[0031] In the description of the embodiments of the application, unless otherwise explicitly specified and limited, the technical terms "mounting", "connection", "connection", "fixing" and the like should be understood in a broad sense, for example, it can be fixedly connected, or it can be detachably connected, or it can be integrated; it can be mechanical connection, or it can be electrical connection; it can be directly connected, or it can be indirectly connected through an intermediate medium; it can be the internal communication of two elements or the interaction relationship between two elements. For those skilled in the art, the specific meaning of the above terms in the embodiments of the application can be understood according to the specific circumstances.
[0032] Embodiment one Reference Figure 1 To solve the problem that it is difficult to determine whether the audio system is faulty and accurately locate the fault position in the audio system in the prior art, an embodiment of the application provides an audio system fault detection method based on double-mode audio back sampling. The audio system includes a sound card, a power amplifier, an output loudspeaker, a built-in microphone and a switching switch. The fault detection method comprises the following steps: S1, obtaining first network audio data and left channel audio data of the sound card, and mixing the left channel audio data and the first network audio data to obtain first audio data; Specifically, the first network audio data is obtained by decoding network audio through a system.
[0033] S2, mix the first preset sine wave audio data and the first input audio data to obtain second audio data, and output the second audio data to the power amplifier through the sound card, and then obtain the right channel audio data of the power amplifier through a link back sampling method; S3, performing fast Fourier transform on the right channel audio data to obtain a signal energy value, and obtaining a first fault detection result according to a first preset threshold and the signal energy value; In some embodiments of the present application, the fast Fourier transform on the right channel audio data to obtain a signal energy value is specifically: According to the first preset sine wave audio data, a bin interval calculation method is used to obtain a target bin interval corresponding to the first preset sine wave audio data; Performing fast Fourier transform on the right channel audio data to obtain frequency spectrum data, and obtaining the signal energy value according to the target bin interval and the frequency spectrum data.
[0034] Specifically, the bin interval calculation method is as follows: First, the frequency calculation formula is introduced as follows: wherein, is the sampling frequency, which is 48 kHz, N is the sample point number, which can be 1024 or 2048, and K is the serial number of FFT, is the real frequency corresponding to the kth bin.
[0035] bin is a "frequency grid", and FFT divides the entire frequency range 0~Fs into N small grids, and the width of each grid is Fs / N. First, calculate the bin where 22k is located. Since the sampling rate is limited to 48 kHz as described above, the sample point number is assumed to be 1024. Then, calculate the frequency resolution = 48000 / 1024 ≈ 46.875 Hz, and then calculate the bin corresponding to 22k: = 22000 / 46.875 ≈ 469, that is, the energy of 22 kHz will be mainly concentrated between bin 469 and bin 470.
[0036] It should be noted that when extracting features through link back sampling, Goertzel can also be used instead of fft (fast Fourier transform), which consumes less resources, because this is a superimposed fixed frequency file, and does not need to separate too many frequency band features. Or first Goertzel detection, and then use fft if the result is not normal.
[0037] S4, acquire second network audio data, and mix the second preset sinusoidal wave audio data and the second input audio data to obtain third audio data; Specifically, the acquisition of the second network audio data is obtained by decoding the network audio through a system.
[0038] In some embodiments of the present application, the frequency of the first preset sinusoidal wave audio data and the second preset sinusoidal wave audio data is 22 kHz.
[0039] S5, connect the left channel of the sound card to the built-in microphone through the switch, and collect fourth audio data of the output speaker through the built-in microphone; S6, according to the third audio data and the fourth audio data, using cosine similarity comparison method for processing, obtaining cosine similarity, and according to second preset threshold and the cosine similarity, obtaining second fault detection result; In some embodiments of the present application, according to the third audio data and the fourth audio data, using cosine similarity comparison method for processing, obtaining cosine similarity, specifically: The third audio data and the fourth audio data are processed by time delay alignment, and the aligned third audio data subset and fourth audio data subset are obtained; according to the third audio data subset and the fourth audio data subset, the dot product is calculated by using the dot product calculation formula, and according to the third audio data subset and the fourth audio data subset, the first modulus of the third audio data subset and the second modulus of the fourth audio data subset are obtained by using the modulus calculation formula; the dot product is divided by the product of the first modulus and the second modulus to obtain the cosine similarity.
[0040] Exemplarily, in order to fully explain the above steps, the following scheme is taken as an example for description: The cosine similarity calculation process includes two parts of algorithm processing flow. The first part needs to determine the delay of network data and external microphone data. Since the network data is transmitted first, it is written into the sound card after decoding and played out, and then collected back, which will produce delay in the process. Therefore, the delay value is found first, and the data sample is adjusted, which is prepared for subsequent comparison; the second part is the conventional cosine similarity calculation.
[0041] 100 points from the network data into the array A, from the sound card collection data also selected 100 points into the array B. Then through the nested loop, each point in the array A, and each point in the array B in turn multiplied, find the maximum point of the product. According to the maximum point in the array A and array B in the coordinate position, can be calculated the delay of the two. For example, if the maximum point in the array A is located in the 10th, in the array B is located in the 30th, it is explained that there is 20 units of delay. At this time, the array A of the last 20 samples are removed, the array B of the first 20 samples are removed, the remaining 80 points can be regarded as the audio corresponding to the same period, used for subsequent comparison in the second step.
[0042] The second step performs a standard cosine similarity calculation, and its output range is [-1, 1], in which -1 represents the complete opposite of the waveform, 0 represents the basic dissimilarity, and 1 represents the complete consistency of the waveform, and the closer the result is to 1, the better. For example, suppose there are two arrays, A [n]= [1, 0, -1, 0], B [n]= [0.9, 0, -0.95, 0]. First, calculate the dot product: dot = 1×0.9 + 0×0 + (-1)×(-0.95) + 0×0 = 0.9 + 0.95 = 1.85; then calculate the length: |A| =≈1.414, |B| =≈1.309; finally, calculate the similarity: cos_sim = 1.85 / (1.414×1.309)≈1.85 / 1.852≈0.998. From the result, it can be seen that the similarity is very close to 1, and it can be considered as a consistent array of waveforms. In actual application, the array length needs to be calculated according to the formula. Due to environmental interference, the actual similarity is difficult to reach such a high value, and in general, the similarity is higher than 0.5, which can be determined to be effective; if the environmental noise is large, the threshold can be adjusted to 0.6-0.7.
[0043] S7, compare the first fault detection result and the second fault detection result, output the final fault detection result of the audio system.
[0044] In some embodiments of the present application, the first fault detection result and the second fault detection result are compared, and the final fault detection result of the audio system is output, specifically: If the first fault detection result is an abnormal state and the second fault detection result is an abnormal state, it is determined that the fault is located in the power amplifier of the audio system; if the first fault detection result is a normal state and the second fault detection result is an abnormal state, it is determined that the fault is located in the output speaker of the audio system; if the first fault detection result and the second fault detection result are normal, it is determined that the entire audio playback link works normally.
[0045] In summary, this embodiment first acquires and mixes first network audio data and left channel audio data from the sound card, then incorporates preset sine wave data before outputting it to the power amplifier. Simultaneously, it acquires right channel audio data from the power amplifier via link back sampling and processes it using a Fast Fourier Transform to obtain a first fault detection result. On the other hand, it acquires second network audio data and incorporates preset sine wave data, uses a switch to activate the built-in microphone to collect audio data from the output speaker, and combines this with the aforementioned audio data incorporating the preset sine wave through cosine similarity comparison to obtain a second fault detection result. Finally, it outputs the final fault detection result by comparing the two results. Therefore, this technical solution can solve the problem in the prior art of accurately locating the fault location in the audio system while simultaneously determining whether the audio system is faulty.
[0046] Example 2 like Figure 3 As shown, based on the above method embodiments, corresponding device embodiments are provided; One embodiment of the present invention provides an audio system fault detection device based on dual-mode audio retrieval. The fault detection device includes: a fault detection module, a sound card, a power amplifier, an output speaker, a built-in microphone, and a switching switch. The fault detection module includes a first acquisition module 31, a first processing module 32, a second processing module 33, a second acquisition module 34, a third processing module 35, a fourth processing module 36, and a result output module 37. The first acquisition module 31 is used to acquire first network audio data and the left channel audio data of the sound card, and mix the left channel audio data and the first network audio data to obtain the first audio data; The first processing module 32 is used to mix the first preset sine wave audio data and the first input audio data to obtain the second audio data, and output the second audio data to the power amplifier through the sound card, and then obtain the right channel audio data of the power amplifier through the link retrieval method. The second processing module 33 is used to perform a fast Fourier transform on the right channel audio data to obtain a signal energy value, and to obtain a first fault detection result based on a first preset threshold and the signal energy value. The second acquisition module 34 is used to acquire the second network audio data and mix the second preset sine wave audio data and the second input audio data to obtain the third audio data; The third processing module 35 is used to connect the left channel of the sound card to the built-in microphone through the switching switch, and to collect the fourth audio data of the output speaker through the built-in microphone; The fourth processing module 36 is configured to perform processing on the third audio data and the fourth audio data by using a cosine similarity comparison method to obtain a cosine similarity, and obtain a second fault detection result according to a second preset threshold and the cosine similarity. The result output module 37 is configured to compare the first fault detection result and the second fault detection result, and output a final fault detection result of the audio system.
[0047] In some embodiments of the present application, the second processing module 33 includes a first processing unit and a second processing unit. The first processing unit is configured to obtain a target bin interval corresponding to the first preset sinusoidal wave audio data by using a bin interval calculation method according to the first preset sinusoidal wave audio data. The second processing unit is configured to perform fast Fourier transform on the right channel audio data to obtain frequency spectrum data, and obtain the signal energy value according to the target bin interval and the frequency spectrum data.
[0048] In some embodiments of the present application, the fourth processing module 36 includes a third processing unit, a fourth processing unit and a fifth processing unit. The third processing unit is configured to perform time delay alignment processing on the third audio data and the fourth audio data to obtain an aligned third audio data subset and an aligned fourth audio data subset. The fourth processing unit is configured to calculate a dot product according to the third audio data subset and the fourth audio data subset by using a dot product calculation formula, and obtain a first module length of the third audio data subset and a second module length of the fourth audio data subset according to the third audio data subset and the fourth audio data subset by using a module length calculation formula. The fifth processing unit is configured to divide the dot product by a product of the first module length and the second module length to obtain the cosine similarity.
[0049] In some embodiments of the present application, the result output module 37 includes a first output unit, a second output unit and a third output unit. The first output unit is configured to determine that a fault is located in the power amplifier of the audio system if the first fault detection result is an abnormal state and the second fault detection result is an abnormal state; the second output unit is configured to determine that a fault is located in the output loudspeaker of the audio system if the first fault detection result is a normal state and the second fault detection result is an abnormal state; and the third output unit is configured to determine that the entire audio playback link is working normally if the first fault detection result and the second fault detection result are both normal.
[0050] In some embodiments of the present application, the frequency of the first preset sinusoidal wave audio data and the second preset sinusoidal wave audio data is 22 kHz.
[0051] The detailed steps and working principles of the embodiments can be understood in detail with reference to the relevant description of Embodiment One.
[0052] In summary, in the embodiments of the present application, the first network audio data and the sound card left channel audio data are acquired and mixed first, and then the preset sinusoidal wave data is fused and output to the power amplifier. At the same time, the power amplifier right channel audio data is acquired by link back sampling and processed by fast Fourier transform to obtain a first fault detection result. On the other hand, the second network audio data is acquired and fused with the preset sinusoidal wave data, and the output loudspeaker audio data is acquired by the built-in microphone through the switching switch. The aforementioned audio data fused with the preset sinusoidal wave data is compared by cosine similarity to obtain a second fault detection result. Finally, the final fault detection result is output by comparing the two results. Therefore, the technical solution can solve the problem that it is difficult to determine whether the audio system is faulty and accurately locate the fault position in the audio system in the prior art.
[0053] It can be understood that the above-mentioned device item embodiments correspond to the method item embodiments of the present application, and can realize the audio system fault detection method based on double-mode audio back sampling provided by any one of the above-mentioned method item embodiments.
[0054] It should be noted that the device embodiments described above are only schematic, and some or all of the modules can be selected to achieve the purpose of the present embodiment. In addition, in the device embodiment provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which can be realized as one or more communication buses or signal lines. Those skilled in the art can understand and implement it without creative labor.
[0055] Embodiment Three On the basis of the above-mentioned embodiments of the audio system fault detection method based on double-mode audio back sampling, another embodiment of the present application provides a terminal device. The terminal device comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the audio system fault detection method based on double-mode audio back sampling of any one embodiment of the present application is realized.
[0056] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present application. The one or more modules can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program in the terminal device.
[0057] The terminal device can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing devices. The terminal device can include, but is not limited to, a processor and a memory.
[0058] The processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, and connects all parts of the terminal device through various interfaces and lines.
[0059] Embodiment Four On the basis of the above-mentioned method embodiment, another embodiment of the present application provides a computer readable storage medium, including a stored computer program, wherein when the computer program runs, the device where the computer readable storage medium is located executes the audio system fault detection method based on the dual-mode audio back mining according to any one of the above-mentioned method embodiments of the present application.
[0060] The modules / units integrated in the device / terminal equipment, if realized in the form of software function units and sold or used as independent products, can be stored in a computer readable storage medium. Based on this understanding, all or part of the processes in the above-mentioned embodiment methods can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. When the computer program is executed by a processor, the steps of each method embodiment can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms, etc. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc.
[0061] The above is the preferred embodiment of the present application. It should be pointed out that for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, which are also considered within the scope of protection of the present application.
Claims
1. A fault detection method for an audio system based on dual-mode audio retrieval, characterized in that, Applicable to the aforementioned audio system, which includes a sound card, power amplifier, output speaker, built-in microphone, and switching switch, the fault detection method includes: Acquire first network audio data and the left channel audio data of the sound card, and mix the left channel audio data and the first network audio data to obtain the first audio data; The first preset sine wave audio data and the first input audio data are mixed to obtain the second audio data, and the second audio data is output to the power amplifier through the sound card. Then, the right channel audio data of the power amplifier is obtained through the link back sampling method. The right channel audio data is subjected to a fast Fourier transform to obtain a signal energy value, and a first fault detection result is obtained based on a first preset threshold and the signal energy value. Acquire second network audio data, and mix the second preset sine wave audio data with the second input audio data to obtain third audio data; The left channel of the sound card is connected to the built-in microphone via the switch, and the fourth audio data of the output speaker is collected through the built-in microphone. Based on the third audio data and the fourth audio data, a cosine similarity comparison method is used to process the data to obtain a cosine similarity. A second fault detection result is then obtained based on a second preset threshold and the cosine similarity. The first fault detection result and the second fault detection result are compared to output the final fault detection result of the audio system.
2. The audio system fault detection method based on dual-mode audio retrieval as described in claim 1, characterized in that, The step of performing a Fast Fourier Transform on the right channel audio data to obtain the signal energy value is as follows: Based on the first preset sine wave audio data, the target bin interval corresponding to the first preset sine wave audio data is obtained by using the bin interval calculation method; The right channel audio data is subjected to a fast Fourier transform to obtain spectral data, and the signal energy value is obtained based on the target bin interval and the spectral data.
3. The audio system fault detection method based on dual-mode audio retrieval as described in claim 1, characterized in that, The process of processing the third and fourth audio data using a cosine similarity comparison method to obtain the cosine similarity is as follows: The third audio data and the fourth audio data are time-delay aligned to obtain aligned subsets of the third audio data and the fourth audio data. The dot product is calculated using the dot product formula based on the third audio data subset and the fourth audio data subset. The first modulus of the third audio data subset and the second modulus of the fourth audio data subset are obtained using the modulus calculation formula based on the third audio data subset and the fourth audio data subset. The cosine similarity is obtained by dividing the dot product by the product of the first modulus and the second modulus.
4. The audio system fault detection method based on dual-mode audio retrieval as described in claim 1, characterized in that, The step of comparing the first fault detection result and the second fault detection result to output the final fault detection result of the audio system specifically involves: If the first fault detection result is abnormal and the second fault detection result is abnormal, then the fault is determined to be located in the power amplifier of the audio system; if the first fault detection result is normal and the second fault detection result is abnormal, then the fault is determined to be located in the output speaker of the audio system. If both the first fault detection result and the second fault detection result are normal, then the entire audio playback link is determined to be working normally.
5. A method for fault detection of an audio system based on dual-mode audio retrieval as described in any one of claims 1 to 4, characterized in that, The frequencies of the first preset sine wave audio data and the second preset sine wave audio data are both 22kHz.
6. An audio system fault detection device based on dual-mode audio retrieval, characterized in that, The fault detection device includes: a fault detection module, a sound card, a power amplifier, an output speaker, a built-in microphone, and a switch; The fault detection module includes a first acquisition module, a first processing module, a second processing module, a second acquisition module, a third processing module, a fourth processing module, and a result output module; The first acquisition module is used to acquire first network audio data and the left channel audio data of the sound card, and mix the left channel audio data and the first network audio data to obtain the first audio data; The first processing module is used to mix the first preset sine wave audio data and the first input audio data to obtain the second audio data, and output the second audio data to the power amplifier through the sound card, and then obtain the right channel audio data of the power amplifier through the link back sampling method; The second processing module is used to perform a fast Fourier transform on the right channel audio data to obtain a signal energy value, and to obtain a first fault detection result based on a first preset threshold and the signal energy value. The second acquisition module is used to acquire the second network audio data and mix the second preset sine wave audio data and the second input audio data to obtain the third audio data; The third processing module is used to connect the left channel of the sound card to the built-in microphone through the switching switch, and to collect the fourth audio data of the output speaker through the built-in microphone; The fourth processing module is used to process the third audio data and the fourth audio data using a cosine similarity comparison method to obtain a cosine similarity, and to obtain a second fault detection result based on a second preset threshold and the cosine similarity. The result output module is used to compare the first fault detection result and the second fault detection result, and output the final fault detection result of the audio system.
7. The audio system fault detection device based on dual-mode audio retrieval as described in claim 6, characterized in that, The second processing module includes a first processing unit and a second processing unit; The first processing unit is configured to obtain the target bin interval corresponding to the first preset sine wave audio data by using a bin interval calculation method based on the first preset sine wave audio data. The second processing unit is used to perform a fast Fourier transform on the right channel audio data to obtain spectral data, and to obtain the signal energy value based on the target bin interval and the spectral data.
8. The audio system fault detection device based on dual-mode audio retrieval as described in claim 6, characterized in that, The fourth processing module includes a third processing unit, a fourth processing unit, and a fifth processing unit; The third processing unit is used to perform time delay alignment processing on the third audio data and the fourth audio data to obtain an aligned subset of the third audio data and a subset of the fourth audio data. The fourth processing unit is used to calculate the dot product using the dot product calculation formula based on the third audio data subset and the fourth audio data subset, and to obtain the first modulus of the third audio data subset and the second modulus of the fourth audio data subset using the modulus calculation formula based on the third audio data subset and the fourth audio data subset. The fifth processing unit is used to divide the dot product by the product of the first modulus and the second modulus to obtain the cosine similarity.
9. The audio system fault detection device based on dual-mode audio retrieval as described in claim 6, characterized in that, The result output module includes a first output unit, a second output unit, and a third output unit; The first output unit is configured to determine that the fault is located in the power amplifier of the audio system if the first fault detection result is an abnormal state and the second fault detection result is an abnormal state. The second output unit is configured to determine that the fault is located in the output speaker of the audio system if the first fault detection result is normal and the second fault detection result is abnormal. The third output unit is used to determine that the entire audio playback link is working normally if both the first fault detection result and the second fault detection result are normal.
10. An audio system fault detection device based on dual-mode audio retrieval as described in any one of claims 6 to 9, characterized in that, The frequencies of the first preset sine wave audio data and the second preset sine wave audio data are both 22kHz.
Citation Information
Patent Citations
Cinema sound channel sound returning fault detection method and system, terminal and medium
CN116567510A
Method for detecting fault of audio playing equipment
CN116866809A
Sound beam forming pointing control method based on crowd recognition and related equipment thereof
CN120128849A