Electronic equipment audio analysis method, device, equipment and system

By using preset sampling intervals in the detection of audio amplifier modules to obtain the similarity between audio signals and theoretical signal sequences, the problem of high computational volume in the prior art is solved, and the audio signal quality is quickly evaluated, suitable for low-end processors and small-scale models The equipment for the improvement of analysis speed and resource efficiency.

CN119007747APending Publication Date: 2024-11-22SHENZHEN CULTRAVIEW DIGITAL TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410985195.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

In the prior art, the detection method of audio amplifier modules is large in computing, the equipment is expensive and not suitable for miniaturization, making it difficult to achieve real-time and resource efficiency requirements.

Method used

The audio signal and theoretical waves of the audio files played by electronic devices are sampled by preset sampling intervals to obtain the sampled signal sequence and theoretical signal sequence, and the normality of the audio amplifier module is judged based on the similarity, reducing the calculation complexity, and suitable for low-end Processors and miniaturized detection equipment.

Benefits of technology

It significantly improves analysis speed and resource efficiency, reduces the computing burden, makes audio signal analysis more suitable for low-end processors, and is suitable for miniaturized detection equipment, especially in scenarios where real-time and resource efficiency are strictly required.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119007747A_ABST
    Figure CN119007747A_ABST
Patent Text Reader

Abstract

The invention provides an audio analysis method, device, equipment and system for electronic equipment, and the method comprises the steps: carrying out the sampling of an audio signal played by the electronic equipment at a preset sampling interval, obtaining a sampling signal sequence of the audio signal in at least one period, and enabling the audio signal to be an audio signal of an audio file played by the electronic equipment, the waveform of the audio file is a periodic wave; sampling theoretical waves of the audio file at a preset sampling interval to obtain a theoretical signal sequence of the theoretical waves in at least one period; the initial sampling point of the sampling signal sequence and the initial sampling point of the theoretical signal sequence have the same instantaneous phase; and determining whether the audio power amplifier module of the electronic equipment is normal according to the similarity between the sampling signal sequence and the theoretical signal sequence. According to the embodiment of the invention, the method achieves the quick evaluation of the signal quality in the time domain, does not need the complex spectrum conversion, and remarkably improves the analysis speed and resource efficiency. According to the method, the calculation complexity is remarkably reduced, and the calculation burden is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of audio testing technology, and in particular, relates to an audio analysis method, device, equipment and system for electronic equipment. Background Art

[0002] In the field of electronic product manufacturing, such as the circuit motherboards of televisions, mobile phones, tablets, computers, etc. produced in factories, the audio amplifier module in the motherboard is an important component for online testing. The audio amplifier module of the motherboard can usually be tested in the following ways: 1. Manual testing, that is, the audio amplifier module of the motherboard plays audio, and the worker then uses his ears to identify the quality of the module; this requires workers to have the ability to judge the quality of the device, which is greatly affected by the workers' technical level, experience, environment and other factors, and the consistency of product testing results is weak. 2. Automated testing, the audio amplifier module of the motherboard plays audio, the system undergoes digital sampling, uses Fourier transform spectrum analysis or introduces neural network to extract signal feature information analysis, etc. These advanced algorithms have a large amount of calculation, and have high requirements on the performance of hardware equipment. The equipment is expensive, and the equipment is bulky and inconvenient to move and use. Summary of the invention

[0003] The embodiments of the present application provide an electronic device audio analysis method, apparatus, device and system, which can solve the problem of large amount of calculation required for analyzing the audio power amplifier module of the electronic device in the prior art.

[0004] In a first aspect, an embodiment of the present application provides a method for detecting an electronic device, including:

[0005] Sampling an audio signal played by an electronic device at a preset sampling interval to obtain a sampling signal sequence of the audio signal in at least one period, wherein the audio signal is an audio signal of an audio file played by the electronic device, and the waveform of the audio file is a periodic wave; the sampling signal sequence includes a plurality of first sampling points;

[0006] The theoretical wave of the audio file is sampled at the preset sampling interval to obtain a theoretical signal sequence of the theoretical wave in at least one cycle; the theoretical signal sequence includes a plurality of second sampling points; the starting sampling point of the sampling signal sequence has the same instantaneous phase as the starting sampling point of the theoretical signal sequence;

[0007] Whether the audio power amplifier module of the electronic device is normal is determined according to the similarity between the sampled signal sequence and the theoretical signal sequence.

[0008] In a possible implementation manner of the first aspect, sampling the theoretical wave of the audio file at the preset sampling interval to obtain a theoretical signal sequence of the theoretical wave in at least one period includes:

[0009] Determining the amplitude and DC offset of the audio signal according to the sampling signal sequence;

[0010] Determine the theoretical wave of the audio file according to the first phase, the amplitude and the frequency of the audio file; the first phase is used to make the instantaneous phase of the starting sampling point of the sampling signal sequence and the starting sampling point of the theoretical signal sequence the same;

[0011] The theoretical wave of the audio file is sampled at the preset sampling interval, and the DC bias is added to each theoretical signal obtained by sampling to obtain a theoretical signal sequence of the theoretical wave in at least one period.

