An audio system fault detection method and device based on dual-mode audio recovery
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU BAOLUN ELECTRONICS CO LTD
- Filing Date
- 2025-09-01
- Publication Date
- 2026-08-07
AI Technical Summary
[0004]本发明提供了一种基于双模式音频回采的音频系统故障检测方法及装置,能够解决现有技术中难以在判断音频系统是否故障的同时,对音频系统中的故障位置实现精确定位的问题
[0045]综上,本申请实施例通过先获取第一网络音频数据与声卡左声道音频数据并混合,再融入预设正弦波数据后输出至功放,同时以链路回采获取功放右声道音频数据并经快速傅里叶变换处理得到第一故障检测结果;另一方面获取第二网络音频数据并融入预设正弦波数据,借助切换开关接通内置麦克风采集输出喇叭音频数据,结合前述融入预设正弦波的音频数据经余弦相似度比较得到第二故障检测结果,最终通过双结果对比输出最终故障检测结果。因此,本技术方案能够解决现有技术中难以在判断音频系统是否故障的同时,对音频系统中的故障位置实现精确定位的问题。
Smart Images

Figure CN120980433B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of audio fault detection, and in particular to an audio system fault detection method and apparatus based on dual-mode audio retrieval. Background Technology
[0002] In the field of audio fault detection, the core objective is to monitor and diagnose the entire link from signal transmission and decoding to playback output, ensuring the continuous, stable, and reliable operation of the audio system. Audio fault detection is widely used in applications such as real-time communication, broadcasting systems, conference audio, and public address systems, placing high demands on the real-time detection and precise location of faults.
[0003] Existing technologies typically employ transport layer detection mechanisms based on RTP (Real-time Transport Protocol) and RTCP (RTP Control Protocol), or similar tag-based audio packet verification methods. These methods primarily determine data integrity and on-time arrival during transmission by checking the sequence number continuity, timestamp synchronization, and packet loss rate of audio data packets. However, these methods are limited to detecting packet integrity only during network transmission and cannot cover potential faults that may occur in critical stages of audio data transmission, such as audio distortion, noise interference, intermittent transmission, and no output. Therefore, existing methods struggle to achieve comprehensive end-to-end diagnosis of the audio playback link, often resulting in missed faults or inaccurate fault location in practical applications. Summary of the Invention
[0004] This invention provides a method and apparatus for fault detection in audio systems based on dual-mode audio retrieval, which can solve the problem in the prior art of accurately locating the fault location in the audio system while determining whether the audio system is faulty.
[0005] In a first aspect, embodiments of the present invention provide an audio system fault detection method based on dual-mode audio retrieval, applicable to the audio system, which includes a sound card, a power amplifier, an output speaker, a built-in microphone, and a switching switch. The fault detection method includes:
[0006] 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;
[0007] 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.
[0008] 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.
[0009] 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;
[0010] 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.
[0011] 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.
[0012] The first fault detection result and the second fault detection result are compared to output the final fault detection result of the audio system.
[0013] This application 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 retrieval 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.
[0014] As a preferred example of the first aspect, the step of performing a Fast Fourier Transform on the right channel audio data to obtain the signal energy value specifically involves:
[0015] 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;
[0016] 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.
[0017] In this preferred example, the combination of bin interval calculation and FFT spectrum extraction solves the problem of target signal energy identification deviation caused by insufficient frequency resolution in direct FFT. First, the target bin interval is calculated based on a first preset sine wave frequency, accurately locking the energy concentration range of the sine wave in the FFT spectrum. Then, FFT is performed on the right channel re-sampled data to extract the signal energy value from the target bin interval. This method avoids detection errors caused by energy dispersion in non-target intervals after FFT. Especially in complex noise environments, it can effectively distinguish the target sine wave signal from interference signals, significantly improving the accuracy of signal energy value extraction.
[0018] As a preferred example of the first aspect, the process of processing the third audio data and the fourth audio data using a cosine similarity comparison method to obtain a cosine similarity is as follows:
[0019] The third and fourth audio data are time-delay aligned to obtain aligned subsets of third and fourth audio data. A dot product is calculated using the dot product formula based on the third and fourth audio data subsets. A first modulus of the third audio data subset and a second modulus of the fourth audio data subset are then obtained using the modulus calculation formula. The cosine similarity is obtained by dividing the dot product by the product of the first and second modulus.
[0020] In this preferred example, the time-delay alignment calculation process solves the problem of miscalculation of similarity between microphone-retrieved audio and original audio caused by transmission, playback, and acquisition delays. First, the third audio data (original mixed audio) and the fourth audio data (microphone-retrieved audio) are time-delay aligned to eliminate the comparison deviation caused by time difference and ensure that the compared data are audio from the same time period. Then, the data correlation is calculated using the standard dot product formula and the data amplitude characteristics are calculated using the modulus formula, avoiding the problem of low similarity caused by subjective judgment or misalignment. This improves the accuracy of the second fault detection result (speaker output link status) and can accurately identify problems such as audio distortion and no output caused by speaker faults, providing a reliable basis for speaker fault detection.
[0021] As a preferred example of the first aspect, 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:
[0022] If both the first fault detection result and the second fault detection result are abnormal, the fault is determined to be located in the power amplifier of the audio system; if both the first fault detection result and the second fault detection result are normal, 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, the entire audio playback link is determined to be working normally.
[0023] In this preferred example, by establishing a correspondence between fault location and detection results, the core pain point of existing technologies—which can only identify a fault but cannot pinpoint its location—is addressed. It establishes a clear fault location path through three scenario-based determinations: dual anomalies correspond to amplifier faults, single anomalies correspond to speaker faults, and dual normalities correspond to a fully functional system. This logic eliminates the need for manual inspection of components such as sound cards, amplifiers, and speakers, significantly reducing troubleshooting time and maintenance manpower costs. Simultaneously, the clearly defined conditions for a fully functional system allow maintenance personnel to quickly confirm the system status, avoiding over-repair. Whether for remote maintenance of broadcast systems or real-time monitoring of conference audio, this determination logic improves fault response efficiency and ensures the rapid restoration of stable audio system operation.
[0024] As a preferred example of the first aspect, the frequencies of both the first preset sine wave audio data and the second preset sine wave audio data are 22kHz.
[0025] In this preferred example, the first and second preset sine wave frequencies are limited to 22kHz, balancing detection accuracy and user experience. This addresses the issue of preset sine waves potentially interfering with normal audio playback or being affected by environmental noise. 22kHz is outside the upper limit of human hearing (approximately 20kHz), meaning it will not be perceived by the user, thus avoiding interference from the detection signal on the normal audio playback experience. This is particularly suitable for scenarios requiring high audio purity, such as conferences and broadcasts. Simultaneously, 22kHz is within the processing range of common sound cards, allowing for stable mixing, transmission, and sampling. Furthermore, this frequency is far from common environmental interference sources, reducing the impact of noise on the target signal. This frequency selection ensures that in dual-mode detection, the preset sine wave can be accurately identified without affecting user experience, achieving both noise-free detection and accurate, interference-free operation.
[0026] Secondly, the present invention provides an audio system fault detection device based on dual-mode audio retrieval, comprising: a fault detection module, a sound card, a power amplifier, an output speaker, a built-in microphone, and a switching switch;
[0027] 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;
[0028] 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;
[0029] 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;
[0030] 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.
[0031] 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;
[0032] 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;
[0033] 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.
[0034] 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.
[0035] As a preferred example of the second aspect, the second processing module includes a first processing unit and a second processing unit;
[0036] 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.
[0037] 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.
[0038] 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;
[0039] 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.
[0040] 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.
[0041] 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.
[0042] As a preferred example of the second aspect, the result output module includes a first output unit, a second output unit, and a third output unit;
[0043] The first output unit is configured to determine that the fault is located in the power amplifier of the audio system if both the first fault detection result and the second fault detection result are abnormal; the second output unit is configured to determine 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 abnormal; the third output unit is configured 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.
[0044] As a preferred example of the second aspect, the frequencies of both the first preset sine wave audio data and the second preset sine wave audio data are 22kHz.
[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] Another embodiment of the present invention provides a terminal device, including: 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, it implements the steps of the audio system fault detection method based on dual-mode audio re-sampling of the present invention.
[0047] Another embodiment of the present invention also provides a computer-readable storage medium item, including: a stored computer program, which, when the computer program is running, controls the device where the computer-readable storage medium is located to perform the steps of the audio system fault detection method based on dual-mode audio re-sampling of the present invention. Attached Figure Description
[0048] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0049] Figure 1 This is a flowchart illustrating an embodiment of an audio system fault detection method based on dual-mode audio retrieval provided by the present invention.
[0050] Figure 2 This is a schematic diagram of an audio system structure, representing an embodiment of an audio system fault detection method based on dual-mode audio retrieval provided by the present invention.
[0051] Figure 3 This is a module structure diagram of an embodiment of an audio system fault detection device based on dual-mode audio retrieval provided by the present invention. Detailed Implementation
[0052] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0053] 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 this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0054] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.
[0055] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0056] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0057] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).
[0058] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.
[0059] Example 1
[0060] See Figure 1 To address the problem in existing technologies of accurately locating the fault within an audio system while simultaneously determining whether it is faulty, an embodiment of this invention provides an audio system fault detection method based on dual-mode audio retrieval. The audio system includes a sound card, power amplifier, output speaker, built-in microphone, and a switching switch. The fault detection method includes:
[0061] S1. Obtain the 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;
[0062] Specifically, the acquisition of the first network audio data is obtained by decoding the network audio through the system.
[0063] S2. 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;
[0064] S3. Perform a fast Fourier transform on the right channel audio data to obtain a signal energy value, and obtain a first fault detection result based on a first preset threshold and the signal energy value;
[0065] In some embodiments of this application, the step of performing a Fast Fourier Transform on the right channel audio data to obtain the signal energy value specifically involves:
[0066] 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;
[0067] 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.
[0068] Specifically, the bin interval calculation method is as follows:
[0069] First, the frequency calculation formula is introduced as follows:
[0070]
[0071] in, The sampling frequency is set to 48 kHz, N is the number of sample points (which can be 1024 or 2048), and K is the FFT index. This represents the actual frequency corresponding to the k-th bin.
[0072] A bin is essentially a "frequency grid." The FFT divides the entire frequency range 0 to Fs into N smaller grids, each with a width of Fs / N. First, the bin containing 22kHz is calculated. Since the sampling rate is limited to 48kHz, the number of sample points is assumed to be 1024. Next, the frequency resolution is calculated. =48000 / 1024≈46.875Hz, then calculate the bin corresponding to 22kHz: =22000 / 46.875≈469, which means that the energy at 22 kHz will be mainly concentrated between bin 469 and bin 470.
[0073] It should be noted that when extracting features from link re-imports, Goertzel can be used instead of FFT (Fast Fourier Transform) because it consumes fewer resources. This is because it involves superimposed files of fixed frequencies, and there is no need to separate too many frequency band features. Alternatively, Goertzel can be used first, and FFT can be used only if the results are abnormal.
[0074] S4. 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;
[0075] Specifically, the acquisition of the second network audio data is obtained by decoding the network audio through the system.
[0076] In some embodiments of this application, the frequencies of the first preset sine wave audio data and the second preset sine wave audio data are both 22kHz.
[0077] S5. The left channel of the sound card is connected to the built-in microphone via the switching switch, and the fourth audio data of the output speaker is collected through the built-in microphone;
[0078] S6. Based on the third audio data and the fourth audio data, a cosine similarity comparison method is used to process them to obtain a cosine similarity, and a second fault detection result is obtained based on the second preset threshold and the cosine similarity.
[0079] In some embodiments of this application, the step of processing the third audio data and the fourth audio data using a cosine similarity comparison method to obtain a cosine similarity is specifically as follows:
[0080] The third and fourth audio data are time-delay aligned to obtain aligned subsets of third and fourth audio data. A dot product is calculated using the dot product formula based on the third and fourth audio data subsets. A first modulus of the third audio data subset and a second modulus of the fourth audio data subset are then calculated using the modulus formula based on the third and fourth audio data subsets. The cosine similarity is obtained by dividing the dot product by the product of the first and second modulus.
[0081] For example, to fully explain the above steps, the following scheme will be used as an example:
[0082] The cosine similarity calculation process consists of two parts. The first part requires determining the delay between the network data and the data captured by the external microphone. Since the network data is transmitted first, then decoded and written to the sound card for playback output, and then captured and transmitted back, a delay will occur during this process. Therefore, this delay value must be found first, and the data samples should be offset and adjusted to prepare for subsequent comparisons. The second part is the conventional cosine similarity calculation.
[0083] 100 points are selected from the network data and stored in array A, and another 100 points are selected from the re-collected data from the sound card and stored in array B. Then, using nested loops, each point in array A is iterated over and multiplied sequentially with each point in array B, finding the point with the largest product. Based on the coordinates of this largest point in arrays A and B, the delay between the two arrays can be calculated. For example, if the largest point is at position 10 in array A and position 30 in array B, it indicates a delay of 20 units. At this point, the last 20 samples in array A and the first 20 samples in array B are removed, leaving 80 points that can be considered as audio from the same time period for comparison in the subsequent second step.
[0084] The second step performs a standard cosine similarity calculation, with an output range of [-1, 1]. -1 represents completely opposite waveforms, 0 represents minimal dissimilarity, and 1 represents identical waveforms. A result closer to 1 is better. For example, suppose there are two arrays, A[n] = [1, 0, -1, 0] and 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 modulus: |A| = ≈1.414, |B| = ≈1.309; finally, calculate the similarity: cos_sim = 1.85 / (1.414×1.309) ≈ 1.85 / 1.852 ≈ 0.998. The result shows a similarity very close to 1, indicating that the arrays have identical waveforms. In practical applications, the array length needs to be substituted into the formula for calculation. Due to environmental interference, the actual similarity is difficult to reach such a high value. Generally, a similarity higher than 0.5 is sufficient to determine validity; if the environmental noise is high, the judgment threshold can be adjusted to 0.6-0.7.
[0085] S7. Compare the first fault detection result and the second fault detection result, and output the final fault detection result of the audio system.
[0086] In some embodiments of this application, 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:
[0087] If both the first fault detection result and the second fault detection result are abnormal, the fault is determined to be located in the power amplifier of the audio system; if both the first fault detection result and the second fault detection result are normal, 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, the entire audio playback link is determined to be working normally.
[0088] 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.
[0089] Example 2
[0090] like Figure 3 As shown, based on the above method embodiments, corresponding device embodiments are provided;
[0091] 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.
[0092] 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.
[0093] 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;
[0094] 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.
[0095] 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.
[0096] 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;
[0097] 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;
[0098] The fourth processing module 36 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.
[0099] The result output module 37 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.
[0100] In some embodiments of this application, the second processing module 33 includes a first processing unit and a second processing unit;
[0101] 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.
[0102] 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.
[0103] In some embodiments of this application, the fourth processing module 36 includes a third processing unit, a fourth processing unit, and a fifth processing unit;
[0104] 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.
[0105] 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.
[0106] 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.
[0107] In some embodiments of this application, the result output module 37 includes a first output unit, a second output unit, and a third output unit;
[0108] The first output unit is configured to determine that the fault is located in the power amplifier of the audio system if both the first fault detection result and the second fault detection result are abnormal; the second output unit is configured to determine 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 abnormal; the third output unit is configured 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.
[0109] In some embodiments of this application, the frequencies of the first preset sine wave audio data and the second preset sine wave audio data are both 22kHz.
[0110] For more detailed steps and working principles of this embodiment, please refer to the relevant description in Embodiment 1, but not limited to these descriptions.
[0111] 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.
[0112] It is understood that the above-described device embodiments correspond to the method embodiments of the present invention, and can implement the audio system fault detection method based on dual-mode audio retrieval provided by any of the above-described method embodiments of the present invention.
[0113] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can specifically be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0114] Example 3
[0115] Based on the above embodiments of the audio system fault detection method based on dual-mode audio re-acquisition, another embodiment of the present invention provides a terminal device, which includes 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, it implements the audio system fault detection method based on dual-mode audio re-acquisition of any embodiment of the present invention.
[0116] 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 invention. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.
[0117] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0118] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.
[0119] Example 4
[0120] Based on the above-described method embodiments, another embodiment of the present invention provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute the audio system fault detection method based on dual-mode audio re-sampling as described in any of the above-described method embodiments of the present invention.
[0121] The modules / units integrated in the device / terminal equipment, if implemented as software functional 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 embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0122] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
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 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 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 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 second network audio data and mix the second preset sine wave audio data with the second audio data to obtain 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