Audio device detection method, device, electronic device and readable storage medium
Through the automated audio signal characteristic analysis method, the faults of audio equipment are detected, and the problems of low efficiency and labor consumption of traditional detection methods are solved, and an efficient and automated detection process is achieved.
Patent Information
- Application Number
- CN202411012508.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-07-26
AI Technical Summary
Traditional audio equipment detection methods are inefficient, rely on manual inspection, consume manpower, and it is difficult to efficiently detect the failure of audio equipment.
Provide a detection method of an audio device, by controlling the measured audio device to play the reference audio signal, collecting the reference audio signal in the preparation stage, collecting the test audio signal in the fault detection stage, and performing audio signal characteristics analysis on both to determine whether the device is A failure occurred.
Without manual participation, the detection process is automatically performed through the program, which significantly improves the detection efficiency of audio equipment and reduces labor costs.
Smart Images

Figure CN118764810B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of detection technology, and in particular to a detection method, device, electronic device and readable storage medium for an audio device. Background Art
[0002] At present, audio equipment is widely used in various places, including office buildings, conference rooms, exhibition halls, squares, parks, etc. Large places often use hundreds or thousands of audio equipment, which are scattered at various locations. In the process of continuous use, audio equipment will inevitably fail, such as no sound, a lot of noise, pitch change, howling, too loud or too soft, etc.
[0003] The traditional method of testing audio equipment often relies on staff to check the audio equipment one by one, gradually test and detect the various characteristics of the audio equipment, and use human experience to determine whether the audio equipment has a fault in some aspect. This method is inefficient and labor-intensive. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide a detection method, apparatus, electronic device and readable storage medium for an audio device, so as to improve the detection efficiency of the audio device.
[0005] In a first aspect, an embodiment of the present application provides a method for detecting an audio device, comprising:
[0006] In the preparation stage, the tested audio device that has not failed is controlled to play the reference audio signal, so that during the process of the tested audio device that has not failed playing the reference audio signal in the preparation stage, the audio signal played by the tested audio device is collected and used as the reference audio signal;
[0007] In the fault detection phase, the audio device under test is controlled to play the reference audio signal, so that during the process of the audio device under test playing the reference audio signal in the fault detection phase, an audio signal played by the audio device under test is collected and used as a test audio signal;
[0008] Perform audio signal feature analysis on the reference audio signal and the test audio signal, and determine whether the audio device under test fails during the fault detection phase based on the analysis results; wherein the audio signal feature analysis includes any one or more of the following analysis methods: time domain-frequency domain grid analysis, zero crossing rate analysis, loudness analysis, and spectral centroid analysis.
[0009] In a second aspect, an embodiment of the present application further provides a detection device for an audio device, comprising:
[0010] A first control module is used to control the tested audio device that has not failed to play the reference audio signal in the preparation stage, so as to collect the audio signal played by the tested audio device during the process of the tested audio device that has not failed to play the reference audio signal in the preparation stage, and use the audio signal as the reference audio signal;
[0011] A second control module is used to control the audio device under test to play the reference audio signal during the fault detection phase, so as to collect the audio signal played by the audio device under test during the process of the audio device under test playing the reference audio signal during the fault detection phase, and use the audio signal as the test audio signal;
[0012] The first analysis module is used to perform audio signal feature analysis on the reference audio signal and the test audio signal, and determine whether the audio device under test fails during the fault detection phase based on the analysis results; wherein the audio signal feature analysis includes any one or more of the following analysis methods: time domain-frequency domain grid analysis, zero crossing rate analysis, loudness analysis, and spectral centroid analysis.
[0013] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps in any possible implementation of the first aspect above are performed.
[0014] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in any possible implementation of the first aspect described above are executed.
[0015] The present application provides a detection method, device, electronic device and readable storage medium for audio equipment. In the preparation stage, the tested audio equipment without fault is controlled to play the reference audio signal, so that the audio signal played by the tested audio equipment is collected during the process of the tested audio equipment without fault playing the reference audio signal in the preparation stage, and the audio signal is used as the reference audio signal; in the fault detection stage, the tested audio equipment is controlled to play the reference audio signal, so that the audio signal played by the tested audio equipment is collected during the process of the tested audio equipment playing the reference audio signal in the fault detection stage, and the audio signal is used as the test audio signal; the reference audio signal and the test audio signal are analyzed for audio signal characteristics, and whether the tested audio equipment fails in the fault detection stage is determined according to the analysis results; wherein the audio signal characteristic analysis includes any one or more of the following analysis methods: time domain-frequency domain grid analysis, zero crossing rate analysis, loudness analysis, and spectral centroid analysis. Compared with the traditional audio equipment detection method, the detection method in this embodiment does not need to rely on the staff to detect the audio equipment, and the above process can be performed using only the program, which is conducive to improving the detection efficiency of the audio equipment.
[0016] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 A flow chart of a method for detecting an audio device provided in an embodiment of the present application is shown;
[0019] Figure 2 A schematic diagram of the deployment structure between a detection device and a tested audio device provided in an embodiment of the present application is shown;
[0020] Figure 3 A schematic diagram of the deployment structure between a detection device, a cloud server and an audio device under test provided in an embodiment of the present application is shown;
[0021] Figure 4 A schematic diagram of a target grid provided in an embodiment of the present application is shown;
[0022] Figure 5A schematic diagram showing the structure of a detection device for an audio device provided in an embodiment of the present application is shown;
[0023] Figure 6 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0024] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0025] Considering the traditional detection method of audio equipment, it is often necessary for staff to check the audio equipment one by one, gradually test and detect the characteristics of various aspects of the audio equipment, and use human experience to determine whether the audio equipment has a fault in some aspect. This method is inefficient and labor-intensive. Based on this, the embodiments of the present application provide a detection method, device, electronic device and readable storage medium for audio equipment, which can execute the above process using only a program without the participation of staff, which is conducive to improving the detection efficiency of audio equipment, and is described below through embodiments.
[0026] To facilitate understanding of this embodiment, a detection method for an audio device disclosed in an embodiment of the present application is first described in detail. Figure 1 As shown, the following steps are included:
[0027] S101: In the preparation stage, the tested audio device without any fault is controlled to play a reference audio signal, so that during the process of the tested audio device without any fault playing the reference audio signal in the preparation stage, an audio signal played by the tested audio device is collected and used as a reference audio signal.
[0028] In this embodiment, the audio device refers to an audio playback device, which is physically composed of a single device or a combination of multiple devices and has the ability to amplify audio signals and play sounds. The audio device includes but is not limited to: an amplifier, a mixer, a speaker, an audio cable, etc.
[0029] Audio device failure means that a physical device in the audio device fails or is abnormal, resulting in abnormal sound playback, such as noise, distortion, no sound at a certain frequency, too loud or too soft sound, etc. Audio device non-failure means that all physical devices in the audio device are normal and not faulty.
[0030] The audio device under test refers to the audio device that needs to be tested for faults. Generally, each audio device can be tested regularly, and the audio device under test is the audio device under test.
[0031] In a possible implementation, Figure 2 As shown, the method can be applied to an independent detection device, wherein the detection device can be a handheld device. In another possible implementation, as Figure 3 As shown, the method can also be applied to a system composed of a detection device and a cloud server. Generally, the detection device is arranged near the audio device under test to collect the audio signal played by the audio device under test.
[0032] In this embodiment, it is mainly divided into two stages, the first stage is the preparation stage, and the second stage is the fault detection stage. Among them, the preparation stage can be the stage when the audio device under test has just been purchased or is ready to be put into use. The audio device under test at this stage is generally a new and unused audio device. Most of the new audio devices are audio devices that have not failed (i.e., normal). In order to further ensure that the audio device under test in the preparation stage is an audio device that has not failed, it can also be further tested by manual or other detection methods to ensure that the audio device under test in the preparation stage has not failed. The fault detection stage generally refers to the stage in which the audio device under test is regularly tested for faults after the audio device under test has been put into use for a period of time.
[0033] In the preparation stage, Figure 2 and Figure 3 As shown, the detection device sends a reference audio signal to the audio device under test, and the audio device under test plays the reference audio signal in the preparation stage after receiving the reference audio signal. During the process of the audio device under test playing the reference audio signal in the preparation stage, the detection device collects the audio signal played by the audio device under test and uses the audio signal as the reference audio signal. In other words, the reference audio signal is the audio signal played when the audio device under test is not faulty.
[0034] The reference audio signal is used as a standard audio signal. In order to better test the audio playback of the tested audio device at each frequency (or frequency band), or to detect whether the tested audio device fails at each frequency (or frequency band), the present application provides three implementation methods of the reference audio signal.
[0035] In a first possible implementation manner, the reference audio signal may be a first audio signal with a gradually increasing frequency and a continuous phase.
[0036] At this time, the relevant formula for making the reference audio signal is as follows:
[0037]
[0038] s=A0sin(2πf s t+kπt 2 )
[0039] Wherein, T is the duration of the reference audio signal, in seconds; f e 、f s are the starting frequency and ending frequency of the reference audio signal respectively; k is a calculated constant; A0 is the amplitude of the reference audio signal; t is a time variable, the minimum value of t is 0, the maximum value is T, and the unit is second; s is the finally generated sinusoidal wave signal with gradually increasing frequency, equal amplitude and continuous phase (i.e., the first audio signal).
[0040] In a second possible implementation manner, the reference audio signal may also be a second audio signal with a gradually decreasing frequency and a continuous phase.
[0041] In a third possible implementation, the reference audio signal may also be a third audio signal including multiple single-frequency signals, and different third audio signals have different frequencies; wherein, if the reference audio signal includes multiple third audio signals with a single frequency, the audio device under test plays each third audio signal separately when playing the reference audio signal, and collects the reference audio signal and the test audio signal corresponding to each third audio signal separately.
[0042] Specifically, the frequency range of sound waves that can be heard by the human ear is usually from 20HZ to 22000HZ, so the frequency range of the reference audio signal can be from 20HZ to 22000HZ. For example, the reference audio signal is a first audio signal whose frequency gradually increases from 20HZ to 22000HZ and whose phase is continuous; or, the reference audio signal is a second audio signal whose frequency gradually decreases from 22000HZ to 20HZ and whose phase is continuous; or, according to the Mel spectrum, the frequency in the frequency band from 20HZ to 22000HZ is evenly divided into several frequencies (generally divided into 20-200) and each frequency produces a single frequency sine wave signal (i.e., the third audio signal). The Mel spectrum will be more densely divided in the low and medium frequency bands, which is in line with the characteristics that the human ear is very sensitive to changes in the low and medium frequencies and not very sensitive to changes in the high frequencies. In this way, if the audio equipment has any small faults in the low frequency band, it can also be easily detected.
[0043] S102: In the fault detection phase, the audio device under test is controlled to play a reference audio signal, so that during the process of the audio device under test playing the reference audio signal in the fault detection phase, an audio signal played by the audio device under test is collected and used as a test audio signal.
[0044] In this embodiment, when the audio device under test needs to perform fault detection periodically, the time period for each fault detection is the fault detection phase of the audio device under test, that is, the audio device under test may have multiple fault detection phases.
[0045] In the fault detection stage, Figure 2 and Figure 3 As shown, the detection device sends a reference audio signal to the audio device under test, and the audio device under test plays the reference audio signal in the fault detection phase after receiving the reference audio signal. During the process of the audio device under test playing the reference audio signal in the fault detection phase, the detection device collects the audio signal emitted by the audio device under test and uses the audio signal as the test audio signal of the audio device under test.
[0046] S103: Perform audio signal feature analysis on the reference audio signal and the test audio signal, and determine whether the audio device under test fails during the fault detection phase based on the analysis results; wherein the audio signal feature analysis includes any one or more of the following analysis methods: time domain-frequency domain grid analysis, zero crossing rate analysis, loudness analysis, and spectral centroid analysis.
[0047] In this embodiment, since the reference audio signal is an audio signal broadcast when the audio device under test has no fault, and the test audio signal is an audio signal broadcast when the audio device under test needs to perform fault detection, the higher the similarity between the reference audio signal and the test audio signal, the higher the similarity between the reference audio signal and the test audio signal, which indicates that the audio device under test has no fault in the fault detection stage; if the similarity between the reference audio signal and the test audio signal is lower, which indicates that the audio device under test has fault in the fault detection stage.
[0048] In this embodiment, audio signal feature analysis may be performed on the reference audio signal and the test audio signal to determine the similarity between the reference audio signal and the test audio signal, thereby determining whether the tested audio device fails during the fault detection phase based on the similarity.
[0049] In a possible embodiment, Figure 2 As shown, when the method in this embodiment is applied to a detection device, after the detection device collects the test audio signal and the reference audio signal of the audio device under test, the detection device performs audio signal feature analysis on the reference audio signal and the test audio signal, and determines whether a fault occurs in the audio device under test during the fault detection stage based on the analysis results.
[0050] In another possible embodiment, Figure 3 As shown, when the method in this embodiment is applied to a system consisting of a detection device and a cloud server, after the detection device collects the test audio signal and the reference audio signal of the audio device under test, the test audio signal and the reference audio signal are sent to the cloud server, and the cloud server performs audio signal feature analysis on the reference audio signal and the test audio signal, and determines whether a fault occurs in the audio device under test during the fault detection stage based on the analysis results.
[0051] Next, the analysis processes of time-frequency domain grid analysis, zero-crossing rate analysis, loudness analysis and spectral centroid analysis are explained respectively.
[0052] In a possible implementation, when the audio signal feature analysis includes time domain-frequency domain grid analysis, when performing step S103 to perform audio signal feature analysis on the reference audio signal and the test audio signal, the following steps S10311-S10317 may be specifically performed:
[0053] S10311: Perform short-time Fourier transform on the reference audio signal and the test audio signal respectively to obtain a reference two-dimensional array and a test two-dimensional array; the reference two-dimensional array contains the reference signal power value corresponding to each point of the reference audio signal in the target grid; the test two-dimensional array contains the test signal power value corresponding to each point of the test audio signal in the target grid; the horizontal axis of the target grid is the signal sampling time, and the vertical axis is the signal frequency.
[0054] In this embodiment, there is a corresponding relationship between the reference audio signal, the test audio signal and the reference audio signal, and one reference audio signal corresponds to one test audio signal and one reference audio signal. Therefore, if the reference audio signal is a first audio signal with a frequency that gradually increases and a continuous phase, or a second audio signal with a frequency that gradually decreases and a continuous phase, then there is only one reference audio signal and one test audio signal. If the reference audio signal includes multiple third audio signals of a single frequency, then each third audio signal (i.e., each reference audio signal) corresponds to one test audio signal and one reference audio signal. For example, if the reference audio signal includes 20 third audio signals of a single frequency, then there are 20 test audio signals and 20 reference audio signals.
[0055] In this embodiment, if the reference audio signal is the first audio signal or the second audio signal, short-time Fourier transform and subsequent steps are directly performed on the reference audio signal and the test audio signal of the reference audio signal. If the reference audio signal includes multiple third audio signals, short-time Fourier transform and subsequent steps need to be performed on the reference audio signal and the test audio signal corresponding to each third audio signal respectively.
[0056] Next, a reference audio signal and a test audio signal corresponding to one of the reference audio signals (the reference audio signal may be the first audio signal or the second audio signal, or may be one of the third audio signals) are used for description.
[0057] Performing a short-time Fourier transform on the reference audio signal to obtain a reference two-dimensional array; and performing a short-time Fourier transform on the test audio signal to obtain a test two-dimensional array. Figure 4 As shown, the horizontal axis of the target grid is the signal sampling time, and the vertical axis is the signal frequency. Each point (x, y) in the target grid corresponds to a signal sampling time and a signal frequency. Figure 4 As shown, point a1(x a1 ,y a1 ) corresponds to the signal sampling time x a1 is 0.45 seconds, signal frequency y a1 is 2048hz.
[0058] In this embodiment, the reference two-dimensional array includes reference signal power values corresponding to each point of the reference audio signal in the target grid. Since each point in the target grid corresponds to a set of signal sampling time and signal frequency, the reference two-dimensional array includes reference signal power values corresponding to each set of signal sampling time and signal frequency. a1 ,y a1 ) corresponds to a set of signal sampling time and signal frequency (0.45 seconds, 2048 Hz), then the reference signal power value corresponding to point A actually refers to the reference signal power value when the signal sampling time in the reference audio signal is 0.45 seconds and the signal frequency is 2048 Hz.
[0059] Similarly, the test two-dimensional array contains the test signal power value corresponding to each point of the test audio signal in the target grid, wherein, since each point in the target grid corresponds to a set of signal sampling time and signal frequency, the test two-dimensional array contains the test signal power value corresponding to each set of signal sampling time and signal frequency. Exemplarily, a set of signal sampling time and signal frequency corresponding to point a2 in the target grid is (0.6 seconds, 2048 Hz), then the test signal power value corresponding to point a2 actually refers to the test signal power value when the signal sampling time in the test audio signal is 0.6 seconds and the signal frequency is 2048 Hz.
[0060] S10312: According to the preset first quantity and second quantity, the horizontal axis in the target grid is evenly divided into a first quantity and the vertical axis is evenly divided into a second quantity, so that the target grid contains a third quantity of grids; the third quantity is equal to the product of the first quantity and the second quantity.
[0061] In this embodiment, the horizontal axis of the target grid is evenly divided into a first number of parts according to a preset first number; and the vertical axis of the target grid is evenly divided into a second number of parts according to a preset second number. In this case, the target grid contains the first number multiplied by the second number (i.e., the third number) of grids. For example, Figure 4 As shown, when the first number is 20 and the second number is 20, the target grid contains 400 (third number) grids.
[0062] S10313: For each grid in the target grid, calculate the average value of the reference signal power value corresponding to each point contained in the grid to obtain the average value of the reference signal power corresponding to the grid; and calculate the average value of the test signal power value corresponding to each point contained in the grid to obtain the average value of the test signal power corresponding to the grid.
[0063] In this embodiment, after the target grid is divided into a third number of grids, each grid contains multiple points, and each point corresponds to a set of signal sampling time and signal frequency. Since each set of signal sampling time and signal frequency corresponds to a reference signal power value and a test signal power value, each point in the grid corresponds to a reference signal power value and a test signal power value.
[0064] For each grid in the target grid, determine the reference signal power value corresponding to each point contained in the grid, calculate the average value of the reference signal power value corresponding to each point contained in the grid, and obtain the average value of the reference signal power corresponding to the grid. And for each grid in the target grid, determine the test signal power value corresponding to each point contained in the grid, calculate the average value of the test signal power value corresponding to each point contained in the grid, and obtain the average value of the test signal power corresponding to the grid.
[0065] S10314: Calculate the ratio of the average power value of the test signal corresponding to the grid to the average power value of the reference signal to obtain a first change rate of the reference audio signal corresponding to the grid relative to the test audio signal.
[0066] In this embodiment, for each grid in the target grid, the ratio of the average power of the test signal corresponding to the grid to the average power of the reference signal is calculated, and the ratio is used as the first change rate of the reference audio signal corresponding to the grid relative to the test audio signal.
[0067] S10315: Determine whether the first change rate is between a first change rate upper limit threshold and a first change rate lower limit threshold corresponding to the grid.
[0068] In this embodiment, for each grid in the target grid, it is determined whether the first change rate corresponding to the grid is less than the first change rate upper limit threshold corresponding to the grid and greater than the first change rate lower limit threshold corresponding to the grid.
[0069] In this embodiment, each grid in the target grid corresponds to a respective first change rate upper limit threshold and a first change rate lower limit threshold.
[0070] S10316: If each first change rate is between the first change rate upper limit threshold and the first change rate lower limit threshold corresponding to the grid corresponding to each first change rate, it indicates that the analysis result of the time domain-frequency domain grid analysis in the fault detection stage is that the audio device under test is not faulty.
[0071] In this embodiment, when the reference audio signal is a first audio signal with a gradually increasing frequency and a continuous phase, or the reference audio signal is a second audio signal with a gradually decreasing frequency and a continuous phase, since there is only one reference audio signal, there is only one reference audio signal and one test audio signal, and there is only one target grid. Therefore, if the first change rate corresponding to each grid in the target grid is between the first change rate upper limit threshold and the first change rate lower limit threshold corresponding to the grid, it indicates that the analysis result of the time domain-frequency domain grid analysis in the fault detection stage is that the audio device under test has not failed.
[0072] In this embodiment, when the reference audio signal includes multiple third audio signals of a single frequency, since each third audio signal corresponds to a reference audio signal and a test audio signal, there are multiple reference audio signals and test audio signals, and there are multiple target grids. Specifically, the number of target grids is the same as the number of reference audio signals and test audio signals. Therefore, if the first change rate corresponding to each grid in each target grid is between the first change rate upper limit threshold and the first change rate lower limit threshold corresponding to the grid, it indicates that the analysis result of the time domain-frequency domain grid analysis in the fault detection stage is that the audio device under test has not failed.
[0073] S10317: If there is at least one first change rate that is not between the first change rate upper limit threshold and the first change rate lower limit threshold corresponding to the grid corresponding to the first change rate, it indicates that the analysis result of the time domain-frequency domain grid analysis in the fault detection stage is that the audio device under test has a fault.
[0074] In this embodiment, when the reference audio signal is a first audio signal with a gradually increasing frequency and a continuous phase, or the reference audio signal is a second audio signal with a gradually decreasing frequency and a continuous phase, there is only one target grid. At this time, if there is at least one first change rate in the target grid that is not between the first change rate upper limit threshold and the first change rate lower limit threshold corresponding to the grid, it indicates that the analysis result of the time domain-frequency domain grid analysis in the fault detection stage is that the audio device under test has a fault.
[0075] When the reference audio signal includes multiple third audio signals of a single frequency, there are multiple target grids. Since each third audio signal corresponds to its own frequency, and each third audio signal corresponds to a target grid, each target grid corresponds to its own frequency. In this embodiment, if the first change rate corresponding to at least one grid (e.g., grid A1) in at least one target grid (e.g., target grid A) is not between the first change rate upper threshold and the first change rate lower threshold corresponding to the grid (e.g., grid A1), it indicates that the analysis result of the time domain-frequency domain grid analysis in the fault detection stage is: the audio device under test has failed at the frequency corresponding to the target grid (e.g., target grid A).
[0076] In a possible implementation, when the audio signal feature analysis includes zero-crossing rate analysis, when performing step S103 to perform audio signal feature analysis on the reference audio signal and the test audio signal, the following steps S10321-S10323 may be specifically performed:
[0077] S10321: Calculate a ratio between the zero-crossing rate of the test audio signal and the zero-crossing rate of the reference audio signal, and use the ratio as a second change rate of the zero-crossing rate of the test audio signal compared to the reference audio signal.
[0078] In this embodiment, if the reference audio signal is the first audio signal or the second audio signal, there is only one reference audio signal, test audio signal, and reference audio signal. At this time, the step of calculating the ratio between the zero-crossing rate of the test audio signal and the zero-crossing rate of the reference audio signal and the subsequent steps are directly executed.
[0079] If the reference audio signal includes multiple third audio signals, it is necessary to perform the following steps on the reference audio signal and the test audio signal corresponding to each third audio signal respectively: calculating the ratio between the zero-crossing rate of the test audio signal corresponding to the third audio signal and the zero-crossing rate of the reference audio signal and subsequent steps.
[0080] Next, a reference audio signal and a test audio signal corresponding to a reference audio signal (the reference audio signal may be the first audio signal or the second audio signal, or one of the third audio signals) are described.
[0081] In this embodiment, the zero-crossing rate of the test audio signal is calculated by the following formula:
[0082]
[0083] Wherein, v1 is the zero-crossing rate of the test audio signal; N is the number of signal sampling points; and x[n] is the test audio signal.
[0084] The zero-crossing rate of the reference audio signal is calculated by the following formula:
[0085]
[0086] Wherein, v2 is the zero-crossing rate of the reference audio signal; y[n] is the reference audio signal.
[0087]
[0088] Wherein, V represents a second change rate of the zero-crossing rate of the test audio signal compared to the reference audio signal.
[0089] S10322: When the second change rate is between the second change rate upper limit threshold and the second change rate lower limit threshold, it indicates that the analysis result of the zero-crossing rate analysis in the fault detection stage is that the audio device under test has not failed.
[0090] In this embodiment, when the reference audio signal is the first audio signal or the second audio signal, since there is only one reference audio signal, there is also only one reference audio signal and one test audio signal. Therefore, if the second change rate is between the second change rate upper limit threshold and the second change rate lower limit threshold, it indicates that the analysis result of the zero-crossing rate analysis in the fault detection stage is that the audio device under test has not failed.
[0091] When the reference audio signal includes multiple third audio signals of a single frequency, since each third audio signal corresponds to a reference audio signal and a test audio signal, there are also multiple reference audio signals and test audio signals. Therefore, if the second change rate corresponding to each pair of reference audio signals and test audio signals is respectively between the second change rate upper limit threshold and the second change rate lower limit threshold corresponding to each pair of reference audio signals and test audio signals, it indicates that the analysis result of the zero-crossing rate analysis in the fault detection stage is that the audio device under test has not failed. In other words, if the second change rate corresponding to each third audio signal is respectively between the second change rate upper limit threshold and the second change rate lower limit threshold corresponding to each third audio signal, it indicates that the analysis result of the zero-crossing rate analysis in the fault detection stage is that the audio device under test has not failed.
[0092] S10323: When the second change rate is not between the second change rate upper limit threshold and the second change rate lower limit threshold, it indicates that the analysis result of the zero-crossing rate analysis in the fault detection phase is that the audio device under test fails.
[0093] Similarly, when the reference audio signal is the first audio signal or the second audio signal, there is only one second change rate. Therefore, if the second change rate is not between the second change rate upper limit threshold and the second change rate lower limit threshold, it indicates that the analysis result of the zero-crossing rate analysis in the fault detection stage is that the audio device under test has a fault.
[0094] When the reference audio signal includes multiple third audio signals of a single frequency, there are multiple second change rates, that is, each third audio signal corresponds to a second change rate. Therefore, if there is at least one second change rate corresponding to a third audio signal that is not between the second change rate upper limit threshold and the second change rate lower limit threshold corresponding to the third audio signal, it indicates that the analysis result of the zero-crossing rate analysis in the fault detection stage is that the audio device under test has a fault at the frequency corresponding to the third audio signal.
[0095] In a possible implementation, when the audio signal feature analysis includes loudness analysis, when performing step S103 to perform audio signal feature analysis on the reference audio signal and the test audio signal, the following steps S10331-S10334 may be specifically performed:
[0096] S10331: Calculate a root mean square value for representing the loudness of the test audio signal, and calculate a root mean square value for representing the loudness of the reference audio signal; wherein there is a positive correlation between the loudness and the root mean square value.
[0097] In this embodiment, the size of the loudness is reflected by the size of the root mean square value, wherein the larger the root mean square value, the greater the loudness, and the smaller the root mean square value, the smaller the loudness.
[0098] In this embodiment, if the reference audio signal is the first audio signal or the second audio signal, there is only one reference audio signal, test audio signal, and reference audio signal, and at this time, directly performing the steps of calculating the root mean square value for indicating the loudness of the test audio signal, calculating the root mean square value for indicating the loudness of the reference audio signal, and calculating the subsequent steps. If the reference audio signal includes a plurality of third audio signals, at this time, it is necessary to respectively perform the steps of calculating the root mean square value for indicating the loudness of the test audio signal, calculating the root mean square value for indicating the loudness of the reference audio signal, and calculating the subsequent steps for the reference audio signal and the test audio signal corresponding to each third audio signal.
[0099] Next, a reference audio signal and a test audio signal corresponding to a reference audio signal (the reference audio signal may be the first audio signal or the second audio signal, or one of the third audio signals) are described.
[0100] In this embodiment, the root mean square value g1 of the test audio signal and the root mean square value g2 of the reference audio signal are calculated by the following formula:
[0101]
[0102] S10332: Calculate a ratio of a root mean square value of the test audio signal to a root mean square value of the reference audio signal, and use the ratio as a third change rate of the loudness of the test audio signal compared to the reference audio signal.
[0103]
[0104] Wherein, G is a third change rate of the loudness of the test audio signal compared to the reference audio signal.
[0105] S10333: When the third change rate is between the third change rate upper limit threshold and the third change rate lower limit threshold, it indicates that the analysis result of the loudness analysis in the fault detection stage is that the audio device under test is not faulty.
[0106] In this embodiment, when the reference audio signal is the first audio signal or the second audio signal, since there is only one reference audio signal, there is only one reference audio signal and one test audio signal, and there is only one third change rate. Therefore, if the third change rate is between the third change rate upper limit threshold and the third change rate lower limit threshold, it indicates that the analysis result of the loudness analysis in the fault detection stage is that the audio device under test is not faulty.
[0107] When the reference audio signal includes a plurality of third audio signals of a single frequency, since each third audio signal corresponds to a reference audio signal and a test audio signal, there are also a plurality of reference audio signals and a plurality of test audio signals, and a plurality of third change rates. Therefore, only when the third change rate corresponding to each third audio signal is respectively between the third change rate upper limit threshold and the third change rate lower limit threshold corresponding to each third audio signal, does it indicate that the analysis result of the loudness analysis in the fault detection stage is that the audio device under test is not faulty.
[0108] S10334: When the third change rate is not between the third change rate upper limit threshold and the third change rate lower limit threshold, it indicates that the analysis result of the loudness analysis in the fault detection stage is that the audio device under test fails.
[0109] In this embodiment, when the reference audio signal is the first audio signal or the second audio signal, since there is only one third change rate, when the third change rate is not between the third change rate upper limit threshold and the third change rate lower limit threshold, it indicates that the analysis result of the loudness analysis in the fault detection stage is that the audio device under test has a fault.
[0110] When the reference audio signal includes a plurality of third audio signals of a single frequency, since there are also a plurality of third change rates, if there is at least one third audio signal corresponding to a third change rate that is not between the third change rate upper limit threshold and the third change rate lower limit threshold corresponding to the third audio signal, it indicates that the analysis result of the loudness analysis in the fault detection stage is that the audio device under test has a fault at the frequency corresponding to the third audio signal.
[0111] In a possible implementation, when the audio signal feature analysis includes spectral centroid analysis, when performing the step of performing audio signal feature analysis on the reference audio signal and the test audio signal, the following steps S10341-S10346 may be specifically performed:
[0112] S10341: Perform Fourier transform on the test audio signal and the reference audio signal respectively to obtain a first spectrum of the test audio signal and a second spectrum of the reference audio signal.
[0113] In this embodiment, a reference audio signal and a test audio signal corresponding to a reference audio signal (the reference audio signal may be the first audio signal or the second audio signal, or one of the third audio signals) are used for description.
[0114] A test audio signal corresponding to the reference audio signal is Fourier transformed to obtain a first frequency spectrum of the test audio signal; and a reference audio signal corresponding to the reference audio signal is Fourier transformed to obtain a second frequency spectrum of the reference audio signal.
[0115] S10342: Calculate the first amplitude of the first spectrum and the second amplitude of the second spectrum.
[0116] S10343: Calculate the spectral centroid of the test audio signal according to the first amplitude, and calculate the spectral centroid of the reference audio signal according to the second amplitude.
[0117] In this embodiment, the spectral centroid of the test audio signal is calculated by the following formula:
[0118]
[0119] Wherein, h1 represents the spectral centroid of the test audio signal; j is the frequency index; M1 is the length of the first spectrum; and f1[j] is the first amplitude at the frequency index j.
[0120] The spectral centroid of the reference audio signal is calculated by the following formula:
[0121]
[0122] Wherein, h2 represents the spectral centroid of the reference audio signal; M2 is the length of the second spectrum; and f2[j] is the second amplitude at frequency index j.
[0123] S10344: Calculate the ratio of the spectral centroid of the test audio signal to the spectral centroid of the reference audio signal, and use the ratio as a fourth change rate of the test audio signal compared to the reference audio signal.
[0124] S10345: When the fourth change rate is between the fourth change rate upper limit threshold and the fourth change rate lower limit threshold, it indicates that the analysis result of the spectrum centroid analysis in the fault detection stage is that the audio device under test is not faulty.
[0125] In this embodiment, when the reference audio signal is the first audio signal or the second audio signal, since there is only one reference audio signal, there is only one reference audio signal and one test audio signal, and there is only one fourth change rate. Therefore, when the fourth change rate is between the fourth change rate upper limit threshold and the fourth change rate lower limit threshold, it indicates that the analysis result of the spectral centroid analysis in the fault detection stage is that the audio device under test has not failed.
[0126] When the reference audio signal includes multiple third audio signals of a single frequency, since each third audio signal corresponds to a reference audio signal and a test audio signal, there are multiple reference audio signals and test audio signals, and there are multiple fourth change rates. Therefore, only when the fourth change rate corresponding to each third audio signal is respectively between the fourth change rate upper limit threshold and the fourth change rate lower limit threshold corresponding to each third audio signal, it indicates that the analysis result of the spectral centroid analysis in the fault detection stage is that the audio device under test has not failed.
[0127] S10346: When the fourth change rate is not between the fourth change rate upper limit threshold and the fourth change rate lower limit threshold, it indicates that the analysis result of the spectral centroid analysis in the fault detection stage is that the audio device under test fails.
[0128] In this embodiment, when the reference audio signal is the first audio signal or the second audio signal, since there is only one fourth change rate, when the fourth change rate is not between the fourth change rate upper limit threshold and the fourth change rate lower limit threshold, it indicates that the analysis result of the spectral centroid analysis in the fault detection stage is that a fault has occurred in the audio device under test.
[0129] When the reference audio signal includes a plurality of third audio signals of a single frequency, since there are also a plurality of fourth change rates, if there is at least one third audio signal corresponding to a fourth change rate that is not between the fourth change rate upper limit threshold and the fourth change rate lower limit threshold corresponding to the third audio signal, then the analysis result of the spectrum centroid analysis in the fault detection stage indicates that the audio device under test has a fault at the frequency corresponding to the third audio signal.
[0130] In a possible implementation manner, when executing step S103 to determine whether the audio device under test fails in the fault detection phase according to the analysis result, the following steps S10351-S10352 may be specifically performed:
[0131] S10351: When the analysis results of each analysis method included in the audio signal feature analysis are all that no fault has occurred, it is determined that the detection result of the audio device under test in the fault detection phase is that no fault has occurred.
[0132] Exemplarily, when the analysis methods included in the audio signal feature analysis are time domain-frequency domain grid analysis, zero crossing rate analysis, loudness analysis, and spectral centroid analysis, then, if in the fault detection stage, the analysis result of the time domain-frequency domain grid analysis is that the audio device under test has not failed, the analysis result of the zero crossing rate analysis is that the audio device under test has not failed, the analysis result of the loudness analysis is that the audio device under test has not failed, and the analysis result of the spectral centroid analysis is that the audio device under test has not failed, then it is characterized that the detection result of the audio device under test in the fault detection stage is that no fault has occurred, and no fault has occurred means that the audio device under test is normal.
[0133] S10352: When the analysis result of at least one analysis method included in the audio signal feature analysis is that a fault occurs, it is determined that the detection result of the audio device under test in the fault detection phase is that a fault occurs.
[0134] In this embodiment, when the analysis methods included in the audio signal feature analysis are time domain-frequency domain grid analysis, zero crossing rate analysis, loudness analysis, and spectral centroid analysis, then in the fault detection stage, as long as the analysis results of one or more analysis methods are that a fault has occurred, it is determined that the detection result of the audio line device under test in the fault detection stage is that a fault has occurred, and the occurrence of a fault means that the audio device under test is abnormal.
[0135] Exemplarily, when the reference audio signal includes multiple third audio signals, if in the fault detection stage, the analysis result of the spectral centroid analysis is that the audio device under test fails at the frequency corresponding to one of the third audio signals, but does not fail at the frequencies corresponding to other third audio signals, and the analysis results of the time domain-frequency domain grid analysis, the zero crossing rate analysis, and the loudness analysis are also that no fault has occurred, then it can be determined that the detection result of the audio line device under test in the fault detection stage is that a fault has occurred.
[0136] In a possible implementation manner, after executing step S103, the following steps S1041-S1043 may also be performed:
[0137] S1041: When the detection result of the audio device under test is that a failure occurs, re-test the audio device under test at least once.
[0138] In this embodiment, during the fault detection stage, if the detection result of the audio device under test is that a fault has occurred, in order to avoid the problem that the collected test audio signal contains noise from the environment in which the audio device under test is located, thereby causing a misjudgment of the detection result, this embodiment can re-check the audio device under test once or multiple times.
[0139] S1042: During the retesting stage of the audio device under test, the audio device under test is controlled to play a reference audio signal, so that during the process of the audio device under test playing the reference audio signal during the retesting stage, an audio signal played by the audio device under test is collected and used as a retesting audio signal.
[0140] S1043: Perform audio signal feature analysis on the reference audio signal and the re-test audio signal, and determine whether the audio device under test has a fault based on the analysis result; wherein, during the re-test stage, if there is at least one re-test result that shows that the audio device under test has not a fault, the test result of the audio device under test is determined to be no fault.
[0141] In this embodiment, the process of performing audio signal feature analysis on the reference audio signal and the re-test audio signal is the same as the process of performing audio signal feature analysis on the reference audio signal and the test audio signal. For details, please refer to the aforementioned description of performing audio signal feature analysis on the reference audio signal and the test audio signal, and this application will not repeat this description.
[0142] During the retest phase, if each retest result shows that the audio device under test has failed, the final test result of the audio device under test is determined to be failed. As long as there is one retest result showing that the audio device under test has not failed, the final test result of the audio device under test can be determined to be not failed.
[0143] In a possible implementation, considering that the environment in which the audio device under test is located generally has a certain amount of noise, there will generally be a certain amount of noise in the test audio signal collected in the fault detection stage, so even if the audio device under test does not fail, there will be some differences between the test audio signal and the reference audio signal, and this situation cannot be considered as a failure of the audio device under test. Therefore, the values of the upper threshold value of the rate of change (the upper threshold value of the rate of change includes the first upper threshold value of the rate of change, the second upper threshold value of the rate of change, the third upper threshold value of the rate of change and the fourth upper threshold value of the rate of change) and the lower threshold value of the rate of change (the lower threshold value of the rate of change includes the first lower threshold value of the rate of change, the second lower threshold value of the rate of change, the third lower threshold value of the rate of change and the fourth lower threshold value of the rate of change) in the aforementioned embodiment are very important. If the range between the upper threshold value of the rate of change and the lower threshold value of the rate of change is too narrow, it will cause the reaction to be too sensitive and prone to false alarm faults. If the range between the upper threshold value of the rate of change and the lower threshold value of the rate of change is too large, it is easy to miss or fail to report a fault. Based on this, the present application provides two ways: to determine the upper threshold value of the rate of change and the lower threshold value of the rate of change in the aforementioned embodiment.
[0144] In the first determination method, before executing step S102, the change rate upper limit threshold and the change rate lower limit threshold of each analysis method in the audio signal feature analysis can also be determined according to the following steps S1001-S1003:
[0145] S1001: In the preparation stage, the tested audio device that has not failed is controlled to play the reference audio signal multiple times, so that during each time when the tested audio device that has not failed plays the reference audio signal in the preparation stage, the audio signal played by the tested audio device is collected and used as the positive sample audio signal.
[0146] In this embodiment, in the preparation stage, when the audio device under test is normal (i.e., no failure occurs), the handheld device sends a reference audio signal to the audio device under test, and the audio device under test repeatedly plays the reference audio signal multiple times. During each time when the audio device under test plays the reference audio signal, the audio signal played by the audio device under test is collected respectively, and the audio signal played each time is used as a candidate positive sample audio signal.
[0147] In order to prevent the candidate positive sample audio signal from being mixed with environmental noise, such as the sound of closing a door, the sound of speaking, etc. In this embodiment, whether the candidate positive sample audio signal is mixed with environmental noise can be detected by audition, and the candidate positive sample audio signal without the environmental noise is used as the final positive sample audio signal. The audition method can be sampling audition or traversal audition.
[0148] S1002: For each analysis method included in the audio signal feature analysis, each positive sample audio signal and the reference audio signal are analyzed respectively using the analysis method to obtain a positive sample analysis result for each positive sample audio signal.
[0149] S1003: Determine an upper threshold value and a lower threshold value of the change rate of the analysis method according to the positive sample analysis result.
[0150] For the time domain-frequency domain grid analysis, when executing step S1002, specifically:
[0151] For each positive sample audio signal, short-time Fourier transform is performed on the positive sample audio signal and the reference audio signal to obtain a positive sample two-dimensional array and a reference two-dimensional array; wherein the reference two-dimensional array contains the reference signal power value corresponding to each point of the reference audio signal in the target network; and the positive sample two-dimensional array contains the positive sample signal power value corresponding to each point of the positive sample audio signal in the target grid.
[0152] According to the preset first quantity and second quantity, the horizontal axis in the target grid is evenly divided into the first quantity and the vertical axis is evenly divided into the second quantity, so that the target grid contains a third quantity of grids; the third quantity is equal to the product of the first quantity and the second quantity.
[0153] For each grid in the target grid, the average value of the reference signal power value corresponding to each point contained in the grid is calculated to obtain the average value of the reference signal power corresponding to the grid; and the average value of the positive sample signal power value corresponding to each point contained in the grid is calculated to obtain the average value of the positive sample signal power corresponding to the grid.
[0154] The ratio of the average power value of the positive sample signal corresponding to the grid to the average power value of the reference signal is calculated to obtain the first positive sample change rate of the reference audio signal corresponding to the grid relative to the positive sample audio signal. At this time, the positive sample analysis result of each positive sample audio signal corresponding to the grid refers to the first positive sample change rate of the reference audio signal corresponding to the grid relative to each positive sample audio signal.
[0155] For each grid in the target grid, after calculating the first positive sample change rate of the reference audio signal corresponding to the grid relative to each positive sample audio signal through the above process, when executing step S1003, specifically:
[0156] The minimum value among all the first positive sample change rates corresponding to the grid is determined as the change rate lower limit threshold corresponding to the time domain-frequency domain grid analysis analysis method, that is, the first change rate lower limit threshold. The maximum value among all the first positive sample change rates corresponding to the grid is determined as the change rate upper limit threshold corresponding to the time domain-frequency domain grid analysis analysis method, that is, the first change rate upper limit threshold.
[0157] Regarding the zero-crossing rate analysis method, when executing step S1002, specifically:
[0158] For each positive sample audio signal, the ratio between the zero crossing rate of the positive sample audio signal and the zero crossing rate of the reference audio signal is calculated, and the ratio is used as the second positive sample conversion rate of the zero crossing rate of the positive sample audio signal compared to the reference audio signal. At this time, the positive sample analysis result of each positive sample audio signal refers to the second positive sample conversion rate of the zero crossing rate of each positive sample audio signal compared to the reference audio signal.
[0159] After obtaining the second positive sample change rate corresponding to each positive sample audio signal, when executing step S1003, specifically:
[0160] The minimum value among all the second positive sample change rates is determined as the change rate lower limit threshold of the zero-crossing rate analysis analysis method, that is, the second change rate lower limit threshold. The maximum value among all the second positive sample change rates is determined as the change rate upper limit threshold of the zero-crossing rate analysis analysis method, that is, the second change rate upper limit threshold.
[0161] Regarding the loudness analysis method, when executing step S1002, specifically:
[0162] A root mean square value for representing the loudness of the reference audio signal is calculated. And for each positive sample audio signal, a root mean square value for representing the loudness of the positive sample audio signal is calculated.
[0163] The ratio of the root mean square value of the positive sample audio signal to the root mean square value of the reference audio signal is calculated, and the ratio is used as the third positive sample change rate of the loudness of the positive sample audio signal compared to the reference audio signal. At this time, the positive sample analysis result of each positive sample audio signal refers to the third positive sample change rate of the loudness of each positive sample audio signal compared to the reference audio signal.
[0164] After obtaining the third positive sample change rate corresponding to each positive sample audio signal, when executing step S1003, specifically:
[0165] The minimum value among all the third positive sample change rates is determined as the change rate lower limit threshold of the loudness analysis analysis mode, that is, the third change rate lower limit threshold. The maximum value among all the third positive sample change rates is determined as the change rate upper limit threshold of the loudness analysis analysis mode, that is, the third change rate upper limit threshold.
[0166] For the analysis method of spectrum centroid analysis, when executing step S1002, specifically:
[0167] Performing Fourier transform on the reference audio signal to obtain a second frequency spectrum of the reference audio signal; and performing Fourier transform on each positive sample audio signal to obtain a third frequency spectrum of the positive sample audio signal.
[0168] The second amplitude of the second spectrum is calculated, and the spectral centroid of the reference audio signal is calculated according to the second amplitude. And for each positive sample audio signal's third spectrum, the third amplitude of the third spectrum is calculated, and the spectral centroid of the positive sample audio signal is calculated according to the third amplitude.
[0169] The ratio of the spectral centroid of the positive sample audio signal to the spectral centroid of the reference audio signal is calculated, and the ratio is used as the fourth positive sample change rate of the positive sample audio signal compared to the reference audio signal. At this time, the positive sample analysis result of each positive sample audio signal refers to the fourth positive sample change rate of each positive sample audio signal compared to the reference audio signal.
[0170] After obtaining the fourth positive sample change rate corresponding to each positive sample audio signal, when executing step S1003, specifically:
[0171] The minimum value among all the fourth positive sample change rates is used as the change rate lower limit threshold of the spectrum centroid analysis analysis method, that is, the fourth change rate lower limit threshold. The maximum value among all the fourth positive sample change rates is used as the change rate upper limit threshold of the spectrum centroid analysis analysis method, that is, the fourth change rate upper limit threshold.
[0172] In the second determination method, in order to improve the accuracy of the upper and lower thresholds of the change rate corresponding to each analysis method, before executing step S102, the following steps S1004-S1006 may be performed:
[0173] S1004: In the preparation stage, the audio device under test is debugged to simulate a failure of the audio device under test.
[0174] In this embodiment, the audio device under test is debugged to simulate a fault environment (for example, deliberately lowering / raising the volume, causing a certain frequency band to lose signal amplification capability, etc., and considering this as the critical point at which the audio device under test fails).
[0175] S1005: Control the tested audio device simulating a fault to play the reference audio signal multiple times, so that during each playback of the reference audio signal by the tested audio device simulating a fault in the preparation phase, the audio signal played by the tested audio device is collected and used as a negative sample audio signal.
[0176] In this embodiment, in the preparation stage, during each playback of the reference audio signal by the simulated faulty audio device under test, the handheld device collects the audio signal played each time and uses each audio signal played as a negative sample audio signal.
[0177] S1006: For each analysis method included in the audio signal feature analysis, use the analysis method to analyze each negative sample audio signal and the reference audio signal respectively to obtain a negative sample analysis result for each negative sample audio signal.
[0178] When executing step S1003 to determine the upper threshold value and the lower threshold value of the change rate of the analysis method according to the positive sample analysis result, the following steps may be specifically performed:
[0179] According to the positive sample analysis results, the initial change rate upper limit threshold and the initial change rate lower limit threshold of the analysis method are determined; according to the negative sample analysis results, the initial change rate upper limit threshold and the initial change rate lower limit threshold of the analysis method are adjusted to obtain the change rate upper limit threshold and the change rate lower limit threshold of the analysis method.
[0180] For the time domain-frequency domain grid analysis, when executing step S1006, specifically:
[0181] For each negative sample audio signal, a short-time Fourier transform is performed on the negative sample audio signal to obtain a negative sample two-dimensional array; wherein the negative sample two-dimensional array contains the negative sample signal power value corresponding to each point of the negative sample audio signal in the target grid.
[0182] For each grid in the target grid, the average value of the negative sample signal power corresponding to each point contained in the grid is calculated to obtain the average value of the negative sample signal power corresponding to the grid.
[0183] The ratio of the average power value of the negative sample signal corresponding to the grid to the average power value of the reference signal is calculated to obtain the first negative sample change rate of the reference audio signal corresponding to the grid relative to the negative sample audio signal. At this time, the negative sample analysis result of each negative sample audio signal corresponding to the grid refers to the first negative sample change rate of the reference audio signal corresponding to the grid relative to each negative sample audio signal.
[0184] For each grid in the target grid, after calculating the first negative sample change rate of the reference audio signal corresponding to the grid relative to each negative sample audio signal through the above process, when executing step S1003, specifically:
[0185] The minimum value among all the first positive sample change rates corresponding to the grid is determined as the initial change rate lower limit threshold corresponding to the time domain-frequency domain grid analysis analysis method. The maximum value among all the first positive sample change rates corresponding to the grid is determined as the initial change rate upper limit threshold corresponding to the time domain-frequency domain grid analysis analysis method.
[0186] Determine the minimum value of all the first negative sample change rates corresponding to the grid, and judge whether the minimum value of all the first negative sample change rates is less than the initial change rate lower limit threshold corresponding to the grid. If it is less than, determine the minimum value of all the first negative sample change rates as the change rate lower limit threshold corresponding to the grid in the time domain-frequency domain grid analysis analysis method, that is, the first change rate lower limit threshold. If it is not less than, determine the initial change rate lower limit threshold corresponding to the grid as the change rate lower limit threshold corresponding to the grid in the time domain-frequency domain grid analysis analysis method, that is, the first change rate lower limit threshold.
[0187] Determine the maximum value of all first negative sample change rates corresponding to the grid, and judge whether the maximum value of all first negative sample change rates is greater than the initial change rate upper limit threshold corresponding to the grid. If greater than, determine the maximum value of all first negative sample change rates as the change rate upper limit threshold corresponding to the grid in the time domain-frequency domain grid analysis analysis method, that is, the first change rate upper limit threshold. If not greater than, determine the initial change rate upper limit threshold corresponding to the grid as the change rate upper limit threshold corresponding to the grid in the time domain-frequency domain grid analysis analysis method, that is, the first change rate upper limit threshold.
[0188] Regarding the zero-crossing rate analysis method, when executing step S1006, specifically:
[0189] For each negative sample audio signal, a ratio between the zero crossing rate of the negative sample audio signal and the zero crossing rate of the reference audio signal is calculated, and the ratio is used as a second negative sample conversion rate of the zero crossing rate of the negative sample audio signal compared to the reference audio signal. At this time, the negative sample analysis result of each negative sample audio signal refers to the second negative sample conversion rate of the zero crossing rate of each negative sample audio signal compared to the reference audio signal.
[0190] After obtaining the second negative sample change rate corresponding to each negative sample audio signal, when executing step S1003, specifically:
[0191] The minimum value among all the second positive sample change rates is determined as the initial change rate lower limit threshold of the zero-crossing rate analysis method. The maximum value among all the second positive sample change rates is determined as the initial change rate upper limit threshold of the zero-crossing rate analysis method.
[0192] Determine the minimum value of all the second negative sample change rates, and judge whether the minimum value of all the second negative sample change rates is less than the initial change rate lower limit threshold of the zero-crossing rate analysis method. If it is less than, determine the minimum value of all the second negative sample change rates as the change rate lower limit threshold of the zero-crossing rate analysis method, that is, the second change rate lower limit threshold. If it is not less than, determine the initial change rate lower limit threshold of the zero-crossing rate analysis method as the change rate lower limit threshold of the zero-crossing rate analysis method, that is, the second change rate lower limit threshold.
[0193] Determine the maximum value of all the second negative sample change rates, and judge whether the maximum value of all the second negative sample change rates is greater than the initial change rate upper limit threshold of the zero-crossing rate analysis method. If greater than, determine the maximum value of all the second negative sample change rates as the change rate upper limit threshold of the zero-crossing rate analysis method, that is, the second change rate upper limit threshold. If not greater than, determine the initial change rate upper limit threshold of the zero-crossing rate analysis method as the change rate upper limit threshold of the zero-crossing rate analysis method, that is, the second change rate upper limit threshold.
[0194] Regarding the loudness analysis method, when executing step S1006, specifically:
[0195] For each negative sample audio signal, a root mean square value representing the loudness of the negative sample audio signal is calculated.
[0196] The ratio of the root mean square value of the negative sample audio signal to the root mean square value of the reference audio signal is calculated, and the ratio is used as the third negative sample change rate of the loudness of the negative sample audio signal compared to the reference audio signal. At this time, the negative sample analysis result of each negative sample audio signal refers to the third negative sample change rate of the loudness of each negative sample audio signal compared to the reference audio signal.
[0197] After obtaining the third negative sample change rate corresponding to each negative sample audio signal, when executing step S1003, specifically:
[0198] The minimum value among all the third positive sample change rates is determined as the initial change rate lower limit threshold of the loudness analysis analysis mode. The maximum value among all the third positive sample change rates is determined as the initial change rate upper limit threshold of the loudness analysis analysis mode.
[0199] The maximum value among all the third negative sample change rates is determined, and it is judged whether the maximum value among all the third negative sample change rates is greater than the initial change rate upper limit threshold of the loudness analysis analysis mode. If it is greater than, the maximum value among all the third negative sample change rates is determined as the change rate upper limit threshold of the loudness analysis analysis mode, that is, the third change rate upper limit threshold. If it is not greater than, the initial change rate upper limit threshold of the loudness analysis analysis mode is determined as the change rate upper limit threshold of the loudness analysis analysis mode, that is, the third change rate upper limit threshold.
[0200] The minimum value among all the third negative sample change rates is determined, and it is determined whether the minimum value among all the third negative sample change rates is less than the initial change rate lower limit threshold of the loudness analysis analysis mode. If it is less than, the minimum value among all the third negative sample change rates is determined as the change rate lower limit threshold of the loudness analysis analysis mode, that is, the third change rate lower limit threshold. If it is not less than, the initial change rate lower limit threshold of the loudness analysis analysis mode is determined as the change rate lower limit threshold of the loudness analysis analysis mode, that is, the third change rate lower limit threshold.
[0201] For the analysis method of spectrum centroid analysis, when executing step S1006, specifically:
[0202] For each negative sample audio signal, Fourier transform is performed on the negative sample audio signal to obtain a third frequency spectrum of the negative sample audio signal.
[0203] A third amplitude of the third spectrum is calculated, and a spectral centroid of the negative sample audio signal is calculated according to the third amplitude.
[0204] The ratio of the spectral centroid of the negative sample audio signal to the spectral centroid of the reference audio signal is calculated, and the ratio is used as the fourth negative sample change rate of the negative sample audio signal compared to the reference audio signal. At this time, the negative sample analysis result of each negative sample audio signal refers to the fourth negative sample change rate of each negative sample audio signal compared to the reference audio signal.
[0205] After obtaining the fourth negative sample change rate corresponding to each negative sample audio signal, when executing step S1003, specifically:
[0206] The minimum value among all the fourth positive sample change rates is used as the initial change rate lower limit threshold of the spectrum centroid analysis analysis method. The maximum value among all the fourth positive sample change rates is used as the initial change rate upper limit threshold of the spectrum centroid analysis analysis method.
[0207] Determine the minimum value of all the fourth negative sample change rates, and judge whether the minimum value of all the fourth negative sample change rates is less than the initial change rate lower limit threshold of the spectral centroid analysis analysis method. If it is less than, determine the minimum value of all the fourth negative sample change rates as the change rate lower limit threshold of the spectral centroid analysis analysis method, that is, the fourth change rate lower limit threshold. If it is not less than, determine the initial change rate lower limit threshold of the spectral centroid analysis analysis method as the change rate lower limit threshold of the spectral centroid analysis analysis method, that is, the fourth change rate lower limit threshold.
[0208] Determine the maximum value among all the fourth negative sample change rates, and judge whether the maximum value among all the fourth negative sample change rates is greater than the initial change rate upper limit threshold of the spectral centroid analysis analysis method. If greater than, determine the maximum value among all the fourth negative sample change rates as the change rate upper limit threshold of the spectral centroid analysis analysis method, that is, the fourth change rate upper limit threshold. If not greater than, determine the initial change rate upper limit threshold of the spectral centroid analysis analysis method as the change rate upper limit threshold of the spectral centroid analysis analysis method, that is, the fourth change rate upper limit threshold.
[0209] Based on the same technical concept, the present application also provides a detection device for an audio device. Figure 5 A schematic diagram of the structure of a detection device for an audio device provided in an embodiment of the present application is shown. Figure 5 As shown, the device comprises:
[0210] The first control module 501 is used to control the tested audio device that has not failed to play the reference audio signal in the preparation stage, so as to collect the audio signal played by the tested audio device during the process of the tested audio device that has not failed to play the reference audio signal in the preparation stage, and use the audio signal as the reference audio signal;
[0211] A second control module 502 is used to control the audio device under test to play the reference audio signal during the fault detection phase, so as to collect the audio signal played by the audio device under test during the process of the audio device under test playing the reference audio signal during the fault detection phase, and use the audio signal as the test audio signal;
[0212] The first analysis module 503 is used to perform audio signal feature analysis on the reference audio signal and the test audio signal, and determine whether the audio device under test fails during the fault detection phase based on the analysis results; wherein the audio signal feature analysis includes any one or more of the following analysis methods: time domain-frequency domain grid analysis, zero crossing rate analysis, loudness analysis, and spectral centroid analysis.
[0213] Optionally, the reference audio signal is a first audio signal with a gradually increasing frequency and a continuous phase;
[0214] or,
[0215] The reference audio signal is a second audio signal with a gradually decreasing frequency and a continuous phase;
[0216] or,
[0217] The reference audio signal includes multiple third audio signals of a single frequency, and different third audio signals have different frequencies; wherein, if the reference audio signal includes multiple third audio signals of a single frequency, then when the audio device under test plays the reference audio signal, it plays each of the third audio signals separately, and collects the reference audio signal and the test audio signal corresponding to each of the third audio signals separately.
[0218] Optionally, when the audio signal feature analysis includes time domain-frequency domain grid analysis, the first analysis module 503, when used to perform audio signal feature analysis on the reference audio signal and the test audio signal, is specifically used to:
[0219] Performing short-time Fourier transform on the reference audio signal and the test audio signal respectively to obtain a reference two-dimensional array and a test two-dimensional array; the reference two-dimensional array contains the reference signal power value corresponding to each point of the reference audio signal in the target grid; the test two-dimensional array contains the test signal power value corresponding to each point of the test audio signal in the target grid; the horizontal axis of the target grid is the signal sampling time, and the vertical axis is the signal frequency;
[0220] According to the preset first number and second number, the horizontal axis in the target grid is evenly divided into the first number of parts and the vertical axis is evenly divided into the second number of parts, so that the target grid contains a third number of grids; the third number is equal to the product of the first number and the second number;
[0221] For each of the grids in the target grid, the average value of the reference signal power value corresponding to each point contained in the grid is calculated to obtain the average value of the reference signal power corresponding to the grid; and the average value of the test signal power value corresponding to each point contained in the grid is calculated to obtain the average value of the test signal power corresponding to the grid;
[0222] Calculating a ratio of an average power value of the test signal corresponding to the grid to an average power value of the reference signal to obtain a first change rate of the reference audio signal corresponding to the grid relative to the test audio signal;
[0223] Determine whether the first change rate is between a first change rate upper limit threshold and a first change rate lower limit threshold corresponding to the grid;
[0224] If each of the first change rates is between the first change rate upper limit threshold and the first change rate lower limit threshold corresponding to the grid corresponding to each of the first change rates, it indicates that the analysis result of the time domain-frequency domain grid analysis in the fault detection stage is that the audio device under test has not failed;
[0225] If there is at least one of the first change rates that is not between the first change rate upper limit threshold and the first change rate lower limit threshold corresponding to the grid corresponding to the first change rate, it indicates that the analysis result of the time domain-frequency domain grid analysis in the fault detection stage is that the audio device under test has a fault.
[0226] Optionally, when the audio signal feature analysis includes zero-crossing rate analysis, the first analysis module 503, when used to perform audio signal feature analysis on the reference audio signal and the test audio signal, is specifically used to:
[0227] Calculating a ratio between the zero-crossing rate of the test audio signal and the zero-crossing rate of the reference audio signal, and using the ratio as a second change rate of the zero-crossing rate of the test audio signal compared to the reference audio signal;
[0228] When the second change rate is between the second change rate upper limit threshold and the second change rate lower limit threshold, it indicates that the analysis result of the zero-crossing rate analysis in the fault detection stage is that the audio device under test has no fault;
[0229] When the second change rate is not between the second change rate upper limit threshold and the second change rate lower limit threshold, it indicates that the analysis result of the zero-crossing rate analysis in the fault detection stage is that the audio device under test fails.
[0230] Optionally, when the audio signal feature analysis includes loudness analysis, the first analysis module 503, when used to perform audio signal feature analysis on the reference audio signal and the test audio signal, is specifically used to:
[0231] Calculating a root mean square value for representing the loudness of the test audio signal, and calculating a root mean square value for representing the loudness of the reference audio signal; wherein there is a positive correlation between the loudness and the root mean square value;
[0232] Calculating a ratio of a root mean square value of the test audio signal to a root mean square value of the reference audio signal, and using the ratio as a third change rate of the loudness of the test audio signal compared to the reference audio signal;
[0233] When the third change rate is between a third change rate upper limit threshold and a third change rate lower limit threshold, it indicates that the analysis result of the loudness analysis in the fault detection stage is that the audio device under test has not failed;
[0234] When the third change rate is not between the third change rate upper limit threshold and the third change rate lower limit threshold, it indicates that the analysis result of the loudness analysis in the fault detection stage is that the audio device under test fails.
[0235] Optionally, when the audio signal feature analysis includes spectral centroid analysis, the first analysis module 503, when used to perform audio signal feature analysis on the reference audio signal and the test audio signal, is specifically used to:
[0236] Performing Fourier transform on the test audio signal and the reference audio signal respectively to obtain a first frequency spectrum of the test audio signal and a second frequency spectrum of the reference audio signal;
[0237] calculating a first amplitude of the first spectrum and a second amplitude of the second spectrum;
[0238] Calculating the spectral centroid of the test audio signal according to the first amplitude, and calculating the spectral centroid of the reference audio signal according to the second amplitude;
[0239] Calculating a ratio of a spectral centroid of the test audio signal to a spectral centroid of the reference audio signal, and using the ratio as a fourth change rate of the test audio signal compared to the reference audio signal;
[0240] When the fourth change rate is between a fourth change rate upper limit threshold and a fourth change rate lower limit threshold, it indicates that the analysis result of the spectral centroid analysis in the fault detection stage is that the audio device under test has not failed;
[0241] When the fourth change rate is not between the fourth change rate upper limit threshold and the fourth change rate lower limit threshold, it indicates that the analysis result of the spectral centroid analysis in the fault detection stage is that the audio device under test fails.
[0242] Optionally, when the first analysis module 503 is used to determine whether the audio device under test fails in the fault detection phase according to the analysis result, it is specifically used to:
[0243] When the analysis results of each analysis method included in the audio signal feature analysis are all that no fault has occurred, it is determined that the detection result of the audio device under test in the fault detection phase is that no fault has occurred;
[0244] When the analysis result of at least one analysis method included in the audio signal feature analysis is that a fault occurs, it is determined that the detection result of the audio device under test in the fault detection phase is that a fault occurs.
[0245] Optionally, the device further comprises:
[0246] A third control module is used to control the tested audio device that has not failed to play the reference audio signal multiple times in the preparation stage, so as to respectively collect the audio signal played by the tested audio device during each time the tested audio device that has not failed to play the reference audio signal in the preparation stage, and use the audio signal as a positive sample audio signal;
[0247] A second analysis module is used to analyze each of the positive sample audio signals and the reference audio signal respectively using each analysis method included in the audio signal feature analysis to obtain a positive sample analysis result of each positive sample audio signal;
[0248] The determination module is used to determine the upper and lower threshold values of the change rate of the analysis method according to the positive sample analysis result.
[0249] Optionally, the device further comprises:
[0250] A simulation module, used for simulating a failure of the audio device under test by debugging the audio device under test in a preparation stage;
[0251] a fourth control module, configured to control the audio device under test simulating a fault to play the reference audio signal multiple times, so as to respectively collect audio signals played by the audio device under test during each playback of the reference audio signal by the audio device under test simulating a fault in a preparation phase, and use the audio signals as negative sample audio signals;
[0252] A third analysis module is used to analyze each of the negative sample audio signals and the reference audio signal respectively using each analysis method included in the audio signal feature analysis to obtain a negative sample analysis result of each negative sample audio signal;
[0253] When the determination module is used to determine the upper threshold value and the lower threshold value of the change rate of the analysis method according to the positive sample analysis result, it is specifically used to:
[0254] Determine an upper threshold value and a lower threshold value of the initial change rate of the analysis method according to the positive sample analysis result;
[0255] According to the negative sample analysis result, the initial change rate upper limit threshold and the initial change rate lower limit threshold of the analysis method are adjusted to obtain the change rate upper limit threshold and the change rate lower limit threshold of the analysis method.
[0256] Optionally, the device further comprises a recheck module, wherein the recheck module is used to:
[0257] When the detection result of the audio device under test is that a fault occurs, retesting the audio device under test at least once;
[0258] During the retesting stage of the audio device under test, controlling the audio device under test to play the reference audio signal, so as to collect the audio signal played by the audio device under test during the process of the audio device under test playing the reference audio signal during the retesting stage, and use the audio signal as the retesting audio signal;
[0259] Perform audio signal feature analysis on the reference audio signal and the re-test audio signal, and determine whether the audio device under test has a fault based on the analysis result; wherein, during the re-test stage, if there is at least one re-test result that the audio device under test has not a fault, then determine the test result of the audio device under test as not having a fault.
[0260] Figure 6 A structural diagram of an electronic device provided for an embodiment of the present application includes: a processor 601, a memory 602 and a bus 603, wherein the memory 602 stores machine-readable instructions executable by the processor 601. When the electronic device runs the above-mentioned information processing method, the processor 601 communicates with the memory 602 through the bus 603, and the processor 601 executes the machine-readable instructions to perform the method steps described in Example 1.
[0261] The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method steps described in the first embodiment are executed.
[0262] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, electronic devices, and computer-readable storage media can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0263] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some communication interface, device or unit, which can be electrical, mechanical or other forms.
[0264] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0265] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0266] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0267] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for detecting an audio device, characterized in that: include: In the preparation stage, the tested audio device that has not failed is controlled to play the reference audio signal, so that during the process of the tested audio device that has not failed playing the reference audio signal in the preparation stage, the audio signal played by the tested audio device is collected and used as the reference audio signal; In the fault detection phase, the audio device under test is controlled to play the reference audio signal, so that during the process of the audio device under test playing the reference audio signal in the fault detection phase, an audio signal played by the audio device under test is collected and used as a test audio signal; Performing audio signal feature analysis on the reference audio signal and the test audio signal, and judging whether the audio device under test fails in the fault detection phase according to the analysis result; wherein the audio signal feature analysis includes any one or more of the following analysis methods: time domain-frequency domain grid analysis, zero crossing rate analysis, loudness analysis, and spectral centroid analysis; When the audio signal feature analysis includes time domain-frequency domain grid analysis, the performing audio signal feature analysis on the reference audio signal and the test audio signal includes: Performing short-time Fourier transform on the reference audio signal and the test audio signal respectively to obtain a reference two-dimensional array and a test two-dimensional array; the reference two-dimensional array contains the reference signal power value corresponding to each point of the reference audio signal in the target grid; the test two-dimensional array contains the test signal power value corresponding to each point of the test audio signal in the target grid; the horizontal axis of the target grid is the signal sampling time, and the vertical axis is the signal frequency; According to the preset first number and second number, the horizontal axis in the target grid is evenly divided into the first number of parts and the vertical axis is evenly divided into the second number of parts, so that the target grid contains a third number of grids; the third number is equal to the product of the first number and the second number; For each of the grids in the target grid, the average value of the reference signal power value corresponding to each point contained in the grid is calculated to obtain the average value of the reference signal power corresponding to the grid; and the average value of the test signal power value corresponding to each point contained in the grid is calculated to obtain the average value of the test signal power corresponding to the grid; Calculating a ratio of an average power value of the test signal corresponding to the grid to an average power value of the reference signal to obtain a first change rate of the reference audio signal corresponding to the grid relative to the test audio signal; Determine whether the first change rate is between a first change rate upper limit threshold and a first change rate lower limit threshold corresponding to the grid; If each of the first change rates is between the first change rate upper limit threshold and the first change rate lower limit threshold corresponding to the grid corresponding to each of the first change rates, it indicates that the analysis result of the time domain-frequency domain grid analysis in the fault detection stage is that the audio device under test has not failed; If there is at least one of the first change rates that is not between the first change rate upper limit threshold and the first change rate lower limit threshold corresponding to the grid corresponding to the first change rate, it indicates that the analysis result of the time domain-frequency domain grid analysis in the fault detection stage is that the audio device under test has a fault.
2. The method according to claim 1, characterized in that: The reference audio signal is a first audio signal with a gradually increasing frequency and a continuous phase; or, The reference audio signal is a second audio signal with a gradually decreasing frequency and a continuous phase; or, The reference audio signal includes multiple third audio signals of a single frequency, and different third audio signals have different frequencies; wherein, if the reference audio signal includes multiple third audio signals of a single frequency, then when the audio device under test plays the reference audio signal, it plays each of the third audio signals separately, and collects the reference audio signal and the test audio signal corresponding to each of the third audio signals separately.
3. The method according to claim 1, characterized in that: When the audio signal feature analysis includes zero-crossing rate analysis, performing audio signal feature analysis on the reference audio signal and the test audio signal includes: Calculating a ratio between the zero-crossing rate of the test audio signal and the zero-crossing rate of the reference audio signal, and using the ratio as a second change rate of the zero-crossing rate of the test audio signal compared to the reference audio signal; When the second change rate is between the second change rate upper limit threshold and the second change rate lower limit threshold, it indicates that the analysis result of the zero-crossing rate analysis in the fault detection stage is that the audio device under test has no fault; When the second change rate is not between the second change rate upper limit threshold and the second change rate lower limit threshold, it indicates that the analysis result of the zero-crossing rate analysis in the fault detection stage is that the audio device under test fails.
4. The method according to claim 3, characterized in that: When the audio signal feature analysis includes loudness analysis, performing audio signal feature analysis on the reference audio signal and the test audio signal includes: Calculating a root mean square value for representing the loudness of the test audio signal, and calculating a root mean square value for representing the loudness of the reference audio signal; wherein there is a positive correlation between the loudness and the root mean square value; Calculating a ratio of a root mean square value of the test audio signal to a root mean square value of the reference audio signal, and using the ratio as a third change rate of the loudness of the test audio signal compared to the reference audio signal; When the third change rate is between a third change rate upper limit threshold and a third change rate lower limit threshold, it indicates that the analysis result of the loudness analysis in the fault detection stage is that the audio device under test has not failed; When the third change rate is not between the third change rate upper limit threshold and the third change rate lower limit threshold, it indicates that the analysis result of the loudness analysis in the fault detection stage is that the audio device under test fails.
5. The method according to claim 4, characterized in that: When the audio signal feature analysis includes spectral centroid analysis, the performing audio signal feature analysis on the reference audio signal and the test audio signal includes: Performing Fourier transform on the test audio signal and the reference audio signal respectively to obtain a first frequency spectrum of the test audio signal and a second frequency spectrum of the reference audio signal; calculating a first amplitude of the first spectrum and a second amplitude of the second spectrum; Calculating the spectral centroid of the test audio signal according to the first amplitude, and calculating the spectral centroid of the reference audio signal according to the second amplitude; Calculating a ratio of a spectral centroid of the test audio signal to a spectral centroid of the reference audio signal, and using the ratio as a fourth change rate of the test audio signal compared to the reference audio signal; When the fourth change rate is between a fourth change rate upper limit threshold and a fourth change rate lower limit threshold, it indicates that the analysis result of the spectral centroid analysis in the fault detection stage is that the audio device under test has not failed; When the fourth change rate is not between the fourth change rate upper limit threshold and the fourth change rate lower limit threshold, it indicates that the analysis result of the spectral centroid analysis in the fault detection stage is that the audio device under test fails.
6. The method according to claim 1, characterized in that: The step of determining whether the audio device under test fails during the fault detection phase according to the analysis result includes: When the analysis results of each analysis method included in the audio signal feature analysis are all that no fault has occurred, it is determined that the detection result of the audio device under test in the fault detection phase is that no fault has occurred; When the analysis result of at least one analysis method included in the audio signal feature analysis is that a fault occurs, it is determined that the detection result of the audio device under test in the fault detection phase is that a fault occurs.
7. The method according to claim 5, characterized in that: The method further comprises: In the preparation stage, the tested audio device that has not failed is controlled to play the reference audio signal multiple times, so that during each time when the tested audio device that has not failed plays the reference audio signal in the preparation stage, the audio signal played by the tested audio device is collected and used as a positive sample audio signal; For each analysis method included in the audio signal feature analysis, each of the positive sample audio signals and the reference audio signal is analyzed respectively using the analysis method to obtain a positive sample analysis result of each positive sample audio signal; According to the positive sample analysis result, an upper threshold value of the change rate and a lower threshold value of the change rate of the analysis method are determined.
8. The method according to claim 7, characterized in that: The method further comprises: In the preparation stage, the audio device under test is debugged to simulate a failure of the audio device under test; Controlling the tested audio device simulating a fault to play the reference audio signal multiple times, so that during each playback of the reference audio signal by the tested audio device simulating a fault in a preparation phase, audio signals played by the tested audio device are collected and used as negative sample audio signals; For each analysis method included in the audio signal feature analysis, each of the negative sample audio signals and the reference audio signal is analyzed respectively using the analysis method to obtain a negative sample analysis result of each negative sample audio signal; Determining the upper threshold value and the lower threshold value of the change rate of the analysis method according to the positive sample analysis result includes: Determine an upper threshold value and a lower threshold value of the initial change rate of the analysis method according to the positive sample analysis result; According to the negative sample analysis result, the initial change rate upper limit threshold and the initial change rate lower limit threshold of the analysis method are adjusted to obtain the change rate upper limit threshold and the change rate lower limit threshold of the analysis method.
9. The method according to claim 1, characterized in that: The method further comprises: When the detection result of the audio device under test is that a fault occurs, re-testing the audio device under test at least once; During the retesting stage of the audio device under test, controlling the audio device under test to play the reference audio signal, so as to collect the audio signal played by the audio device under test during the process of the audio device under test playing the reference audio signal during the retesting stage, and use the audio signal as the retesting audio signal; Perform audio signal feature analysis on the reference audio signal and the re-test audio signal, and determine whether the audio device under test has a fault based on the analysis result; wherein, during the re-test stage, if there is at least one re-test result that the audio device under test has not a fault, then determine the test result of the audio device under test as not having a fault.
10. A detection device for an audio device, characterized in that: include: A first control module is used to control the tested audio device that has not failed to play the reference audio signal in the preparation stage, so as to collect the audio signal played by the tested audio device during the process of the tested audio device that has not failed to play the reference audio signal in the preparation stage, and use the audio signal as the reference audio signal; A second control module is used to control the audio device under test to play the reference audio signal during the fault detection phase, so as to collect the audio signal played by the audio device under test during the process of the audio device under test playing the reference audio signal during the fault detection phase, and use the audio signal as the test audio signal; A first analysis module is used to perform audio signal feature analysis on the reference audio signal and the test audio signal, and determine whether the audio device under test fails in the fault detection phase according to the analysis result; wherein the audio signal feature analysis includes any one or more of the following analysis methods: time domain-frequency domain grid analysis, zero crossing rate analysis, loudness analysis, and spectral centroid analysis; When the audio signal feature analysis includes time domain-frequency domain grid analysis, the first analysis module, when used to perform audio signal feature analysis on the reference audio signal and the test audio signal, is specifically used to: Performing short-time Fourier transform on the reference audio signal and the test audio signal respectively to obtain a reference two-dimensional array and a test two-dimensional array; the reference two-dimensional array contains the reference signal power value corresponding to each point of the reference audio signal in the target grid; the test two-dimensional array contains the test signal power value corresponding to each point of the test audio signal in the target grid; the horizontal axis of the target grid is the signal sampling time, and the vertical axis is the signal frequency; According to the preset first number and second number, the horizontal axis in the target grid is evenly divided into the first number of parts and the vertical axis is evenly divided into the second number of parts, so that the target grid contains a third number of grids; the third number is equal to the product of the first number and the second number; For each of the grids in the target grid, the average value of the reference signal power value corresponding to each point contained in the grid is calculated to obtain the average value of the reference signal power corresponding to the grid; and the average value of the test signal power value corresponding to each point contained in the grid is calculated to obtain the average value of the test signal power corresponding to the grid; Calculating a ratio of an average power value of the test signal corresponding to the grid to an average power value of the reference signal to obtain a first change rate of the reference audio signal corresponding to the grid relative to the test audio signal; Determine whether the first change rate is between a first change rate upper limit threshold and a first change rate lower limit threshold corresponding to the grid; If each of the first change rates is between the first change rate upper limit threshold and the first change rate lower limit threshold corresponding to the grid corresponding to each of the first change rates, it indicates that the analysis result of the time domain-frequency domain grid analysis in the fault detection stage is that the audio device under test has not failed; If there is at least one of the first change rates that is not between the first change rate upper limit threshold and the first change rate lower limit threshold corresponding to the grid corresponding to the first change rate, it indicates that the analysis result of the time domain-frequency domain grid analysis in the fault detection stage is that the audio device under test has a fault.
11. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the method as claimed in any one of claims 1 to 9 are performed.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are executed.
Citation Information
Patent Citations
Method and device for automatically detecting fault of active speaker, computer equipment and storage medium
CN115052240A