[0012] In a possible implementation manner of the first aspect, determining the amplitude and DC offset of the audio signal according to the sampling signal sequence includes:

[0013] Determining the amplitude of the audio signal according to the peaks and troughs in the sampled signal sequence;

[0014] The average value of the amplitude values ​​of a plurality of first sampling points in one period of the sampling signal sequence is used as the DC bias of the audio signal.

[0015] In a possible implementation manner of the first aspect, determining whether the audio power amplifier module of the electronic device is normal according to the similarity between the sampled signal sequence and the theoretical signal sequence includes:

[0016] Determining the similarity between the sampled signal sequence and the theoretical signal sequence;

[0017] If the similarity between the sampled signal sequence and the theoretical signal sequence is greater than or equal to a set threshold, it is determined that the audio power amplifier module of the electronic device is normal;

[0018] If the similarity between the sampled signal sequence and the theoretical signal sequence is less than the set threshold, it is determined that the audio power amplifier module of the electronic device is abnormal.

[0019] In a possible implementation manner of the first aspect, if the similarity between the sampled signal sequence and the theoretical signal sequence is less than the set threshold, determining that the audio power amplifier module of the electronic device is abnormal includes:

[0020] If the similarity between the sampled signal sequence and the theoretical signal sequence is less than the set threshold, determining whether there is external interference, wherein the external interference includes at least one of electromagnetic interference, unstable power supply, and poor power supply filtering;

[0021] In the absence of the external interference, it is determined that the audio power amplifier module of the electronic device is abnormal.

[0022] In a possible implementation manner of the first aspect, the method further includes:

[0023] Determining the period of the audio signal output by the audio power amplifier module of the electronic device according to the duration between adjacent peaks and troughs in the sampling signal sequence;

[0024] Whether the audio power amplifier module of the electronic device is normal is determined according to the difference between the period of the audio signal output by the audio power amplifier module of the electronic device and the theoretical period of the audio signal.

[0025] In a second aspect, an embodiment of the present application provides an electronic device detection system, including an electronic device and a detection device; the electronic device includes an audio power amplifier module;

[0026] The electronic device is used to play an audio file through the audio power amplifier module to output an audio signal of the audio file, and the waveform of the audio file is a periodic wave;

[0027] The detection device is used to perform the method described in any one of the first aspects.

[0028] In a third aspect, an embodiment of the present application provides an electronic device detection device, including:

[0029] A first sampling module is used to sample an audio signal played by an electronic device at a preset sampling interval to obtain a sampling signal sequence of the audio signal in at least one period, wherein the audio signal is an audio signal of an audio file played by the electronic device, and the waveform of the audio file is a periodic wave; the sampling signal sequence includes a plurality of first sampling points;

[0030] A second sampling module is used to sample the theoretical wave of the audio file at the preset sampling interval to obtain a theoretical signal sequence of the theoretical wave in at least one cycle; the theoretical signal sequence includes a plurality of second sampling points; the starting sampling point of the sampling signal sequence has the same instantaneous phase as the starting sampling point of the theoretical signal sequence;

[0031] The determination module is used to determine whether the audio power amplifier module of the electronic device is normal according to the similarity between the sampled signal sequence and the theoretical signal sequence.

[0032] In a fourth aspect, an embodiment of the present application provides a detection device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any one of the methods described in the first aspect when executing the computer program.

[0033] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method as described in any one of the above-mentioned first aspects is implemented.

[0034] In a sixth aspect, an embodiment of the present application provides a computer program product, which, when executed on a detection device, enables the detection device to execute any of the methods described in the first aspect.

[0035] It can be understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.

[0036] The beneficial effect of the embodiment of the present application compared with the prior art is that the embodiment of the present application samples the audio signal played by the electronic device and the theoretical wave of the audio file at a preset sampling interval to obtain a sampled signal sequence and a theoretical signal sequence, and then compares the similarity between the sampled signal sequence and the theoretical signal sequence to determine whether the audio power amplifier module of the electronic device is normal. Therefore, since the embodiment of the present application completes the rapid evaluation of signal quality in the time domain without complex spectrum conversion, the analysis speed and resource efficiency are significantly improved. This method significantly reduces the computational complexity and reduces the computational burden, making audio signal analysis more suitable for low-end processors, and helps to miniaturize and reduce costs of detection equipment, and is particularly suitable for miniaturized detection equipment with strict requirements on real-time performance and resource efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0038] Figure 1 is a structural diagram of an electronic device detection system provided by an embodiment of the present application;

[0039] Figure 2 is a flowchart of a method for detecting an electronic device provided by an embodiment of the present application;

[0040] Figure 3 is another flowchart of a method for detecting an electronic device provided by an embodiment of the present application;

[0041] Figure 4 This is an example diagram of an audio signal digitally sampled by an ADC provided in an embodiment of the present application;

[0042] Figure 5It is a structural block diagram of an electronic device detection device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0043] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0044] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0045] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0046] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0047] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0048] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0049] Figure 1 A schematic structural diagram of an electronic device detection system provided in an embodiment of the present application is shown. The system includes an electronic device 100 and a detection device 200.

