Headphone Detection Method, Device, Electronic Device, and Computer-Readable Storage Medium
By obtaining the characteristic parameters of the TWS headset, the mapping function is used to automatically detect whether the current sound exists in the headset, which solves the problem of inaccurate current sound detection in the existing technology and achieves efficient sound quality detection.
Patent Information
- Application Number
- CN202210604143.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-30
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2042-05-30
AI Technical Summary
In the prior art, the current sound detection of TWS headphones is difficult to accurately distinguish, resulting in poor sound quality detection accuracy.
By obtaining the characteristic parameters of the headset, the mapping function is used to automatically detect whether the current sound exists in the headset. The characteristic parameters include the frequency points with abnormal sound pressure value in the noise floor frequency response curve of the headset. Combined with the outlier point detection algorithm and cluster analysis, the mapping relationship between the characteristic parameters and the fault state is established.
It realizes accurate detection of headphone current tones, improves the accuracy of sound quality detection, reduces dependence on special audition personnel, and improves detection efficiency.
Smart Images

Figure CN115086852B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the technical field of wireless earphones. More specifically, embodiments of the present disclosure relate to a method, apparatus, electronic device, and computer-readable storage medium for detecting earphones. Background Art
[0002] As an emerging product based on Bluetooth technology, TWS (True Wireless Stereo) earphones have received increasing attention and love from the public due to their portability, versatility, ease of use, and stability, and are widely used in various scenarios.
[0003] During the use of TWS earphones, due to the irregular thermal motion of electrons in the components of the earphones, current noise will be generated, which affects the sound quality of the earphones. To this end, in order to ensure that TWS earphones have good sound quality, it is necessary to detect whether there is current noise in TWS earphones before leaving the factory. In the related art, a dedicated auditioner can detect whether there is current noise in TWS earphones by listening, but this method is difficult to distinguish the current noise of the earphones, and the detection accuracy is poor.
[0004] Therefore, it is necessary to provide a new method for detecting earphones to accurately detect whether there is current noise in the earphones. Summary of the Invention
[0005] The purpose of the embodiments of the present disclosure is to provide a method, apparatus, electronic device, and computer-readable storage medium for detecting earphones to accurately detect whether there is current noise in the earphones.
[0006] According to a first aspect of the embodiments of the present disclosure, there is provided a method for detecting earphones, including:
[0007] Obtaining a parameter value of a to-be-detected earphone for a set characteristic parameter, where the characteristic parameter includes a plurality of parameters reflecting a fault state of whether there is current noise in the earphone;
[0008] Obtaining a fault state of whether there is current noise in the to-be-detected earphone according to the parameter value and a mapping function between the characteristic parameter and the fault state.
[0009] Optionally, the characteristic parameter includes a plurality of frequency points where the sound pressure value is abnormal in the background noise frequency response curve of the earphone.
[0010] Optionally, the obtaining a parameter value of a to-be-detected earphone for a set characteristic parameter includes:
[0011] When the to-be-detected earphone is in a playing state, processing the audio signal output by the to-be-detected earphone to obtain a first background noise frequency response curve;
[0012] Determine multiple first frequency points where the sound pressure values in the first background noise frequency response curve are abnormal;
[0013] Select multiple target frequency points from the multiple first frequency points, and use the sound pressure values corresponding to the multiple target frequency points as the parameter values for a set feature parameter.
[0014] Optionally, the step of selecting multiple target frequency points from the multiple first frequency points and using the sound pressure values corresponding to the multiple target frequency points as the parameter values for a set feature parameter includes:
[0015] Remove second frequency points from the multiple first frequency points to obtain multiple target frequency points;
[0016] Use the sound pressure values corresponding to the multiple target frequency points as the parameter values for a set feature parameter;
[0017] Wherein, the second frequency points are the frequency points where the sound pressure values in the second background noise frequency response curve are abnormal, and the second background noise frequency response curve is the background noise frequency response curve obtained by processing the audio signal output when the earphone to be detected is not in the playing state.
[0018] Optionally, the step of determining multiple first frequency points where the sound pressure values in the first background noise frequency response curve are abnormal includes:
[0019] Use an outlier detection algorithm to determine multiple first frequency points where the sound pressure values in the first background noise frequency response curve are abnormal.
[0020] Optionally, the method further includes the step of obtaining the mapping function between the feature parameter and the fault state, including:
[0021] Obtain earphones with accurate fault states as training samples;
[0022] Obtain the mapping function between the feature parameter and the fault state according to the parameter values of the feature parameter for the training samples and the fault states corresponding to the training samples indicating whether there is current noise.
[0023] Optionally, the step of obtaining earphones with accurate fault states as training samples includes:
[0024] Obtain a first set number of earphones with accurate fault states as the first training samples;
[0025] Obtain a second set number of earphones as the second training samples;
[0026] Cluster the second training samples according to the first training samples to obtain the fault states indicating whether there is current noise for each earphone in the second training samples;
[0027] Use the first training sample and the clustered second training samples as training samples.
[0028] According to a second aspect of the embodiments of the present disclosure, there is provided a headphone detection device, including:
[0029] A first acquisition module, configured to acquire parameter values of a set of characteristic parameters for a headphone to be detected, where the characteristic parameters include multiple parameters reflecting the fault state of whether there is a current sound in the headphone;
[0030] A detection module, configured to obtain the fault state of whether there is a current sound in the headphone to be detected according to the parameter values and the mapping function between the characteristic parameters and the fault state.
[0031] According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, including:
[0032] A memory, configured to store executable computer instructions;
[0033] A processor, configured to execute the headphone detection method according to the first aspect of the embodiments of the present disclosure under the control of the executable computer instructions.
[0034] According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, on which computer instructions are stored, and when the computer instructions are run by a processor, the headphone detection method according to the first aspect of the embodiments of the present disclosure is executed.
[0035] According to the embodiments of the present disclosure, before the headphones leave the factory, it is possible to detect whether there is a current sound in the headphones according to the parameter values of multiple characteristic parameters reflecting the fault state of whether there is a current sound in the headphones and the mapping function between the characteristic parameters and the fault state of the headphones, which can improve the accuracy of headphone sound quality detection. And there is no need for a dedicated auditioner to identify by listening, and automatic detection of headphone sound quality can be realized, thereby improving the detection efficiency.
[0036] Through the following detailed description of the exemplary embodiments of the present disclosure with reference to the accompanying drawings, other features and advantages of the embodiments of the present disclosure will become clear. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present disclosure and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can also be obtained based on these drawings without creative efforts.
[0038] Figure 1Schematic diagram of the hardware configuration of an electronic device that can be used to implement the headphone detection method of an embodiment;
[0039] Figure 2 Schematic flowchart of the headphone detection method according to an embodiment;
[0040] Figure 3 Schematic block diagram of the principle of the headphone detection device according to an embodiment;
[0041] Figure 4 Schematic diagram of the hardware structure of an electronic device according to an embodiment. Detailed implementation manners
[0042] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that: Unless otherwise specifically stated, the relative arrangements of components and steps, numerical expressions and values set forth in these embodiments do not limit the scope of the embodiments of the present disclosure.
[0043] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way a limitation on the present disclosure, its application, or use.
[0044] Technologies, methods, and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and devices should be regarded as part of the specification.
[0045] In all examples shown and discussed herein, any specific values should be construed as merely exemplary and not as a limitation. Therefore, other examples of the exemplary embodiments may have different values.
[0046] It should be noted that: Similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further discussed in subsequent drawings.
[0047] <Hardware configuration>
[0048] Figure 1 Schematic diagram of the hardware configuration of an electronic device that can be used to implement the headphone detection method of an embodiment.
[0049] As Figure 1As shown, the electronic device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a microphone 1700, and a speaker 1800. The processor 1100 may include, but is not limited to, a central processing unit CPU, a microcontroller unit MCU, etc. The memory 1200 includes, for example, a ROM (read-only memory), a RAM (random access memory), a non-volatile memory such as a hard disk, etc. The interface device 1300 includes, for example, various bus interfaces, such as a serial bus interface (including a USB interface), a parallel bus interface, etc. The communication device 1400 can perform wired or wireless communication, for example. The display device 1500 is, for example, a liquid crystal display screen, an LED display screen, a touch display screen, etc. The input device 1600 includes, for example, a touch screen, a keyboard, a handle, etc. The microphone 1700 can be used to input voice information. The speaker 1800 can be used to output voice information.
[0050] The electronic device 1000 can be, for example, a mobile phone, a portable computer, a tablet computer, a handheld computer, etc. The electronic device 1000 can also be, for example, a server. The embodiments of the present disclosure do not limit this.
[0051] In this embodiment, the electronic device 1000 is provided with an emulated earphone card slot. When detecting an earphone, the earphone to be detected can be placed in the emulated earphone card slot to obtain the audio signal output by the earphone to be detected, and the collected audio signal is processed to obtain the background noise frequency response curve of the earphone to be detected, so as to detect whether there is a current sound in the earphone based on the background noise frequency response curve.
[0052] In this embodiment, the memory 1200 of the electronic device 1000 is used to store instructions for controlling the processor 1100 to operate to implement or support the implementation of the earphone detection method according to any embodiment. Those skilled in the art can design the instructions according to the solutions disclosed in this specification. How the instructions control the processor to operate is well known in the art, so it will not be described in detail here.
[0053] Those skilled in the art should understand that although multiple devices of the electronic device 1000 are shown in Figure 1 , the electronic device 1000 in the embodiments of this specification may only relate to some of the devices, or may also include other devices, which is not limited here.
[0054] Figure 1 The shown electronic device 1000 is only illustrative and is by no means intended to limit this specification, its applications, or uses.
[0055] Next, various embodiments and examples according to the present disclosure will be described with reference to the drawings.
[0056] <Method Embodiment>
[0057] Figure 2 The following shows a headphone detection method according to an embodiment of the present disclosure. This headphone detection method can be implemented, for example, by an electronic device 1000 as shown in Figure 1 as follows. Figure 2 As shown, the headphone detection method provided in this embodiment may include the following steps S2100 to S2200.
[0058] Step S2100: Obtain the parameter values of the to-be-detected headphone for set characteristic parameters, where the characteristic parameters include multiple parameters reflecting the fault state of whether there is current noise in the headphone.
[0059] The fault state of the headphone may be a fault state reflecting whether there is current noise in the headphone. Exemplarily, the fault state of the headphone may be directly divided into a faulty headphone with current noise and a non-faulty headphone without current noise according to the actual usage situation of whether there is current noise in the headphone, so as to facilitate the user to detect the sound quality of the headphone. The method of the embodiment of the present disclosure is applicable to identifying the fault state of the headphone through data analysis. For example, the fault state of whether there is current noise in the headphone is not limited in the embodiment of the present application.
[0060] Generally, when there is a current noise signal in the headphone, the sound pressure values corresponding to some frequency points in the background noise frequency response curve of the headphone will be significantly higher than the normal values. Based on this, in this embodiment, the characteristic parameters include multiple frequency points with abnormal sound pressure values in the background noise frequency response curve of the headphone. Optionally, the characteristic parameters may include all the frequency points with abnormal sound pressure values in the background noise frequency response curve of the headphone, or may include some of the multiple frequency points with abnormal sound pressure values in the background noise frequency response curve of the headphone. Specifically, the characteristic dimension of the characteristic parameters to be input to the mapping function for detecting the headphone can be set, that is, the number of characteristic parameters. For example, the characteristic dimension of the characteristic parameters to be input to the mapping function for detecting the headphone is three-dimensional. In this case, three frequency points can be selected from the multiple frequency points with abnormal sound pressure values in the background noise frequency response curve of the headphone as the characteristic parameters for detecting whether there is a fault state of current noise in the headphone, where the parameter value corresponding to each characteristic parameter, that is, the sound pressure value corresponding to each frequency point.
[0061] The following uses a specific embodiment to illustrate the process of obtaining the parameter values of the to-be-detected headphone for the set characteristic parameters.
[0062] In one embodiment, the obtaining of the parameter value of the to-be-detected earphone for a set characteristic parameter may further include: when the to-be-detected earphone is in a playing state, processing the audio signal output by the to-be-detected earphone to obtain a first background noise frequency response curve; determining a plurality of first frequency points where the sound pressure value in the first background noise frequency response curve is abnormal; selecting a plurality of target frequency points from the plurality of first frequency points, and using the sound pressure values corresponding to the plurality of target frequency points as the parameter value for the set characteristic parameter.
[0063] In this embodiment, when the earphone is in a playing state, the power amplifier integrated circuit (IC) will be muted by the control system of the earphone. When the signal input to the signal input end of the earphone triggers the power amplifier IC to turn on, there will be an output of current sound noise at the speaker output end of the earphone. Based on this, when the to-be-detected earphone is in a playing state, obtain the audio signal output by the to-be-detected earphone and process the audio signal to obtain a first background noise frequency response curve.
[0064] Exemplarily, when the to-be-detected earphone is in a playing state, obtain the audio signal output by the to-be-detected earphone within a preset time period, and perform a Fourier transform on the audio signal to obtain a first background noise frequency response curve.
[0065] In one embodiment, an outlier detection algorithm is used to determine a plurality of first frequency points where the sound pressure value in the first background noise frequency response curve is abnormal. Among them, the first frequency point is a frequency point corresponding to a sound pressure value greater than a preset threshold. In this embodiment, the specific value of the preset threshold can be determined according to experience. This embodiment does not limit the specific value of the preset threshold.
[0066] In this embodiment, the target frequency points as the set characteristic parameter may include all the first frequency points where the abnormality exists in the first background noise frequency response curve, or may include some of the first frequency points where the abnormality exists in the first background noise frequency response curve.
[0067] In this embodiment, process the audio signal output by the to-be-detected earphone when it is in a playing state to obtain a first background noise frequency response curve, and determine a plurality of first frequency points where the sound pressure value in the first background noise frequency response curve is abnormal, so as to select a plurality of target frequency points from the plurality of first frequency points, and use the sound pressure values corresponding to the plurality of target frequency points as the parameter value of the characteristic parameter, and input it into the mapping function between the characteristic parameter and the fault state to obtain the detection result of whether the to-be-detected earphone has a current sound fault state.
[0068] In one embodiment, the step of selecting a plurality of target frequency points from the plurality of first frequency points and using the sound pressure values corresponding to the plurality of target frequency points as the parameter values of a set characteristic parameter may further include: removing second frequency points from the plurality of first frequency points to obtain a plurality of target frequency points; and using the sound pressure values corresponding to the plurality of target frequency points as the parameter values of the set characteristic parameter.
[0069] In this embodiment, the second frequency points are the frequency points where the sound pressure values in the second background noise frequency response curve are abnormal. The second background noise frequency response curve is a background noise frequency response curve obtained by processing the audio signal output when the earphone to be detected is not in the playing state. Exemplarily, when the earphone to be detected is not in the playing state, an audio signal output by the earphone to be detected within a preset time duration is acquired, and a Fourier transform is performed on the audio signal to obtain the second background noise frequency response curve.
[0070] In specific implementation, the earphone to be detected is communicatively connected to an electronic device. Based on the communicative connection between the earphone to be detected and the electronic device, the earphone to be detected is controlled to be in the playing state. When the earphone to be detected is in the playing state, an audio signal output by the earphone to be detected is acquired, and a first background noise frequency response curve is obtained by processing the audio signal. An outlier detection algorithm is used to determine a plurality of first frequency points where the sound pressure values in the first background noise frequency response curve are abnormal. Then, the communicative connection between the earphone to be detected and the electronic device is disconnected to acquire an audio signal output when the earphone to be detected is not in the playing state, and a second background noise frequency response curve is obtained by processing the audio signal. An outlier detection algorithm is used to determine a plurality of second frequency points where the sound pressure values in the second background noise frequency response curve are abnormal. Then, the frequency points in the plurality of first frequency points that have the same frequency as the plurality of second frequency points are removed to obtain a plurality of target frequency points. Then, the sound pressure values corresponding to the plurality of target frequency points are used as the parameter values of the characteristic parameter and input into the mapping function between the characteristic parameter and the fault state to obtain the detection result of whether the earphone to be detected has a current noise fault state. It should be noted here that the sound pressure value corresponding to the target frequency point can be a relative sound pressure value, that is, the difference between the actual sound pressure value corresponding to the target frequency point and the average sound pressure value, where the average sound pressure value can be determined according to the sound pressure values corresponding to each frequency point in the first background noise frequency response curve.
[0071] Optionally, after removing the frequency points in the plurality of first frequency points that have the same frequency as the plurality of second frequency points to obtain a plurality of target frequency points, some of the frequency points in the plurality of target frequency points can be used as the set characteristic parameter according to the characteristic dimension of the mapping function between the characteristic parameter and the fault state. For example, assuming that the characteristic dimension of the mapping function between the characteristic parameter and the fault state is 3, three frequency points with larger sound pressure values among the plurality of target frequency points are selected as the three characteristic parameters input into the mapping function.
[0072] In this embodiment, the second frequency points among multiple first frequency points are eliminated to obtain multiple target frequency points, and the sound pressure values corresponding to the multiple target frequency points are used as the parameter values for a set characteristic parameter, so as to detect whether there is current noise in the earphone according to some selected target frequency points. In this way, the frequency points with abnormal sound pressure values introduced by environmental sound signals among the frequency points with abnormal sound pressure values in the first background noise frequency response curve can be eliminated, which can improve the accuracy of earphone detection, reduce the amount of calculation, improve the response speed, and reduce power consumption.
[0073] After step S2100, step S2200 is executed to obtain the fault state of whether there is current noise in the earphone to be detected according to the mapping function between the parameter value and the characteristic parameter and the fault state.
[0074] For the mapping function between the characteristic parameter and the fault state, the independent variable of the mapping function is the characteristic parameter x, that is, the sound pressure value corresponding to the frequency point with abnormal sound pressure value in the background noise frequency response curve of the earphone, and the dependent variable F(x) of the mapping function is the fault state of whether there is current noise in the earphone determined by the characteristic parameter x.
[0075] Taking the fault state of the earphone including the fault state of having current noise and the non-fault state of not having current noise as an example, it may be that the function value being true corresponds to the earphone to be detected being in the fault state of having current noise, that is, the earphone to be detected is a current noise earphone; the function value being false corresponds to the earphone to be detected being in the non-fault state of not having current noise, that is, the earphone to be detected is a good product earphone. Or it may be that the function value being true corresponds to the earphone to be detected being in the non-fault state of not having current noise, that is, the earphone to be detected is a good product earphone; the function value being false corresponds to the earphone to be detected being in the fault state of having current noise, that is, the earphone to be detected is a current noise earphone. As long as the function value can distinguish between the earphone to be detected being a good product earphone and a current noise earphone, the embodiments of the present disclosure do not limit this.
[0076] In this embodiment, after obtaining the parameter value of the characteristic parameter of the earphone to be detected according to step S2100, the parameter value can be substituted into the mapping function to obtain the fault state of whether there is current noise in the earphone to be detected.
[0077] In this embodiment, before obtaining the fault state of whether there is current noise in the earphone to be detected according to the mapping function between the parameter value and the characteristic parameter and the fault state, it further includes the step of obtaining the mapping function between the characteristic parameter and the fault state.
[0078] In one embodiment, the step of obtaining the mapping function between the characteristic parameter and the fault state may further include: step S3100 to step S3200.
[0079] Step S3100: Obtain the headphones with accurate fault status as training samples.
[0080] According to this step S3100, a mapping function between the set feature parameters and the fault status of the headphones can be obtained by training the mapping function with the training samples.
[0081] In this embodiment, the more training samples are obtained, the more accurate the training result is usually. However, after the number of training samples reaches a certain amount, the increase in the accuracy of the training result becomes slower and slower until it tends to be stable. In this regard, the number of training samples required can be determined by taking into account both the accuracy of the training result and the data processing cost.
[0082] In a more specific example, the step of obtaining the headphones with accurate fault status as training samples may further include: steps S3110 to S3140.
[0083] Step S3110: Obtain the first set number of headphones with accurate fault status as the first training samples.
[0084] In this step, a small number of samples can be selected for manual annotation of the fault status of whether there is current noise in the headphones to provide the first training samples. Taking the fault status of the headphones including the fault status of having current noise and the non-fault status of not having current noise as an example, the training samples include the headphones belonging to the fault status and the headphones belonging to the non-fault status.
[0085] Exemplarily, obtain the first set number of headphones with accurate fault status, obtain the corresponding first background noise frequency response curve for each headphone, determine a plurality of first frequency points with abnormal sound pressure values in the first background noise frequency response curve, eliminate the second frequency points among the plurality of first frequency points to obtain a plurality of target frequency points, and annotate the sound pressure values corresponding to the plurality of target frequency points to obtain one of the training samples. Among them, the second frequency point is the frequency point with abnormal sound pressure value in the second background noise frequency response curve, and the second background noise frequency response curve is the background noise frequency response curve obtained by processing the audio signal output when the headphone to be detected is not in the playing state. It can be understood here that the steps of determining the first background noise frequency response curve and the steps of determining the target frequency points refer to the above embodiments and will not be elaborated here.
[0086] Step S3120: Obtain the second set number of headphones as the second training samples.
[0087] In this step, the fault status of each headphone in the second training samples is in an unknown state. Specifically, a certain amount of samples can be selected without manual annotation of the fault status of the headphones to provide the second training samples. Optionally, the second set number can be much larger than the first set number.
[0088] Exemplarily, obtain a second set number of earphones with unknown fault states, obtain the first background noise frequency response curve corresponding to each earphone among them, determine a plurality of first frequency points where the sound pressure value in the first background noise frequency response curve is abnormal, remove the second frequency points among the plurality of first frequency points to obtain a plurality of target frequency points, and use the sound pressure values corresponding to the plurality of target frequency points as one of the training samples. Wherein, the second frequency points are the frequency points where the sound pressure value in the second background noise frequency response curve is abnormal, and the second background noise frequency response curve is the background noise frequency response curve obtained by processing the audio signal output when the earphone to be detected is not in the playing state. It can be understood here that the steps of determining the first background noise frequency response curve and the steps of determining the target frequency points refer to the above embodiments and will not be elaborated here.
[0089] Step S3130, cluster the second training samples according to the first training samples to obtain the fault states of whether there is current noise in each earphone in the second training samples.
[0090] Exemplarily, the first training samples can be used to cluster the second training samples by using a Gaussian mixture model to determine the fault states of whether there is current noise in each earphone in the second training samples.
[0091] Step S3140, use the first training samples and the clustered second training samples as training samples.
[0092] In this step, it can be to use the first training samples obtained according to step S3110 and the clustered second training samples obtained according to step S3130 as training samples. Since the fault state of each earphone in this training sample is a known state, thus, the mapping function can be accurately trained according to the fault state of this training sample.
[0093] In this embodiment, a small number of first training samples with accurate fault states can be used to cluster a large number of second training samples with unknown fault states to determine the fault states of whether there is current noise in each earphone in the second training samples, and both the first training samples and the clustered second training samples are used as training samples to train the mapping function. In this way, a small number of training samples with accurate fault states are used to determine the fault states of the earphones in a large number of training samples with unknown fault states, thereby, the labor cost can be reduced, the efficiency and accuracy of obtaining training samples can be improved, and further the efficiency and accuracy of training the mapping function can be improved.
[0094] After step S3100, execute step S3200, and obtain the mapping function between the characteristic parameter and the fault state according to the parameter value of the characteristic parameter for the training sample and the fault state corresponding to the training sample of whether there is current noise.
[0095] In this step, based on the parameter values of the feature parameters of the training samples and the corresponding fault states, mapping functions can be obtained through various fitting means. Exemplarily, a mapping function between the feature parameters and the fault states of the earphones is obtained by training with SVM (Support Vector Machine).
[0096] In this embodiment, earphones with accurate fault states are obtained as training samples. Based on the parameter values of the feature parameters of the training samples and the fault states corresponding to whether there is current noise in the training samples, a mapping function between the feature parameters and the fault states with high accuracy can be obtained, so that the fault states of the earphones to be detected can be accurately obtained.
[0097] According to the embodiments of the present disclosure, before the earphones leave the factory, based on the parameter values of multiple feature parameters reflecting the fault states of whether there is current noise in the earphones and the mapping function between the feature parameters and the fault states of the earphones, it can be detected whether there is current noise in the earphones, which can improve the accuracy of earphone sound quality detection. Moreover, there is no need for a dedicated auditioner to identify by listening, and automatic detection of earphone sound quality can be realized, thereby improving the detection efficiency.
[0098] <Device Embodiment>
[0099] Embodiments of the present disclosure provide an earphone detection device, as Figure 3 shown. The earphone detection device 300 may include a first acquisition module 310 and a detection module 320.
[0100] The first acquisition module 310 may be configured to acquire the parameter values of the set feature parameters for the earphones to be detected, where the feature parameters include multiple parameters reflecting the fault states of whether there is current noise in the earphones.
[0101] The detection module 320 may be configured to obtain the fault state of whether there is current noise in the earphones to be detected according to the parameter values and the mapping function between the feature parameters and the fault states.
[0102] In one embodiment, the feature parameters include multiple frequency points with abnormal sound pressure values in the background noise frequency response curve of the earphones.
[0103] In one embodiment, the first acquisition module 310 may include:
[0104] A frequency response curve acquisition unit, configured to process the audio signal output by the earphones to be detected when the earphones to be detected are in the playing state, to obtain a first background noise frequency response curve;
[0105] An abnormal frequency point determination unit, configured to determine multiple first frequency points with abnormal sound pressure values in the first background noise frequency response curve;
[0106] A feature parameter selection unit, configured to select a plurality of target frequency points from the plurality of first frequency points, and use the sound pressure values corresponding to the plurality of target frequency points as the parameter values for a set feature parameter.
[0107] In one embodiment, the feature parameter selection unit is specifically configured to: remove the second frequency points from the plurality of first frequency points to obtain a plurality of target frequency points; use the sound pressure values corresponding to the plurality of target frequency points as the parameter values for a set feature parameter; wherein, the second frequency points are the frequency points where the sound pressure values are abnormal in the second background noise frequency response curve, and the second background noise frequency response curve is a background noise frequency response curve obtained by processing the audio signal output when the to-be-detected earphone is not in the playing state.
[0108] In one embodiment, the abnormal frequency point determination unit is specifically configured to use an outlier detection algorithm to determine a plurality of first frequency points where the sound pressure values are abnormal in the first background noise frequency response curve.
[0109] In one embodiment, the earphone detection device 300 may further include:
[0110] A second acquisition module, configured to acquire the earphones with accurate fault states as training samples;
[0111] A training module, configured to obtain a mapping function between the feature parameter and the fault state according to the parameter values of the feature parameter for the training samples and the fault states corresponding to the training samples indicating whether there is current noise.
[0112] In one embodiment, the second acquisition module is specifically configured to: acquire a first set number of earphones with accurate fault states as the first training samples; acquire a second set number of earphones as the second training samples; perform clustering on the second training samples according to the first training samples to obtain the fault states indicating whether there is current noise for each earphone in the second training samples; use the first training samples and the clustered second training samples as the training samples.
[0113] According to the embodiments of the present disclosure, before the earphones leave the factory, it is possible to detect whether there is current noise in the earphones according to the parameter values of a plurality of feature parameters reflecting the fault states of the earphones indicating whether there is current noise, and the mapping function between the feature parameters and the fault states of the earphones, which can improve the accuracy of earphone sound quality detection. Moreover, there is no need for a dedicated auditioner to identify by listening, and automatic detection of earphone sound quality can be achieved, thereby improving the detection efficiency.
[0114] <Device Embodiment>
[0115] Figure 4It is a schematic diagram of the hardware structure of an electronic device according to an embodiment. As Figure 4 shown, the electronic device 400 includes a memory 410 and a processor 420.
[0116] The memory 410 can be used to store executable computer instructions.
[0117] The processor 420 can be used to execute the headphone detection method according to the method embodiment of the present disclosure under the control of the executable computer instructions.
[0118] The electronic device 400 can be the electronic device 1000 as Figure 1 shown, or can be a device with other hardware structures, which is not limited herein. The electronic device 400 can be, for example, a mobile phone, a portable computer, a tablet computer, a palm computer, etc., and the embodiments of the present disclosure do not limit this.
[0119] The electronic device 400 is provided with an artificial ear card slot. When detecting a headphone, the headphone to be detected can be placed in the artificial ear card slot to obtain the audio signal output by the headphone to be detected, and the collected audio signal is processed to obtain the background noise frequency response curve of the headphone to be detected, so as to detect whether there is a current sound in the headphone based on the background noise frequency response curve.
[0120] In another embodiment, the electronic device 400 can include the above headphone detection device 300.
[0121] In one embodiment, each module of the above headphone detection device 300 can be implemented by the processor 420 running the computer instructions stored in the memory 410.
[0122] According to the embodiment of the present disclosure, before the headphone leaves the factory, it is possible to detect whether there is a current sound in the headphone according to the parameter values of a plurality of characteristic parameters reflecting the fault state of whether there is a current sound in the headphone and the mapping function between the characteristic parameters and the fault state of the headphone, which can improve the accuracy of headphone sound quality detection. And there is no need for a dedicated auditioner to identify by listening, and automatic detection of headphone sound quality can be realized, thereby improving the detection efficiency.
[0123] <Computer-readable storage medium>
[0124] The embodiment of the present disclosure also provides a computer-readable storage medium, on which computer instructions are stored, and when the computer instructions are run by a processor, the headphone detection method provided by the embodiment of the present disclosure is executed.
[0125] The embodiments of the present disclosure can be a system, a method, and / or a computer program product. The computer program product can include a computer-readable storage medium, on which computer-readable program instructions for causing a processor to implement various aspects of the embodiments of the present disclosure are uploaded.
[0126] A computer-readable storage medium can be a tangible device that can hold and store instructions for use by an instruction execution device. A computer-readable storage medium may be, for example—but not limited to—an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disc (DVD), a memory stick, a floppy disk, a mechanically encoded device such as a punched card or raised structures in grooves having instructions stored thereon, and any suitable combination of the foregoing. The computer-readable storage medium as used herein is not construed as being a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., an optical pulse through an optical fiber cable), or an electrical signal transmitted through a wire.
[0127] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to respective computing / processing devices, or can be downloaded to an external computer or an external storage device through a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network may include a copper transmission cable, an optical fiber transmission, a wireless transmission, a router, a firewall, a switch, a gateway computer, and / or an edge server. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing / processing device.
[0128] The computer program instructions for performing the operations of the embodiments of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine - related instructions, microcode, firmware instructions, state - setting data, or source code or object code written in any combination of one or more programming languages, including object - oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer - readable program instructions may be executed entirely on the user's computer, partially on the user's computer, executed as a stand - alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider). In some embodiments, by using the state information of the computer - readable program instructions to customize an electronic circuit, such as a programmable logic circuit, a field - programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit can execute the computer - readable program instructions to implement various aspects of the embodiments of the present disclosure.
[0129] Aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer - readable program instructions.
[0130] These computer - readable program instructions can be provided to a processor of a general - purpose computer, a special - purpose computer, or other programmable data - processing apparatus to produce a machine such that the instructions, when executed by the processor of the computer or other programmable data - processing apparatus, create a means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer - readable program instructions can also be stored in a computer - readable storage medium, which causes a computer, a programmable data - processing apparatus, and / or other devices to operate in a particular manner, so that the computer - readable medium storing the instructions includes a manufacture, which includes instructions for implementing various aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0131] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices, causing a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other devices to produce a computer-implemented process, such that the instructions executed on the computer, other programmable data processing apparatus, or other devices implement the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0132] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a portion of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two consecutive blocks may in fact be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functionality involved. It should also be noted that each block of the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or actions, or by a combination of dedicated hardware and computer instructions. As is well known to those of ordinary skill in the art, implementations through hardware, through software, and through a combination of software and hardware are equivalent.
[0133] The embodiments of the present disclosure have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art in the technical field without departing from the scope and spirit of the described embodiments. The selection of the terms used herein is intended to best explain the principles of the embodiments, the practical application, or the improvement of the technology in the market, or to enable other ordinary skill in the technical field to understand the embodiments disclosed herein. The scope of the embodiments of the present disclosure is defined by the appended claims.
Claims
1. A headphone detection method, characterized in that, Including: Obtaining a parameter value of a to-be-detected earphone for a set characteristic parameter, where the characteristic parameter includes a plurality of parameters reflecting a fault state of whether there is a current sound in the earphone; Obtaining a fault state of whether there is a current sound in the to-be-detected earphone according to the parameter value and a mapping function between the characteristic parameter and the fault state; The obtaining a parameter value of a to-be-detected earphone for a set characteristic parameter includes: When the to-be-detected earphone is in a playing state, processing an audio signal output by the to-be-detected earphone to obtain a first background noise frequency response curve; Determining a plurality of first frequency points where sound pressure values are abnormal in the first background noise frequency response curve; Selecting a plurality of target frequency points from the plurality of first frequency points, and using the sound pressure values corresponding to the plurality of target frequency points as parameter values for the set characteristic parameter; The selecting a plurality of target frequency points from the plurality of first frequency points and using the sound pressure values corresponding to the plurality of target frequency points as parameter values for the set characteristic parameter includes: Removing second frequency points from the plurality of first frequency points to obtain a plurality of target frequency points; Using the sound pressure values corresponding to the plurality of target frequency points as parameter values for the set characteristic parameter; Wherein, the second frequency point is a frequency point where the sound pressure value is abnormal in a second background noise frequency response curve, and the second background noise frequency response curve is a background noise frequency response curve obtained by processing an audio signal output when the to-be-detected earphone is not in a playing state; The determining a plurality of first frequency points where sound pressure values are abnormal in the first background noise frequency response curve includes: Using an outlier detection algorithm to determine a plurality of first frequency points where sound pressure values are abnormal in the first background noise frequency response curve.
2. The method according to claim 1, characterized in that, The characteristic parameter includes a plurality of frequency points where the sound pressure value is abnormal in the background noise frequency response curve of the earphone.
3. The method according to any one of claims 1-2, characterized in that The method further includes a step of obtaining a mapping function between the characteristic parameter and the fault state, including: Obtaining an earphone with an accurate fault state as a training sample; Obtaining a mapping function between the characteristic parameter and the fault state according to the parameter value of the training sample for the characteristic parameter and the fault state of whether there is a current sound corresponding to the training sample.
4. The method according to claim 1, characterized in that The obtaining an earphone with an accurate fault state as a training sample includes: Obtaining a first set number of earphones with accurate fault states as a first training sample; Obtaining a second set number of earphones as a second training sample; Clustering the second training sample according to the first training sample to obtain a fault state of whether there is a current sound in each earphone of the second training sample; Using the first training sample and the clustered second training sample as training samples.
5. A headphone detection device, characterized in that, Including: A first obtaining module, configured to obtain a parameter value of a to-be-detected earphone for a set characteristic parameter, where the characteristic parameter includes a plurality of parameters reflecting a fault state of whether there is a current sound in the earphone; A detection module, configured to obtain a fault state of whether there is a current sound in the to-be-detected earphone according to the parameter value and a mapping function between the characteristic parameter and the fault state; When the headphone to be detected is in the playing state, the detection module is further configured to process the audio signal output by the headphone to be detected to obtain a first background noise frequency response curve; determine a plurality of first frequency points with abnormal sound pressure values in the first background noise frequency response curve; select a plurality of target frequency points from the plurality of first frequency points, and use the sound pressure values corresponding to the plurality of target frequency points as the parameter values for a set characteristic parameter; The detection module is further configured to remove second frequency points from the plurality of first frequency points to obtain a plurality of target frequency points; use the sound pressure values corresponding to the plurality of target frequency points as the parameter values for a set characteristic parameter; wherein, the second frequency points are determined by an outlier detection algorithm, and the second frequency points are frequency points with abnormal sound pressure values in a second background noise frequency response curve, and the second background noise frequency response curve is a background noise frequency response curve obtained by processing the audio signal output when the headphone to be detected is not in the playing state; use the outlier detection algorithm to determine a plurality of second frequency points with abnormal sound pressure values in the second background noise frequency response curve; The detection module is further configured to use the outlier detection algorithm to determine a plurality of first frequency points with abnormal sound pressure values in the first background noise frequency response curve.
6. An electronic device, characterized in that, Comprising: a memory for storing executable computer instructions; a processor for executing the headphone detection method according to any one of claims 1-4 under the control of the executable computer instructions.
7. A computer-readable storage medium having computer instructions stored thereon, and when the computer instructions are run by a processor, the headphone detection method according to any one of claims 1-4 is executed.
Citation Information
Patent Citations
Power distribution network fault diagnosis method based on deep feature clustering and LSTM
CN112381248A
Audio playing equipment detection method and device, equipment and storage medium
CN113329315A