[0050] The electronic device 100 includes an audio power amplifier module, which is an audio power amplifier module, and is used to convert an audio signal into an amplified current form, so that the audio signal has enough power to drive a speaker.

[0051] An audio file with a known period is stored in the electronic device 100, and the waveform of the audio file is a periodic wave. The electronic device 100 is used to play the audio file through the audio power amplifier module to output the audio signal of the audio file.

[0052] The detection device 200 is used to sample the audio signal played by the electronic device at a preset sampling interval when the audio power amplifier module of the electronic device 100 plays an audio file, and obtain a sampling signal sequence of the audio signal in at least one period, wherein the audio signal is an audio signal of the audio file played by the electronic device, and the waveform of the audio file is a periodic wave; the sampling signal sequence includes multiple first sampling points; the theoretical wave of the audio file is sampled at a preset sampling interval to obtain a theoretical signal sequence of the theoretical wave in at least one period; the theoretical signal sequence includes multiple second sampling points; the instantaneous phase of the starting sampling point of the sampling signal sequence is the same as the instantaneous phase of the starting sampling point of the theoretical signal sequence; and whether the audio power amplifier module of the electronic device is normal is determined based on the similarity between the sampling signal sequence and the theoretical signal sequence.

[0053] Exemplarily, the electronic device 100 may be a device with an audio output function (ie, an audio playback function) such as a mobile phone, a stereo, a tablet computer, an MP3, or a television.

[0054] The electronic device detection system of the embodiment of the present application is based on time domain analysis, which does not rely on high-precision frequency resolution, reducing the requirements for hardware performance. This is particularly important for low-cost detection devices, which can quickly feedback analysis results without the computing resources required to perform complex spectrum analysis.

[0055] Figure 2 The schematic flow chart of the method for detecting an electronic device provided by the present application is shown. As an example but not a limitation, the method can be applied to a detection device. The method comprises the following steps:

[0056] S110: Sampling an audio signal played by an electronic device at a preset sampling interval to obtain a sampling signal sequence of the audio signal in at least one period, wherein the audio signal is an audio signal of an audio file played by the electronic device, and the waveform of the audio file is a periodic wave; the sampling signal sequence includes a plurality of first sampling points.

[0057] As an example, the audio file is built into the electronic device, and the period of the audio signal is known.

[0058] A periodic wave refers to a wave with a repetitive characteristic and a fixed period length. The periodic wave in the embodiment of the present application may be one of a sine wave, a triangle wave, a sawtooth wave, a square wave, a pulse wave, a step wave, a spike wave, and the like.

[0059] As an example, the preset sampling interval of the embodiment of the present application follows the Nyquist sampling theorem, that is, the sampling frequency is at least twice the highest frequency of the signal. The preset sampling interval is the reciprocal of the above sampling frequency, so that the signal frequency (f) can be determined according to the period (T) of the audio signal (T and f are in a reciprocal relationship). Since the sampling frequency (f s ) is at least twice the signal frequency (f), and the sampling interval (Δt) is equal to the sampling frequency (f s ), so the relationship between the sampling interval (Δt) and the period (T) of the audio signal can be determined. In order to obtain more sampling points, the sampling interval (Δt) can be set smaller.

[0060] The sampling signal sequence has multiple first sampling points, which are arranged in a sampling order, and each sampling point has its own phase and amplitude value. Each first sampling point represents a sampling signal, and the amplitude value corresponding to each first sampling point is the amplitude value of the sampling signal corresponding to the first sampling point.

[0061] The amplitude value refers to the intensity or volume of a sound signal at a certain moment, which reflects the strength of the sound signal. In audio processing, the amplitude value is usually quantified in decibels (dB) to describe the loudness, intensity or volume of the sound.

[0062] S120: Sampling the theoretical wave of the audio file at a preset sampling interval to obtain a theoretical signal sequence of the theoretical wave in at least one period; the theoretical signal sequence includes a plurality of second sampling points; the starting sampling point of the sampled signal sequence has the same instantaneous phase as the starting sampling point of the theoretical signal sequence.

[0063] The “period” in steps S110 and S120 refers to a theoretical period of the audio signal, which is known.

[0064] Exemplarily, the audio file takes a sine wave as an example, and the theoretical wave of the audio file can be understood as a standard sine wave.

[0065] The theoretical signal sequence has multiple second sampling points, which are arranged in sampling order, and each second sampling point has its own phase and amplitude value. Each second sampling point represents a theoretical signal, and the amplitude value corresponding to each second sampling point is the amplitude value of the theoretical signal corresponding to the second sampling point.

[0066] Instantaneous phase refers to the phase of a signal at a certain moment. As an example, when sampling the theoretical wave of an audio file, sampling is started from a specific time point, so that the instantaneous phase of the starting sampling point of the theoretical signal sequence is the same as the starting sampling point of the sampling signal sequence. As another example, when sampling the theoretical wave of an audio file and sampling the audio signal played by an electronic device, it can be started from any time point, but this causes the instantaneous phase of the sampling starting point to be different. At this time, it is necessary to align the sampling starting points of the two to eliminate the instantaneous phase difference between the two. Exemplarily, after completing the sampling of the audio signal played by the electronic device and the sampling of the theoretical wave of the audio file, the peaks (or troughs) of the sampling signal sequence and the theoretical signal sequence are found, and the peaks (or troughs) of the sampling signal sequence and the theoretical signal sequence are used as the starting sampling points, and the alignment of the sampling starting points is completed at this time.

[0067] S130: Determine whether the audio power amplifier module of the electronic device is normal according to the similarity between the sampled signal sequence and the theoretical signal sequence.

[0068] It should be noted that when a standard sine wave audio file is used as the input of an electronic device audio amplifier module, the output of the electronic device audio amplifier module may not necessarily be a standard sine wave signal, but may become a triangle wave; the period of the audio signal output by the electronic device audio amplifier module may not necessarily be the theoretical period. This may be due to quality problems with the electronic device audio amplifier module, or may be caused by external electromagnetic interference, unstable power supply, or poor power supply filtering.

[0069] The embodiment of the present application samples the audio signal played by the electronic device and the theoretical wave of the audio file at a preset sampling interval, obtains a sampled signal sequence and a theoretical signal sequence, and then compares the similarity between the sampled signal sequence and the theoretical signal sequence, so as to quickly determine whether the audio power amplifier module of the electronic device is normal. Therefore, the embodiment of the present application can complete the rapid evaluation of the quality of the audio signal in the time domain without the need for complex spectrum conversion, which significantly improves the analysis speed and resource efficiency. This method significantly reduces the computational complexity, reduces the computational burden, makes audio signal analysis more suitable for low-end processors, and helps to miniaturize and reduce the cost of detection equipment, and is particularly suitable for miniaturized detection equipment with strict requirements on real-time performance and resource efficiency.

[0070] As an optional implementation, before S120, S121 is also included.

[0071] S121: Constructing a theoretical wave of the audio file according to the sampling signal sequence of the audio file.

[0072] As an optional implementation, S121 specifically includes S122-S123.

[0073] S122: Determine the amplitude and DC bias of the audio signal output by the audio power amplifier module of the electronic device according to the sampling signal sequence.

[0074] Amplitude refers to the maximum distance a sound waveform deviates from its average position at a certain moment. For example, in a sine wave, the amplitude corresponds to the distance from the peak or trough of the wave to the average value of the wave. The amplitude value refers to the specific amplitude of the audio signal at a certain point in time, that is, the instantaneous value or strength of the audio signal. In a sine wave, the amplitude value at the peak position is indeed the amplitude.

[0075] According to the peaks and troughs in the sampling signal sequence, the amplitude of the audio signal output by the audio power amplifier module of the electronic device can be determined.

[0076] In audio signal processing, DC bias refers to the DC component that appears in the audio signal, that is, an average voltage level that does not change with time. In an ideal audio signal, there should only be an AC component (AC), which represents the fluctuation of the sound. However, in actual operation, due to equipment limitations or circuit design, the audio signal may carry a DC component (DC), a phenomenon called DC bias.

[0077] By calculating the average of the amplitude values ​​of a plurality of first sampling points within a period of the sampling signal sequence, the DC bias of the audio signal can be obtained.

[0078] S123: Determine a theoretical wave of the audio file according to the first phase, the amplitude, and the frequency of the audio file; the first phase is used to make the instantaneous phase of the starting sampling point of the sampling signal sequence the same as the instantaneous phase of the starting sampling point of the theoretical signal sequence.

[0079] Whether it is a sine wave, a triangle wave, a square wave, etc., their respective theoretical waves can be determined by phase, amplitude, and frequency.

[0080] The first phase is used to align the starting sampling points of the sampled signal sequence and the theoretical signal sequence.

[0081] Furthermore, S120 specifically includes S125.

[0082] S125: Sampling the theoretical waves of the audio file at a preset sampling interval, adding a DC bias to each theoretical signal, and obtaining a theoretical signal sequence of the theoretical wave in at least one cycle.

[0083] When there is a special circuit in the electronic device to eliminate or control the DC bias, there is no need to consider the DC bias. When the DC bias is very low, its existence can also be ignored. However, when the DC bias is greater than the set threshold, it is necessary to consider the impact of the DC bias on the audio analysis results. At this time, it is necessary to add a DC bias to each theoretical signal. It is worth noting that when the DC bias needs to be considered, in addition to adding a DC bias to each theoretical signal, in S110, after obtaining the sampling signal sequence, the DC bias can be subtracted from each sampling signal in the sampling signal sequence, and then the sampling signal sequence is updated. In subsequent steps, the updated sampling signal sequence is compared with the theoretical signal sequence for similarity.

[0084] As an optional implementation, step S130: determining whether the audio power amplifier module of the electronic device is normal according to the similarity between the sampled signal sequence and the theoretical signal sequence, specifically includes steps S131-S133.

[0085] S131: Determine the similarity between the sampled signal sequence and the theoretical signal sequence.

[0086] Similarity is used to measure the similarity between the sampled signal sequence and the theoretical signal sequence. The amplitude value of each sampled signal in the sampled signal sequence represents the audio intensity collected at the corresponding moment; the amplitude value of each theoretical signal in the theoretical signal sequence represents the theoretical audio intensity at the corresponding moment. Similarity comparison is to compare the audio intensity of the sampled signal in the sampled signal sequence with the audio intensity of the theoretical signal in the theoretical signal sequence at the same moment.

[0087] For example, to determine the similarity between the sampling signal sequence and the theoretical signal sequence, the amplitude value of the first sampling signal in the sampling signal sequence is compared with the amplitude value of the first theoretical signal in the theoretical signal sequence, and the amplitude value of the second sampling signal in the sampling signal sequence is compared with the amplitude value of the second theoretical signal in the theoretical signal sequence, and so on, until all comparisons are completed or compared to a preset number. If the audio intensity of the sampling signal in the sampling signal sequence is the same as the audio intensity of the theoretical signal in the theoretical signal sequence, it means that the similarity is 100%, which means that the audio signal fidelity of the audio output of the audio power amplifier module of the electronic device is very high, and the quality of the audio power amplifier module is very good. If the audio intensity of the sampling signal in the sampling signal sequence is very different from the audio intensity of the theoretical signal in the theoretical signal sequence, it means that the similarity is very low, which means that the audio signal fidelity of the audio output of the audio power amplifier module of the electronic device is very low, and the quality of the audio power amplifier module is unqualified.

[0088] S132: If the similarity between the sampled signal sequence and the theoretical signal sequence is greater than or equal to a set threshold, it is determined that the audio power amplifier module of the electronic device is normal.

[0089] The higher the similarity, the better the quality of the audio signal output by the audio power amplifier module of the electronic device, that is, the smaller the deviation of the audio signal output by the audio power amplifier module of the electronic device, so it can be determined that the audio power amplifier module of the electronic device is normal.

[0090] S133: If the similarity between the sampled signal sequence and the theoretical signal sequence is less than a set threshold, it is determined that the audio power amplifier module of the electronic device is abnormal.

[0091] The lower the similarity, the worse the quality of the audio signal output by the audio power amplifier module of the electronic device, that is, the greater the deviation of the audio signal output by the audio power amplifier module of the electronic device, thereby determining that the audio power amplifier module of the electronic device is abnormal.

[0092] As an optional implementation, S133 specifically includes S134-S135.

[0093] S134: If the similarity between the sampled signal sequence and the theoretical signal sequence is less than a set threshold, determine whether there is external interference, where the external interference includes at least one of electromagnetic interference, unstable power supply, and poor power filtering.

[0094] S135: In the absence of external interference, it is determined that the audio power amplifier module of the electronic device is abnormal.

[0095] It is easy to understand that if the similarity between the sampled signal sequence and the theoretical signal sequence is greater than or equal to the set threshold, it means that the quality of the audio signal output by the audio power amplifier module of the electronic device is unqualified. In addition to the quality of the audio power amplifier module of the electronic device affecting the quality of the audio signal output by the audio power amplifier module of the electronic device, external factors such as external electromagnetic interference, unstable power supply or poor power filtering will also affect the quality of the audio signal output by the audio power amplifier module of the electronic device. Therefore, it is necessary to analyze which factors cause the quality of the audio signal output by the audio power amplifier module of the electronic device to be unqualified.

[0096] As an example, when the similarity between the sampled signal sequence and the theoretical signal sequence is greater than or equal to the set threshold, the audio power amplifier module of the electronic device can be repeatedly allowed to play the audio file. If the quality of the audio signal output by the audio power amplifier module of the electronic device is unqualified for the second time, it can be determined that the quality of the audio power amplifier module of the electronic device is qualified. The unqualified quality of the audio signal output by the audio power amplifier module of the electronic device for the first time may be caused by factors such as external interference. If the quality of the audio signal output by the audio power amplifier module of the electronic device is still unqualified for the second time, and the similarity between the sampled signal sequence and the theoretical signal sequence is basically the same, it can be determined that the quality of the audio power amplifier module of the electronic device is unqualified. Because even if the quality of the audio power amplifier module of the electronic device is unqualified, it has a high stability, while external interference is random.

[0097] As another example, in a test production line, when the quality of the audio signals output by the audio amplifier modules of multiple consecutive electronic devices is unqualified, it means that it is likely caused by external factors, and an alarm message is issued to prompt the quality department to intervene in the investigation.

[0098] As an optional implementation, the method for detecting an electronic device in the embodiment of the present application further includes steps S140 and S150.

[0099] S140: Determine a period of an audio signal output by an audio power amplifier module of the electronic device according to a duration between adjacent peaks and troughs in the sampling signal sequence.

[0100] The period of the audio signal output by the audio power amplifier module of the electronic device is equal to the duration between two adjacent wave peaks in the sampling signal sequence.

[0101] In sine waves, triangle waves, square waves, and sawtooth waves, the duration between adjacent peaks and troughs is half of the period, so twice the duration between adjacent peaks and troughs is the period of the audio signal output by the audio power amplifier module of the electronic device.

[0102] S150: Determine whether the audio power amplifier module of the electronic device is normal according to the difference between the period of the audio signal output by the audio power amplifier module of the electronic device and the theoretical period of the audio signal.

[0103] The theoretical period of an audio signal is equal to the duration between two adjacent peaks in a theoretical signal sequence. Ideally (i.e., there is no problem with the quality of the audio power amplifier module of the electronic device, and there is no external interference, etc.), the period of the audio signal output by the audio power amplifier module of the electronic device is equal to the theoretical period of the audio signal. However, if there is a problem with the quality of the audio power amplifier module of the electronic device, or there is external interference, etc., it will cause the period of the audio signal output by the audio power amplifier module of the electronic device to be unequal to the theoretical period of the audio signal, and the greater the difference between the two, the worse the quality of the audio signal output by the audio power amplifier module of the electronic device. Therefore, the difference between the two can be compared with the preset duration. If the difference between the two is greater than the preset duration, it is determined that the quality of the audio signal output by the audio power amplifier module of the electronic device is unqualified, and then the audio power amplifier module of the electronic device is determined to be abnormal; if the difference between the two is less than the preset duration, it is determined that the quality of the audio signal output by the audio power amplifier module of the electronic device is qualified, and then the audio power amplifier module of the electronic device is determined to be normal.

[0104] Through this embodiment, it is not necessary to determine the similarity between the sampled signal sequence and the theoretical signal sequence to determine whether the audio power amplifier module of the electronic device is normal. The amount of calculation required by this embodiment is smaller, so S150 can be performed before S130. When S150 determines that the audio power amplifier module of the electronic device is unqualified, there is no need to perform the similarity calculation in S130. When S150 determines that the quality of the audio power amplifier module of the electronic device is qualified, the similarity calculation in S130 is performed again.

[0105] As an example but not a limitation, the audio file of this embodiment takes a sine wave audio file as an example to introduce the method for detecting an electronic device. Figure 3 The overall flow chart of the method for detecting an electronic device according to this embodiment is shown. Figure 4 An example diagram of an audio signal digitally sampled by the ADC of this embodiment is shown.

[0106] In this embodiment, a sine wave audio file is built into the circuit board of the electronic device. After the circuit board outputs the sine wave audio file, ADC digital sampling is performed. The time domain analysis algorithm is used to analyze the error between the sampled signal and the theoretical sine wave signal and evaluate the quality of the sampled signal to verify whether the audio amplifier module is normal.

[0107] In the built-in sine wave signal of the circuit board, the signal frequency is f and the ADC digital sampling interval is Δt. These parameters are determined when the system is initialized. The output sine wave audio is sampled to obtain the digital PCM sampling signal sequence (x[n]) of the sine wave audio, and a time domain analysis algorithm is designed to process and analyze it.

[0108] The time-domain analysis algorithm process is as follows: First, calculate the amplitude A of the sine-wave audio output, then calculate the DC bias B of the sine-wave audio output, and then locate the peak index number peak_index, that is, the phase is π / 2. Combine the known signal frequency f and the sampling interval Δt to establish a discrete representation formula of the theoretical signal to obtain the theoretical value, and compare it with the sampled signal to measure the quality of the output audio signal. The detailed time-domain analysis algorithm is as follows:

[0109] 1. Calculate the amplitude A.

[0110] Objective: Identify the first maximum value (the amplitude value corresponding to the peak) and the first minimum value (the amplitude value corresponding to the trough) within a sampling window of 1.5 signal periods, and calculate the amplitude A.

[0111] 1) Initialize variables: max_val = 0, min_val = 0, peak_index = 0, trough_index = 0.

[0112] 2) Read the sampled signal sequence, traverse the sampling points x[n] of 1.5 periods (assuming starting from index number 0). The sequence number of each sampling point x[n] is its index number. n in x[n] is the index number of the sampling point, and x[n] represents the amplitude value of the sampling point with index number n.

[0113] 3) For each sampling point x[n]:

[0114] If x[n] > max_val, then update max_val = x[n], peak_index = n. peak_index represents the peak index number. max_val is a variable, which means starting from index number 0, continuously taking out new sampling points for comparison. If the new sampling point is larger than the previous one, then update max_val. In this way, after reading the sampled signal sequence, the amplitude value of the peak (i.e., the peak value) can be obtained.

[0115] If x[n] < min_val, then update min_val = x[n], trough_index = n. trough_index represents the trough index number. min_val is a variable, which means starting from index number 0, continuously taking out new sampling points for comparison. If the new sampling point is smaller than the previous one, then update min_val. In this way, after reading the sampled signal sequence, the amplitude value of the trough (i.e., the trough value) can be obtained.

[0116] 4) Determine the amplitude A = max_val - min_val. And take the peak as the starting point of sampling. The phase of the peak is π / 2, and the index number is peak_index.

[0117] 2. Calculate the DC bias B.

[0118] Objective: Use the peak as the starting point to calculate the average of the sampled values ​​within a cycle as the DC bias. Formula:

[0119]

[0120] Where N is the number of sampling points in a period, and peak_index is the peak index number.

[0121] 3. Calculate the similarity between the sampled signal and the theoretical signal.

[0122] Goal: Quantify the similarity of a sampled signal to an ideal sine wave.

[0123] 1) Construct a theoretical sine wave: Its mathematical expression is:

[0124] x(t)=Asin(2mft+φ)

[0125] Where A is the amplitude, f is the frequency, t is the time, and φ is the phase. When sampling the theoretical sine wave at equal intervals, let φ be π / 2, so that the sampling starting point is the peak, and add a DC bias B, the discrete signal formula is obtained

[0126] Where n is the index number of the sampling point, xt h [n] represents the amplitude value of the theoretical signal with index number n, and Δt is the sampling interval.

[0127] 2) Similarity calculation: Starting from the peak index number peak_index to the peak_index+N-1 index number, calculate the sum of the absolute values ​​of the differences between the amplitude values ​​of all sampled signals and the amplitude values ​​of the theoretical signal, then find the average and divide it by the amplitude to normalize it:

[0128]

[0129] Among them, Error s _ norm represents the average error; x'[n] represents the amplitude value of the sampled signal with index number n; since the index number of this formula starts from the index number peak_index of the peak, x'[n] = x'[peak_index], which represents the amplitude value of the sampled signal at the peak; x th [n-peak_index] = x th [0], x th [0] represents the amplitude value of the theoretical signal with index number 0. Since the sampling starting point of the theoretical signal sequence is the peak, the index number 0 is the amplitude value of the theoretical signal at the peak; |x'[n]-xth [n-peak_index]| represents the absolute value of the difference between the amplitude value of the sampled signal at the peak and the amplitude value of the theoretical signal at the peak; It means that starting from the peak index number and ending at the peak_index+N-1 index number, the absolute value of the difference between the amplitude value of each sampled signal and the amplitude value of the theoretical signal is summed up in sequence.

[0130] 4. Result determination:

[0131] Set a threshold E. When the average error is greater than the threshold E, it means that the signal deformation is too large, that is, it does not meet the theoretical range, and the product quality is judged to be unqualified. It is easy to understand that the larger the error, the lower the similarity, and the smaller the error, the higher the similarity. Therefore, similarity can also be reflected in the form of error.

[0132] The embodiment of the present application obtains the prior information of the precise signal frequency f and the ADC sampling interval Δt by giving the circuit board a built-in sine wave audio with a known period, and completes the rapid evaluation of the signal quality in the time domain without the need for complex spectrum conversion, which significantly improves the analysis speed and resource efficiency. By accurately locating the signal peak, calculating the amplitude A and the DC offset B, and combining the theoretical sine wave model, high-precision alignment and error quantization of the sampled signal are achieved. By further calculating the normalized error and converting it into a signal similarity index, the fidelity of the audio output and the performance of the power amplifier can be effectively evaluated.

[0133] The method for detecting electronic devices in the embodiment of the present application operates on a time series without the need for complex Fourier transforms, which reduces computational complexity and improves real-time processing capabilities. For application scenarios that require fast feedback, such as online monitoring of audio playback quality, this method can give results faster. In contrast, although spectrum analysis provides detailed information in the frequency domain, the DFT (discrete Fourier transform) or FFT (fast Fourier transform) involved is relatively large in computation, especially when processing long sequence data.

[0134] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0135] Corresponding to the method for detecting an electronic device described in the above embodiment, Figure 4 A structural block diagram of an electronic device detection device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0136] Reference Figure 5 , the device comprises:

[0137] A first sampling module 510 is used to sample an audio signal played by an electronic device at a preset sampling interval to obtain a sampling signal sequence of the audio signal in at least one period, wherein the audio signal is an audio signal of an audio file played by the electronic device, and the waveform of the audio file is a periodic wave; the sampling signal sequence includes a plurality of first sampling points;

[0138] The second sampling module 520 is used to sample the theoretical wave of the audio file at a preset sampling interval to obtain a theoretical signal sequence of the theoretical wave in at least one cycle; the theoretical signal sequence includes a plurality of second sampling points; the instantaneous phase of the starting sampling point of the sampling signal sequence is the same as the instantaneous phase of the starting sampling point of the theoretical signal sequence;

[0139] The determination module 530 is used to determine whether the audio power amplifier module of the electronic device is normal according to the similarity between the sampled signal sequence and the theoretical signal sequence.

[0140] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0141] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0142] An embodiment of the present application also provides a detection device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor implements the steps in any of the above-mentioned method embodiments when executing the computer program.

[0143] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0144] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0145] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present application implements all or part of the process in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes a computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium can at least include: any entity or device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium that can carry the computer program code to the detection device. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk, etc. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0146] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0147] The computer program code for performing the operation of the embodiment of the application can be written with one or more programming languages ​​or their combination, and the programming language includes object-oriented programming languages, such as python, Java, Smalltalk, C++, and also includes conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on the remote computer, or executed completely on the remote computer or server. In the case of a remote computer, the remote computer can include a local area network (LAN) or a wide area network (WAN)--connected to the user's computer through any type of network, or, can be connected to an external computer (for example, utilizing an Internet service provider to connect through the Internet).

[0148] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0149] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0150] In the embodiments provided in the present application, it should be understood that the disclosed device / detection equipment and method can be implemented in other ways. For example, the device / detection equipment embodiments described above are merely schematic, for example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of the device or unit, which can be electrical, mechanical or other forms.

[0151] 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.

[0152] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for detecting an electronic device, characterized in that: include: Sampling an audio signal played by an electronic device at a preset sampling interval to obtain a sampling signal sequence of the audio signal in at least one period, wherein the audio signal is an audio signal of an audio file played by the electronic device, and the waveform of the audio file is a periodic wave; the sampling signal sequence includes a plurality of first sampling points; The theoretical wave of the audio file is sampled at the preset sampling interval to obtain a theoretical signal sequence of the theoretical wave in at least one cycle; the theoretical signal sequence includes a plurality of second sampling points; the starting sampling point of the sampling signal sequence has the same instantaneous phase as the starting sampling point of the theoretical signal sequence; Whether the audio power amplifier module of the electronic device is normal is determined according to the similarity between the sampled signal sequence and the theoretical signal sequence.

2. The method for detecting an electronic device according to claim 1, wherein: The step of sampling the theoretical wave of the audio file at the preset sampling interval to obtain a theoretical signal sequence of the theoretical wave in at least one period includes: Determining the amplitude and DC offset of the audio signal according to the sampling signal sequence; Determine the theoretical wave of the audio file according to the first phase, the amplitude and the frequency of the audio file; the first phase is used to make the instantaneous phase of the starting sampling point of the sampling signal sequence and the starting sampling point of the theoretical signal sequence the same; The theoretical wave of the audio file is sampled at the preset sampling interval, and the DC bias is added to each theoretical signal obtained by sampling to obtain a theoretical signal sequence of the theoretical wave in at least one period.

3. The method for detecting an electronic device according to claim 2, wherein: Determining the amplitude and DC offset of the audio signal according to the sampling signal sequence includes: Determining the amplitude of the audio signal according to the peaks and troughs in the sampled signal sequence; The average value of the amplitude values ​​of a plurality of first sampling points in one period of the sampling signal sequence is used as the DC bias of the audio signal.

4. The method for detecting an electronic device according to any one of claims 1 to 3, characterized in that: The step of determining whether the audio power amplifier module of the electronic device is normal according to the similarity between the sampled signal sequence and the theoretical signal sequence includes: Determining the similarity between the sampled signal sequence and the theoretical signal sequence; If the similarity between the sampled signal sequence and the theoretical signal sequence is greater than or equal to a set threshold, it is determined that the audio power amplifier module of the electronic device is normal; If the similarity between the sampled signal sequence and the theoretical signal sequence is less than the set threshold, it is determined that the audio power amplifier module of the electronic device is abnormal.

5. The method for detecting an electronic device according to claim 4, characterized in that: If the similarity between the sampled signal sequence and the theoretical signal sequence is less than the set threshold, determining that the audio power amplifier module of the electronic device is abnormal includes: If the similarity between the sampled signal sequence and the theoretical signal sequence is less than the set threshold, determining whether there is external interference, wherein the external interference includes at least one of electromagnetic interference, unstable power supply, and poor power supply filtering; In the absence of the external interference, it is determined that the audio power amplifier module of the electronic device is abnormal.

6. The method for detecting an electronic device according to any one of claims 1 to 3, characterized in that: Also includes: Determining the period of the audio signal output by the audio power amplifier module of the electronic device according to the duration between adjacent peaks and troughs in the sampling signal sequence; Whether the audio power amplifier module of the electronic device is normal is determined according to the difference between the period of the audio signal output by the audio power amplifier module of the electronic device and the theoretical period of the audio signal.

7. An electronic equipment detection system, characterized in that: It includes electronic equipment and detection equipment; the electronic equipment includes an audio power amplifier module; The electronic device is used to play an audio file through the audio power amplifier module to output an audio signal of the audio file, and the waveform of the audio file is a periodic wave; The detection device is used to perform the method according to any one of claims 1 to 6.

8. An electronic equipment detection device, characterized in that: include: A first sampling module is used to sample an audio signal played by an electronic device at a preset sampling interval to obtain a sampling signal sequence of the audio signal in at least one period, wherein the audio signal is an audio signal of an audio file played by the electronic device, and the waveform of the audio file is a periodic wave; the sampling signal sequence includes a plurality of first sampling points; A second sampling module is used to sample the theoretical wave of the audio file at the preset sampling interval to obtain a theoretical signal sequence of the theoretical wave in at least one cycle; the theoretical signal sequence includes a plurality of second sampling points; the starting sampling point of the sampling signal sequence has the same instantaneous phase as the starting sampling point of the theoretical signal sequence; The determination module is used to determine whether the audio power amplifier module of the electronic device is normal according to the similarity between the sampled signal sequence and the theoretical signal sequence.

9. A detection device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.