CN117440282A - Earphone wearing state detection method and device, earphone and storage medium - Google Patents
Earphone wearing state detection method and device, earphone and storage medium Download PDFInfo
- Publication number
- CN117440282A CN117440282A CN202311558831.6A CN202311558831A CN117440282A CN 117440282 A CN117440282 A CN 117440282A CN 202311558831 A CN202311558831 A CN 202311558831A CN 117440282 A CN117440282 A CN 117440282A
- Authority
- CN
- China
- Prior art keywords
- feedforward
- feedback
- audio signal
- earphone
- wearing state
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 75
- 238000003860 storage Methods 0.000 title claims abstract description 13
- 230000005236 sound signal Effects 0.000 claims abstract description 262
- 238000001228 spectrum Methods 0.000 claims abstract description 123
- 238000004458 analytical method Methods 0.000 claims abstract description 57
- 238000000034 method Methods 0.000 claims abstract description 57
- 230000006870 function Effects 0.000 claims description 14
- 238000010219 correlation analysis Methods 0.000 claims description 7
- 238000009432 framing Methods 0.000 claims description 7
- 238000010586 diagram Methods 0.000 description 14
- 230000008569 process Effects 0.000 description 10
- 238000004891 communication Methods 0.000 description 9
- 230000003287 optical effect Effects 0.000 description 9
- 230000007613 environmental effect Effects 0.000 description 6
- 210000000613 ear canal Anatomy 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 238000009826 distribution Methods 0.000 description 2
- 238000005259 measurement Methods 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000007257 malfunction Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000010183 spectrum analysis Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R1/00—Details of transducers, loudspeakers or microphones
- H04R1/10—Earpieces; Attachments therefor ; Earphones; Monophonic headphones
- H04R1/1041—Mechanical or electronic switches, or control elements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R3/00—Circuits for transducers, loudspeakers or microphones
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R2201/00—Details of transducers, loudspeakers or microphones covered by H04R1/00 but not provided for in any of its subgroups
- H04R2201/10—Details of earpieces, attachments therefor, earphones or monophonic headphones covered by H04R1/10 but not provided for in any of its subgroups
- H04R2201/105—Manufacture of mono- or stereophonic headphone components
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R2420/00—Details of connection covered by H04R, not provided for in its groups
- H04R2420/05—Detection of connection of loudspeakers or headphones to amplifiers
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Acoustics & Sound (AREA)
- Signal Processing (AREA)
- Headphones And Earphones (AREA)
Abstract
The invention relates to the field of terminal control and discloses a method and a device for detecting the wearing state of an earphone, the earphone and a storage medium, wherein the method collects a feedforward audio signal and a feedback audio signal when detecting a request for detecting the wearing state of the earphone; respectively carrying out frequency domain analysis on the feedforward audio signal and the feedback audio signal to obtain a feedforward signal frequency spectrum and a feedback signal frequency spectrum; obtaining target feedforward information and target feedback information from a feedforward signal spectrum and a feedback signal spectrum respectively; and comparing the target feedforward information with the target feedback information, and determining the wearing state of the earphone according to the comparison result. The accuracy of the earphone wearing state detection is improved by comparing the target feedforward information and the target feedback information of the feedforward audio signal and the feedback audio signal in the frequency domain, and the energy loss caused by the misjudgment of the earphone is further reduced.
Description
Technical Field
The present invention relates to the field of terminal control technologies, and in particular, to a method and apparatus for detecting a wearing state of an earphone, and a storage medium.
Background
In recent years, the market of TWS headphones (True Wireless Stereo, true wireless headphones) has been increasing in temperature, and the TWS headphones are popular with consumers because they are small and portable and very convenient to use. The TWS earphone at the middle and high ends at present supports the in-ear detection function, can easily realize automatic music playing after wearing, and automatically pauses music when being taken off, so that the whole earphone becomes more intelligent and saves power consumption.
Currently, the main detection schemes of the wearing state of TWS headphones mainly comprise a capacitive sensor detection scheme and an optical sensor detection scheme. The capacitance scheme is to judge whether the earphone is in the ear or not by sensing the capacitance value of the human body. The capacitive detection scheme has the advantages of lower cost, no holes are needed in the shell, and the shell is more attractive; the disadvantage is a high malfunction rate. The optical detection scheme is to judge whether the earphone is in the ear or not by utilizing the level signals transmitted, reflected and received by infrared light, and compared with the capacitive detection scheme, the optical detection scheme has the advantages of higher precision, higher cost, misoperation in certain scenes and high requirements on the production and assembly process.
However, the two schemes are easy to misjudge that the earphone is in an in-ear state. For example, in the common scenes that the earphone is taken down on a table, held in a hand, put in a pocket and the like, misjudgment is easy to occur on the light sensor or the capacitance sensor, and the misjudgment earphone is in an in-ear state, so that wearing detection is inaccurate, user experience is affected, and meanwhile, power consumption of the earphone is increased.
The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present invention and is not intended to represent an admission that the foregoing is prior art.
Disclosure of Invention
The invention mainly aims to provide a method and a device for detecting the wearing state of an earphone, the earphone and a storage medium, and aims to solve the technical problem of low accuracy of detecting the wearing state of the earphone in the prior art.
In order to achieve the above object, the present invention provides a method for detecting a wearing state of an earphone, including:
when detecting a headset wearing state detection request, collecting a feedforward audio signal and a feedback audio signal;
frequency domain analysis is carried out on the feedforward audio signal and the feedback audio signal respectively, so that a feedforward signal spectrum and a feedback signal spectrum are obtained;
obtaining target feedforward information and target feedback information from the feedforward signal spectrum and the feedback signal spectrum respectively;
comparing the target feedforward information with the target feedback information, and determining the wearing state of the earphone according to a comparison result.
Optionally, the frequency domain analysis is performed on the feedforward audio signal and the feedback audio signal respectively to obtain a feedforward signal spectrum and a feedback signal spectrum, including:
Respectively carrying out signal framing on the feedforward audio signal and the feedback audio signal to obtain a feedforward signal frame and a feedback signal frame;
processing the feedforward signal frame and the feedback signal frame through a window function respectively to obtain a feedforward window frame and a feedback window frame;
and respectively carrying out fast Fourier transform on the feedforward window frame and the feedback window frame to obtain a feedforward signal spectrum and a feedback signal spectrum.
Optionally, the obtaining target feedforward information and target feedback information from the feedforward signal spectrum and the feedback signal spectrum respectively includes:
respectively acquiring a feedforward characteristic mean value and a feedback characteristic mean value in a preset range from the feedforward signal spectrum and the feedback signal spectrum;
determining a feedforward feature level of the feedforward audio signal according to the feedforward feature mean value;
determining a feedback feature level of the feedback audio signal according to the feedback feature mean value;
wherein the target feedforward information includes the feedforward feature stage; the target feedback information includes the feedback feature level.
Optionally, before the frequency domain analysis is performed on the feedforward audio signal and the feedback audio signal, the method further includes:
Performing differential feature analysis on the feedforward audio signal and the feedback audio signal to obtain differential feature values of the feedforward audio signal and the feedback audio signal;
if the difference characteristic value is not lower than a preset difference characteristic maximum threshold value, determining that the wearing state of the earphone is in-ear state;
the preset maximum difference characteristic threshold is used for representing the maximum difference characteristic value of the feedback audio signal and the feedforward audio signal in the in-ear state.
Optionally, the method further comprises:
if the difference characteristic value is lower than the preset difference characteristic maximum threshold value, carrying out correlation analysis on the feedforward audio signal and the feedback audio signal, and determining a correlation coefficient;
if the correlation coefficient is higher than a preset correlation coefficient maximum threshold, determining that the wearing state of the earphone is an ear-out state;
and if the correlation coefficient is lower than a preset correlation coefficient minimum threshold value, or if the correlation coefficient is between the preset correlation coefficient minimum threshold value and the preset correlation coefficient maximum threshold value and the difference characteristic value is higher than a preset difference characteristic minimum threshold value, determining that the wearing state of the earphone is in-ear state.
Optionally, the method further comprises:
and if the correlation coefficient is between the preset correlation coefficient minimum threshold and the preset correlation coefficient maximum threshold, executing the frequency domain analysis on the feedforward audio signal and the feedback audio signal respectively, wherein the difference characteristic value is not higher than the preset difference characteristic minimum threshold.
Optionally, before detecting the earphone wearing state detection request, the method further includes:
generating a headset wearing state detection request at regular time;
or when the sensor of the earphone recognizes that the wearing state of the earphone is switched to the in-ear state, generating an earphone wearing state detection request.
In addition, to achieve the above object, the present invention also proposes an earphone wearing state detection device including:
the audio acquisition module is used for acquiring a feedforward audio signal and a feedback audio signal when detecting a headset wearing state detection request;
the frequency domain analysis module is used for respectively carrying out frequency domain analysis on the feedforward audio signal and the feedback audio signal to obtain a feedforward signal frequency spectrum and a feedback signal frequency spectrum;
the information analysis module is used for respectively obtaining target feedforward information and target feedback information from the feedforward signal spectrum and the feedback signal spectrum;
And the state judging module is used for comparing the target feedforward information with the target feedback information and determining the wearing state of the earphone according to a comparison result.
In addition, in order to achieve the above object, the present invention also proposes an earphone including a memory, a processor, and an earphone wearing state detection program stored on the memory and executable on the processor, the earphone wearing state detection program being configured to implement the steps of the earphone wearing state detection method as described above.
In addition, in order to achieve the above object, the present invention also proposes a storage medium having stored thereon a headphone wearing state detection program which, when executed by a processor, implements the steps of the headphone wearing state detection method as described above.
When detecting a headset wearing state detection request, the invention collects a feedforward audio signal and a feedback audio signal; respectively carrying out frequency domain analysis on the feedforward audio signal and the feedback audio signal to obtain a feedforward signal frequency spectrum and a feedback signal frequency spectrum; obtaining target feedforward information and target feedback information from a feedforward signal spectrum and a feedback signal spectrum respectively; and comparing the target feedforward information with the target feedback information, and determining the wearing state of the earphone according to the comparison result. The accuracy of earphone wearing state detection is improved by comparing the target feedforward information and the target feedback information of the feedforward audio signal and the feedback audio signal in the frequency domain; the wearing detection prompt tone is not required to be played, and the limitation of detecting the wearing state of the earphone by playing the prompt tone is avoided; meanwhile, the energy loss caused by misjudgment of the earphone is reduced.
Drawings
FIG. 1 is a schematic diagram of a headset of a hardware operating environment according to an embodiment of the present invention;
fig. 2 is a flowchart of a first embodiment of a method for detecting a wearing state of an earphone according to the present invention;
FIG. 3 is a flowchart of a second embodiment of the method for detecting a wearing state of an earphone according to the present invention;
fig. 4 is a schematic diagram of a weighted sound pressure level of FB/FF MIC in-ear and out-ear states of the method for detecting a wearing state of an earphone according to the present invention;
FIG. 5 is a diagram showing the difference between the weighting sound pressure of the in-ear state and the out-ear state of the method for detecting the wearing state of the earphone according to the present invention;
fig. 6 is a flowchart of a third embodiment of the method for detecting a wearing state of an earphone according to the present invention;
FIG. 7 is a schematic diagram of the Brabender distance between feedforward audio signals and feedback audio signals in different states according to the method for detecting the wearing state of an earphone of the present invention;
FIG. 8 is a schematic diagram of correlation coefficients of feedforward audio signals and feedback audio signals in different states according to the method for detecting a wearing state of an earphone of the present invention;
FIG. 9 is a schematic diagram of a system for an application scenario of the method for detecting a wearing state of an earphone according to the present invention;
FIG. 10 is a system flow chart of an application scenario of the earphone wearing state detection method of the present invention;
fig. 11 is a block diagram showing the structure of a first embodiment of the earphone wearing state detecting apparatus according to the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application. Meanwhile, in the description of the embodiments of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
Referring to fig. 1, fig. 1 is a schematic diagram of an earphone structure of a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the headset 1000 may include a processor 1001 having one or more processing cores, a memory 1002 having one or more computer-readable storage media, and a headset wear state detection program stored on the memory 1002 and executable on the processor. The processor 1001 is electrically connected to the memory 1002. It will be appreciated by those skilled in the art that the headset structure shown in the figures is not limiting and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The processor 1001 is a control center of the headphone 1000, connects respective portions of the entire headphone 1000 using various interfaces and lines, and performs various functions of the headphone 1000 and processes data by running or loading software programs and/or units stored in the memory 1002, and calling data stored in the memory 1002. The processor 1001 may be a processor CPU, a network processor (Network Processor, NP), or the like, and may implement or execute the methods, steps, and logic blocks disclosed in the embodiments of the present application.
In this embodiment of the present application, the processor 1001 in the headset 1000 loads instructions corresponding to the processes of one or more application programs into the memory 1002 according to the following steps, and the processor 1001 executes the application programs stored in the memory 1002, so as to implement various functions, for example:
When detecting a headset wearing state detection request, collecting a feedforward audio signal and a feedback audio signal;
frequency domain analysis is carried out on the feedforward audio signal and the feedback audio signal respectively, so that a feedforward signal spectrum and a feedback signal spectrum are obtained;
obtaining target feedforward information and target feedback information from the feedforward signal spectrum and the feedback signal spectrum respectively;
comparing the target feedforward information with the target feedback information, and determining the wearing state of the earphone according to a comparison result.
Further, the various functions implemented by running the application program stored in the memory 1002 may also be referred to as descriptions in the foregoing embodiments, and will not be described herein.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Optionally, as shown in fig. 1, the earphone 1000 further comprises a radio frequency circuit 1003, an audio circuit 1004, an input unit 1005, and a power supply 1006. The processor 1001 is electrically connected to the radio frequency circuit 1003, the audio circuit 1004, the input unit 1005, and the power supply 1006. It will be appreciated by those skilled in the art that the headset structure shown in fig. 1 is not limiting and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The radio frequency circuit 1003 may be configured to receive and transmit radio frequency signals to and transmit signals (e.g., audio signals to enable audio playback) to and from a network device or other headset, such as a terminal, via wireless communication.
The audio circuit 1004 may be used to play and capture audio signals through a speaker, microphone. The audio circuit 1004 may transmit the received electrical signal after audio data conversion to a speaker, where the electrical signal is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signals into electrical signals, which are received by the audio circuit 1004 and converted into audio data, which are processed by the audio data output processor 1001 and sent to, for example, another earphone via the radio frequency circuit 1003, or which are output to the memory 1002 for further processing.
The input unit 1005 may be used to receive input control information (e.g., volume adjustment information, song switching information, play speed fast forward, fast reverse information, etc.), and may optionally include a mechanical button.
The power supply 1006 is used to power the various components of the headset 1000. Alternatively, the power supply 1006 may be logically connected to the processor 1001 through a power management system, so as to perform functions of managing charging, discharging, and power consumption management through the power management system. The power supply 1006 may also include one or more of any of a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown in fig. 1, the headset 1000 may further include sensors (e.g., optical sensors, capacitive sensors, etc.), wireless fidelity modules, bluetooth modules, etc., which are not described in detail herein.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
As shown in fig. 1, a headphone wearing state detection program may be included in a memory 1002 as one of storage media.
In the earphone shown in fig. 1, a processor 1001 and a memory 1002 in the earphone of the present invention may be disposed in the earphone, and the earphone invokes an earphone wearing state detection program stored in the memory 1002 through the processor 1001, and executes the earphone wearing state detection method provided by the embodiment of the present invention.
An embodiment of the invention provides a method for detecting a wearing state of an earphone, and referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of the method for detecting a wearing state of an earphone.
In this embodiment, the method for detecting the wearing state of the earphone includes the following steps:
step S100: and when detecting the earphone wearing state detection request, collecting a feedforward audio signal and a feedback audio signal.
It should be noted that, the execution body of the method of the present embodiment may be a terminal device having functions of data processing, audio acquisition, data analysis and program running, for example, a computer, a sound processing device, an intelligent earphone, etc., or may be an electronic device having the same or similar functions, for example, the earphone set forth in the embodiment of the present invention. This embodiment and the following embodiments will be described below by taking the above-described headphones as an example.
In this embodiment, the above-described headphone wearing state detection request refers to a request for detecting a headphone wearing state. The wearing state of the earphone includes, but is not limited to, an in-ear state and an out-ear state. The in-ear state refers to a state that the earphone is worn and is positioned inside the ear of the user. The in-ear state includes a state in which the earphone has just entered the inside of the user's ear, and also includes a continuous state in which the earphone is located inside the user's ear. The out-of-ear state refers to a state in which the earphone is not worn, and the earphone is located outside the user's ear. For example, the state where the headphones are in the headphone case, the headphones are on a desk, the headphones are on a user's hand, the headphones are in a user's pocket, and the like are regarded as the on-state of the headphones as the out-of-ear state.
It should be noted that, the above-mentioned earphone refers to an earphone that needs to perform the detection of the wearing state of the earphone in this embodiment, such as an active noise reduction earphone, or an earphone that is one of real wireless pair-ear earphones. Specifically, if the earphone is one of the real wireless pair-ear earphone, the wireless connection mode between the earphone and the other earphone or between the earphone and the intelligent device may be at least one of WIFI communication mode, classical bluetooth communication mode, BLE communication mode, LE audio, ANT communication mode, RF4CE communication mode, zigbee communication mode, NFC communication mode, and UWB communication mode.
Optionally, the earphone wearing state detection request can be triggered according to actual conditions.
For example, before detecting the headphone wearing state detection request, the method further includes:
and generating a headset wearing state detection request at regular time.
In this example, the headphone wearing state detection request is generated at a timer trigger time point by timer timing, wherein a duration in generating the headphone wearing state detection request at the timer trigger time point by timer timing can be adjusted according to actual conditions. For example, the triggering time of the timer is 1.5 seconds, that is, every 1.5 seconds, the headphone wearing state detection request is generated. The earphone wearing state detection request is generated at reasonable timing, so that the earphone wearing state detection request can be responded quickly, the response efficiency of wearing detection is improved, and the user experience is improved.
When the timer is used for triggering, the earphone wearing state detection flow is required to be triggered at fixed time. If the timer triggering interval is too long (for example, more than 2 s) and affects the wearing detection effect and the user experience, the power consumption of the earphone is seriously increased if the timer triggering interval is shorter (for example, less than 1 s).
On the basis, the embodiment of the invention provides another optional earphone wearing state detection request generation mode:
and when the sensor of the earphone recognizes that the wearing state of the earphone is switched to the in-ear state, generating an earphone wearing state detection request.
In this example, according to the type of the earphone sensor, a signal related to the earphone sensor type is collected by the sensor of the earphone, and whether the wearing state of the earphone is changed is determined according to the collected signal. For example, when the earphone sensor is a capacitive sensor, the capacitive sensor of the earphone is used to collect a capacitance value, and whether the wearing state of the earphone is changed is determined according to the change of the capacitance value. For another example, when the earphone sensor is an optical sensor, the optical sensor of the earphone is used for collecting the level signal, and whether the wearing state of the earphone changes is determined according to the change of the level signal. When the sensor of the earphone determines that the wearing state of the earphone is switched to the in-ear state according to the acquired signals, an earphone wearing state detection request is generated. And determining that the wearing state of the earphone is switched to an in-ear state, for example, switching from an out-ear state to an in-ear state, and for example, switching from other states to an in-ear state. If the sensor of the earphone determines that the wearing state of the earphone is switched to the out-of-ear state according to the acquired signals, or the wearing state of the earphone is in the continuous out-of-ear state, or the wearing state of the earphone is in the continuous in-ear state, the sensor of the earphone continuously acquires the signals. The continuous in-ear state refers to that the duration time exceeds the preset duration time in the in-ear state, and the continuous in-ear state refers to that the duration time exceeds the preset duration time, and the preset duration time is set according to practical situations, for example, the preset duration time is 200 milliseconds.
Note that a feedback microphone (Feedback microphone, FB MIC) may be provided in the headphone. The feedback microphone may be disposed at a front end of a speaker of the earphone, and used for collecting an audio signal in a current environment. The above-mentioned audio includes, but is not limited to, friction sound with the ear canal when the earphone is in the ear, external environmental sound.
In this embodiment, when the audio includes a friction sound between the earphone and the ear canal when the earphone is in the ear, the feedback microphone of the earphone collects the audio of the friction, and a feedback audio signal is obtained. When the audio frequency comprises external environment sound, the feedback microphone of the earphone is used for collecting the audio frequency of the external environment sound, and a feedback audio signal is obtained. Specifically, the setting of the audio may be set according to the actual situation.
It will be appreciated that when the audio includes both frictional sounds with the ear canal and external ambient sounds when the earphone is in the ear. The determination is made in connection with the specific scenario of the headset. For example, when the real wearing state of the earphone is in-ear state, the audio collected by the feedback microphone is mainly the friction sound between the earphone and the auditory canal when the earphone is in-ear. When the real wearing state of the earphone is the out-of-ear state, the audio collected by the feedback microphone is mainly external environmental sound.
A feedforward microphone (Feedforward microphone, FF MIC) may be provided in the earphone. The feedforward microphone can be arranged at a position of the earphone shell, which is close to the outside of the ear, and is used for collecting audio signals of the external environment of the earphone. For example, when the real wearing state of the earphone is in an in-ear state, the audio collected by the feedforward microphone is mainly external environmental sound. When the real wearing state of the earphone is the out-of-ear state, the audio collected by the feedforward microphone is external environmental sound.
In a specific implementation, when the earphone detects an earphone wearing state detection request, a feedforward audio signal is collected through a feedforward microphone, and a feedback audio signal is collected through a feedback microphone. In this embodiment, the feedforward audio signal and the feedback audio signal collected by the earphone are used as analysis objects for detecting the wearing state of the earphone, so that the wearing detection prompt tone is not required to be played, and the limitation of detecting the wearing state of the earphone in the mode of playing the prompt tone is avoided, for example: playing the alert tones can affect the user experience; the node of the starting time and the ending time of the playing of the prompt tone is difficult to control, the playing of the prompt tone is too early, too late or too long, and the like, so that the wearing detection accuracy judgment state can be influenced, the power consumption of the earphone is increased, the user experience is influenced, and the like; furthermore, playing the wearing detection alert sound may conflict with other alert sounds such as the earphone out-of-box alert sound, pairing alert sound, and reconnection alert sound.
Step S200: and respectively carrying out frequency domain analysis on the feedforward audio signal and the feedback audio signal to obtain a feedforward signal spectrum and a feedback signal spectrum.
In this embodiment, in order to improve the wearing judgment accuracy and the misjudgment rate in the unworn scene, the feedforward audio signal and the feedback audio signal are converted from the time domain to the frequency domain, so as to obtain the feedforward signal spectrum and the feedback signal spectrum.
It will be appreciated that the feedforward signal spectrum, i.e. the representation of the feedforward audio signal in the frequency domain, may be an amplitude spectrum, a power spectrum, a phase spectrum, etc., to which embodiments of the present invention are not limited; the feedback signal spectrum, i.e. the representation of the feedback audio signal in the frequency domain, may be an amplitude spectrum, a power spectrum, a phase spectrum, etc., to which embodiments of the invention are not limited.
It should be appreciated that the frequency spectrum employed by the feedforward audio signal and the feedback audio signal should be consistent when performing frequency domain analysis.
For example, the feedforward audio signal may be fourier transformed to obtain a feedforward signal spectrum of the feedforward audio signal and a feedback signal spectrum of the feedback audio signal.
In a specific implementation, the earphone may perform frequency domain analysis on the feedforward audio signal to obtain a feedforward signal spectrum of the feedforward audio signal; and carrying out frequency domain analysis on the feedback audio signal to obtain a feedback signal frequency spectrum of the feedback audio signal. By converting the feedforward audio signal and the feedback audio signal to a frequency domain representation, information about the frequency, pitch, sound pressure, noise, energy distribution, etc. of the signal can be obtained from the frequency spectrum.
Step S300: obtaining target feedforward information and target feedback information from the feedforward signal spectrum and the feedback signal spectrum respectively;
step S400: comparing the target feedforward information with the target feedback information, and determining the wearing state of the earphone according to a comparison result.
It can be understood that in the in-ear state, the feedforward signal spectrum and the feedback signal spectrum have certain differences, and the target feedforward information and the target feedback information can be respectively obtained in the feedforward signal spectrum and the feedback signal spectrum, and the target feedforward signal difference and the target feedback information are compared, so that the actual wearing state of the earphone is determined.
The target feedforward information and the target feedback information may be power information of the audio signal, for example. That is, the target feedforward power information of the feedforward signal can be obtained through the feedforward signal spectrum, and the target feedback power information of the feedback signal can be obtained through the feedback signal spectrum; comparing the target feedforward power information with the target feedback power information, and determining that the wearing state of the earphone is an ear-out state when the absolute value of the power difference between the target feedforward power information and the target feedback power information is lower than a preset power difference threshold; otherwise, determining that the wearing state of the earphone is in-ear state.
For example, the target feedforward information and the target feedback information may be noise information, tone information, sound pressure information, energy distribution information, and the like of the audio signal, and the specific implementation manner may refer to the above examples, which are not repeated in the embodiments of the present invention.
In a specific implementation, the target feedforward information may be obtained from a feedforward signal spectrum, and the target feedback information may be obtained from a feedback signal spectrum; and comparing the target feedforward information with the target feedback information, so as to determine the actual wearing state of the earphone according to the comparison result. By analyzing the target feedforward information and the target feedback information of the feedforward audio signal and the feedback audio signal in the frequency domain, the difference of the audio signals received by the feedforward microphone and the feedback microphone in the frequency domain of the earphone in the current state can be determined, and whether the earphone is worn or not can be determined according to the difference.
In the embodiment, when the earphone wearing state detection request is detected, a feedforward audio signal and a feedback audio signal are collected; respectively carrying out frequency domain analysis on the feedforward audio signal and the feedback audio signal to obtain a feedforward signal frequency spectrum and a feedback signal frequency spectrum; obtaining target feedforward information and target feedback information from a feedforward signal spectrum and a feedback signal spectrum respectively; and comparing the target feedforward information with the target feedback information, and determining the wearing state of the earphone according to the comparison result. The accuracy of earphone wearing state detection is improved by comparing the target feedforward information and the target feedback information of the feedforward audio signal and the feedback audio signal in the frequency domain; the wearing detection prompt tone is not required to be played, and the limitation of detecting the wearing state of the earphone by playing the prompt tone is avoided; meanwhile, the energy loss caused by misjudgment of the earphone is reduced.
Referring to fig. 3, fig. 3 is a flowchart illustrating a second embodiment of the method for detecting a wearing state of an earphone according to the present invention.
Based on the first embodiment, in this embodiment, the performing frequency domain analysis on the feedforward audio signal and the feedback audio signal to obtain a feedforward signal spectrum and a feedback signal spectrum includes:
step S210: and respectively carrying out signal framing on the feedforward audio signal and the feedback audio signal to obtain a feedforward signal frame and a feedback signal frame.
For example, in order to perform frequency domain analysis on the feedforward audio signal and the feedback audio signal, signal framing operation may be performed on the feedforward audio signal and the feedback audio signal, respectively, so as to divide the continuous audio signal into segments, that is, a feedforward signal frame and a feedback signal frame. By dividing the continuous audio signal into discrete signal frames, the resources required for calculation can be reduced and the detection efficiency can be improved.
Step S220: and respectively processing the feedforward signal frame and the feedback signal frame through a window function to obtain a feedforward window frame and a feedback window frame.
For example, for the divided feedforward signal frames and feedback signal frames, each signal frame can be windowed through a window function to obtain a feedforward window frame and a feedback window frame, so that jump of each window boundary is reduced, and frequency spectrum leakage phenomenon is reduced.
The window function selected in this embodiment may be, for example, a hamming window, a hanning window, a rectangular window, etc., which is not limited in this embodiment of the present invention. The windowing processing is carried out on the signals, so that mutual interference between adjacent frequency components is reduced, and the spectrum analysis result is clearer.
Step S230: and respectively carrying out fast Fourier transform on the feedforward window frame and the feedback window frame to obtain a feedforward signal spectrum and a feedback signal spectrum.
For example, for feedforward window frames obtained after windowing, a fast fourier transform (Fast Fourier transform, FFT) may be performed on the signal frames for each window to determine a feedforward signal spectrum of the feedforward audio signal; for the windowed feedback window frames, a fast fourier transform may be performed on the signal frames for each window to determine a feedback signal spectrum for the feedback audio signal.
Further, the obtaining target feedforward information and target feedback information from the feedforward signal spectrum and the feedback signal spectrum, respectively, includes:
step S310: respectively acquiring a feedforward characteristic mean value and a feedback characteristic mean value in a preset range from the feedforward signal spectrum and the feedback signal spectrum;
Step S320: determining a feedforward feature level of the feedforward audio signal according to the feedforward feature mean value;
step S330: determining a feedback feature level of the feedback audio signal according to the feedback feature mean value;
wherein the target feedforward information includes the feedforward feature stage; the target feedback information includes the feedback feature level.
It should be appreciated that the above-described feedforward feature mean may be used to characterize feature mean values in the feedforward signal spectrum over a predetermined range; the feedback characteristic mean value can be used for representing the characteristic mean value in the feedback signal frequency spectrum in a preset range. The characteristic grade of the feedforward audio signal in the preset range, namely the feedforward characteristic grade, can be determined through the feedforward characteristic mean value; and determining the characteristic level of the feedback audio signal in the preset range, namely the feedback characteristic level, through the feedback characteristic average value.
It can be appreciated that in determining the feedforward signal spectrum and the feedback signal spectrum, the spectrum can be valued according to the spectrum type. For example, for a power spectrum, a feed-forward power average and a feedback power average within a preset range may be obtained; determining a feedforward power level of the feedforward audio signal from the feedforward power average; and determining the feedback power level of the feedback audio signal according to the feedback power average value. As another example, for a phase spectrum, a feed-forward phase average value within a preset range may be obtained; determining a feedforward phase level of the feedforward audio signal from the feedforward phase average; and determining the feedback phase level of the feedback audio signal according to the feedback phase average value.
In an alternative embodiment of the invention, the frequency spectrum may be a sound pressure spectrum. For the sound pressure spectrum, the feedforward signal spectrum and the feedback signal spectrum can be corrected by the weighting coefficient, so that the corresponding standard feedforward signal spectrum and standard feedback signal spectrum can be obtained. The weighting coefficients may be a weighting coefficient, B weighting coefficient, or C weighting coefficient, which is not limited in the embodiment of the present invention.
It will be appreciated that by weighting the spectrum, noise or uncorrelated signal components in the frequency range where the human ear is less sensitive may be removed or reduced, thereby improving the audio quality.
When the standard feedforward signal spectrum and the standard feedback signal spectrum are determined, the weighting feedforward sound pressure average value and the weighting feedback sound pressure average value in the preset range in each spectrum can be calculated. The weighting feedforward sound pressure level of the feedforward audio signal can be determined through the weighting feedforward sound pressure average value, and the weighting feedback sound pressure level of the feedback audio signal can be determined through the weighting feedback sound pressure average value. The wearing state of the earphone can be determined by calculating the difference value of the absolute value between the weighting feedforward sound pressure level and the weighting feedback sound pressure level and comparing the difference value with the sound pressure threshold value N. Specifically, when the weight-counting sound pressure difference value is larger than a preset sound pressure threshold value, determining that the wearing state of the earphone is in-ear state; and when the weighted sound pressure difference value is not larger than the preset sound pressure threshold value, determining that the wearing state of the earphone is the ear-out state.
As shown in fig. 4 and fig. 5, fig. 4 is a schematic diagram of the weighting sound pressure level of FB/FF MIC of the in-ear state and the out-ear state of the method for detecting an in-ear state of the present invention, and fig. 5 is a schematic diagram of the difference of the weighting sound pressure of the in-ear state and the out-ear state of the method for detecting an in-ear state of the present invention.
It will be appreciated that in fig. 4, the horizontal axis represents the number of signals (units: pieces) and the vertical axis represents the weighted sound pressure level (units: dBA). As can be readily seen from fig. 4, there is a large difference in sound pressure level of the feedforward audio signal and the feedback audio signal in the in-ear state, and a small difference in the feedforward audio signal and the feedback audio signal in the out-ear state.
It should be understood that in fig. 5, the horizontal axis indicates the number of signals (units: pieces) and the vertical axis indicates the weighted sound pressure level difference (units: dBA). As can be easily seen from fig. 5, the difference in sound pressure level between the feedforward audio signal and the feedback audio signal is close to 0 in the out-of-ear state, and the difference in sound pressure level between the feedforward audio signal and the feedback audio signal is large in the in-ear state.
It can be understood that the preset sound pressure threshold value can be determined according to the situation in practical application, and the actual wearing state of the earphone can be determined by performing frequency domain analysis on the feedforward audio signal and the feedback audio signal, so as to determine the weight sound pressure difference value between the feedforward audio signal and the feedback audio signal.
In the embodiment, signal framing is performed on a feedforward audio signal and a feedback audio signal respectively to obtain a feedforward signal frame and a feedback signal frame; processing the feedforward signal frame and the feedback signal frame through window functions respectively to obtain a feedforward window frame and a feedback window frame; and respectively performing fast Fourier transform on the feedforward window frame and the feedback window frame to obtain a feedforward signal spectrum and a feedback signal spectrum. The feedforward signal spectrum of the feedforward audio signal and the feedback signal spectrum of the feedback audio signal are obtained by respectively carrying out framing and windowing on the feedforward audio signal and the feedback audio signal, so that the difference between the feedforward audio signal and the feedback audio signal can be analyzed in the frequency domain, and the accuracy of earphone wearing state prediction is improved.
Based on the above embodiments, in order to further improve the accuracy of detection, a third embodiment of the method of the present invention is provided, and referring to fig. 6, fig. 6 is a schematic flow chart of the third embodiment of the method for detecting the wearing state of the earphone of the present invention.
In this embodiment, before the frequency domain analysis is performed on the feedforward audio signal and the feedback audio signal, the method further includes:
Step S110: and performing differential feature analysis on the feedforward audio signal and the feedback audio signal to obtain differential feature values of the feedforward audio signal and the feedback audio signal.
In this embodiment, the differential feature analysis refers to a process of performing differential analysis on the characteristics of the feedforward audio signal and the characteristics of the feedback audio signal. The differential signature analysis includes, but is not limited to, a distance differential signature analysis, a time domain differential signature analysis. The distance difference characteristic analysis refers to a process of analyzing difference characteristics of a feedforward audio signal and a feedback audio signal in time domain coordinates. Time domain difference feature analysis refers to the process of analyzing the difference features of the time domain of the feedforward audio signal and the time domain of the feedback audio signal.
In an example, a distance difference feature analysis is performed on the feedforward audio signal and the feedback audio signal to obtain difference feature values of the feedforward audio signal and the feedback audio signal.
In this example, the characteristics of the feedforward audio signal and the characteristics of the feedback audio signal are taken as two samples, the distance difference between each two corresponding characteristics in the two samples is calculated, and the difference characteristic values of the feedforward audio signal and the feedback audio signal are determined according to all the calculated distance difference characteristics.
In this example, the distance analysis may be implemented by, but not limited to, euclidean distance, bridgkin distance. In this example, the distance difference feature analysis is preferably performed on the feedforward audio signal and the feedback audio signal using the brealcani distance.
Step S120: and if the difference characteristic value is not lower than a preset difference characteristic maximum threshold value, determining that the wearing state of the earphone is in-ear state.
The preset maximum difference characteristic threshold is used for representing the maximum difference characteristic value of the feedback audio signal and the feedforward audio signal in the in-ear state.
In this embodiment, a preset difference feature maximum threshold is used to represent a maximum difference feature value of the audio signals collected by the feedback microphone and the feedforward microphone in the in-ear state. That is, the difference characteristic value is not lower than the preset difference characteristic maximum threshold value, and the wearing state of the earphone can be determined to be in-ear state.
It is understood that the preset differential feature maximum threshold may be obtained by experimental pre-measurement. The purpose of setting the preset maximum difference characteristic threshold is to identify whether the wearing state of the earphone is in-ear state or not through comparison between the difference characteristic value and the preset maximum difference characteristic threshold. Under the condition that the earphone is switched to the in-ear state, whether the earphone is actually in the in-ear state or not is judged through the difference characteristic value and the preset difference characteristic maximum threshold value, and accuracy of earphone wearing state detection is improved.
Fig. 7 is a schematic diagram of branchigirus distances between feedforward audio signals and feedback audio signals in different states according to the method for detecting a wearing state of an earphone of the present invention.
Referring to fig. 7, fig. 7 shows differences in brekohl distance in four states of the earphone in normal wearing (i.e., in-ear state), in a table, in a pocket, and in a hand, respectively, with the horizontal axis representing the different states and the vertical axis representing the brekohl distance. As can be seen from fig. 7, in different states, the range of the brekotim distance between the feedforward audio signal and the feedback audio signal is different, and the preset differential feature maximum threshold value can be divided according to the range value in practical application, so as to determine the wearing state of the earphone.
Optionally, the method for detecting the wearing state of the earphone further includes:
step S130: if the difference characteristic value is lower than the preset difference characteristic maximum threshold value, carrying out correlation analysis on the feedforward audio signal and the feedback audio signal, and determining a correlation coefficient;
step S140: if the correlation coefficient is higher than a preset correlation coefficient maximum threshold, determining that the wearing state of the earphone is an ear-out state;
step S150: and if the correlation coefficient is lower than a preset correlation coefficient minimum threshold value, or if the correlation coefficient is between the preset correlation coefficient minimum threshold value and the preset correlation coefficient maximum threshold value and the difference characteristic value is higher than a preset difference characteristic minimum threshold value, determining that the wearing state of the earphone is in-ear state.
The preset difference characteristic minimum threshold is used for representing the minimum difference characteristic value of the feedback audio signal and the feedforward audio signal in the in-ear state; the maximum correlation coefficient threshold is preset and used for representing the maximum correlation coefficient of the feedback audio signal and the feedforward audio signal in the in-ear state; the preset correlation coefficient minimum threshold is used for representing the minimum correlation coefficient of the feedback audio signal and the feedforward audio signal in the ear state.
It can be understood that when the wearing state of the earphone is the out-of-ear state, the audio signals collected by the feedback microphone and the feedforward microphone are mainly external environmental sounds. Therefore, when the wearing state of the earphone is the out-of-ear state, the correlation between the feedback audio signal collected by the feedback microphone and the feedforward audio signal collected by the feedforward microphone is relatively large.
When the wearing state of the earphone is in an in-ear state, as the feedback audio signal acquired by the feedback microphone is the friction sound between the earphone and the auditory canal when the earphone is in-ear, generating the feedback audio signal according to the friction sound between the earphone and the auditory canal when the earphone is in-ear; and the feedforward audio signal collected by the feedforward microphone is external environmental sound, so that when the wearing state of the earphone is in an in-ear state, the correlation between the feedback audio signal collected by the feedback microphone and the feedforward audio signal collected by the feedforward microphone is smaller.
It is understood that the preset correlation coefficient maximum threshold value and the preset correlation coefficient minimum threshold value may be obtained by experimental pre-measurement. For example, when the wearing state of the earphone is in the in-ear state, the minimum threshold of the preset correlation coefficient of the audio signal collected by the feedback microphone and the audio signal collected by the feedforward microphone is set to 0.1, and when the wearing state of the earphone is in the out-ear state, the maximum threshold of the preset correlation coefficient of the audio signal collected by the feedback microphone and the audio signal collected by the feedforward microphone is set to 0.7.
It should be noted that, when the correlation coefficient is between the preset minimum correlation coefficient threshold and the preset maximum correlation coefficient threshold, the correlation coefficient needs to be judged by combining with the differential characteristic value; if the difference characteristic value is higher than a preset difference characteristic minimum threshold value, determining that the wearing state of the earphone is in-ear state; and if the difference characteristic value is not higher than the preset difference characteristic minimum threshold value, executing the step of respectively carrying out frequency domain analysis on the feedforward audio signal and the feedback audio signal, thereby further determining the wearing state of the earphone. That is, step S160: and if the correlation coefficient is between the preset correlation coefficient minimum threshold and the preset correlation coefficient maximum threshold, executing the frequency domain analysis on the feedforward audio signal and the feedback audio signal respectively, wherein the difference characteristic value is not higher than the preset difference characteristic minimum threshold.
In this example, the method of implementation of the correlation analysis includes, but is not limited to, pearson correlation coefficients, spearman anecdotal correlation coefficients, and the like. In this example, the feedforward audio signal and the feedback audio signal are preferably subjected to correlation analysis using pearson correlation coefficients.
In this embodiment, the purpose of setting the preset correlation coefficient maximum threshold and the preset correlation coefficient minimum threshold is to identify whether the wearing state of the earphone is in-ear state by comparing the correlation coefficients of the feedforward audio signal and the feedback audio signal with the preset correlation coefficient maximum threshold and the preset correlation coefficient minimum threshold. Judging whether the earphone is actually in an in-ear state or not through a correlation coefficient of the feedforward audio signal and the feedback audio signal, a preset correlation coefficient maximum threshold value and a preset correlation coefficient minimum threshold value under the condition that the earphone is switched to the in-ear state, and determining that the wearing state of the earphone is in an out-ear state when the correlation coefficient is higher than the preset correlation coefficient maximum threshold value; when the correlation coefficient is lower than a preset correlation coefficient minimum threshold value or when the correlation coefficient is between the preset correlation coefficient minimum threshold value and the preset correlation coefficient maximum threshold value and the difference characteristic value is higher than a preset difference characteristic minimum threshold value, determining that the wearing state of the earphone is in-ear state; when the correlation coefficient is between the preset correlation coefficient minimum threshold and the preset correlation coefficient maximum threshold, the difference characteristic value is not higher than the preset difference characteristic minimum threshold, and the frequency domain analysis is performed on the feedforward audio signal and the feedback audio signal respectively, so that the wearing state of the earphone is further determined, and the accuracy of detecting the wearing state of the earphone is improved.
Fig. 8 is a schematic diagram of correlation coefficients of feedforward audio signals and feedback audio signals in different states according to the method for detecting a wearing state of an earphone of the present invention.
Referring to fig. 8, fig. 8 shows differences in correlation coefficients of the earphone in four states of normal wearing (i.e., in-ear state), on a desk, in a pocket, and in a hand, respectively, with the horizontal axis representing the different states and the vertical axis representing correlation coefficients of the feedforward audio signal and the feedback audio signal. As can be seen from fig. 8, in different states, the range of the correlation coefficient between the feedforward audio signal and the feedback audio signal is not the same, and the preset correlation coefficient maximum threshold and the preset correlation coefficient minimum threshold can be divided according to the range value in practical application, so as to determine the wearing state of the earphone.
According to the embodiment, the difference characteristic analysis is carried out on the feedforward audio signal and the feedback audio signal, so that the difference characteristic values of the feedforward audio signal and the feedback audio signal are obtained; if the difference characteristic value is not lower than a preset difference characteristic maximum threshold value, determining that the wearing state of the earphone is in-ear state; if the difference characteristic value is lower than a preset difference characteristic maximum threshold value, carrying out correlation analysis on the feedforward audio signal and the feedback audio signal, and determining a correlation coefficient; if the correlation coefficient is higher than a preset correlation coefficient maximum threshold, determining that the wearing state of the earphone is an ear-out state; if the correlation coefficient is lower than a preset correlation coefficient minimum threshold value, or if the correlation coefficient is between the preset correlation coefficient minimum threshold value and a preset correlation coefficient maximum threshold value and the difference characteristic value is higher than the preset difference characteristic minimum threshold value, determining that the wearing state of the earphone is in-ear state; and if the correlation coefficient is between the preset correlation coefficient minimum threshold and the preset correlation coefficient maximum threshold, executing frequency domain analysis on the feedforward audio signal and the feedback audio signal respectively, wherein the difference characteristic value is not higher than the preset difference characteristic minimum threshold. As the difference judgment and the correlation judgment are carried out on the feedforward audio signal and the feedback audio signal, the wearing state of the earphone is determined through the preset value, and the accuracy of the wearing state judgment of the earphone is improved.
Fig. 9 is a schematic system diagram of an application scenario of the method for detecting a wearing state of an earphone according to the present invention.
In the application scene, whether the earphone is in the ear or not is judged through the optical or capacitive sensor, and when the earphone is not in the ear, the wearing state of the earphone is determined to be in the ear-out state; when the earphone is in the ear, judging whether the actual wearing state of the earphone is in the ear state or not through an algorithm.
Fig. 10 is a system flowchart of an application scenario of the method for detecting a wearing state of an earphone according to the present invention, as shown in fig. 10.
The invention judges whether the earphone is in the ear or not through the optical or capacitive sensor, and respectively acquires a feedback audio signal (FB MIC signal) and a feedforward audio signal (FF MIC signal) through the FB/FF MIC when the earphone is converted from the non-in-ear state to the possible in-ear state.
In one embodiment, the collected audio signal may also be low-pass filtered (0-120 Hz) to improve the signal quality of the collected feedback audio signal and feedforward audio signal.
Further, the Brazier distance of the FB/FF two-path MIC signal can be calculated, and when the FB/FF Brazier distance is larger than the upper threshold A, the actual wearing state of the earphone is determined to be in-ear state.
Further, if the FB/FF brealcian distance is not greater than the upper threshold a, a pearson correlation coefficient of the FB/FF MIC signal may be calculated, and when the pearson correlation coefficient is greater than the upper threshold N, the actual wearing state of the earphone is determined to be an ear-out state; and when the pearson correlation coefficient is smaller than the lower threshold value M, determining that the actual wearing state of the earphone is in-ear state.
Further, when M < pearson correlation coefficient < N, it is necessary to determine by combining the brekotos distances. If the Brachyle distance is larger than the lower threshold C, determining that the actual wearing state of the earphone is in-ear state; if the Brazilian distance is not greater than the lower threshold C, calculating the A weighting sound pressure level of the FB/FF MIC signal spectrum, and judging whether the FB sound pressure level subtracted from the FF sound pressure level is greater than the threshold D; if the real wearing state of the earphone is larger than the real wearing state of the earphone, determining that the real wearing state of the earphone is in-ear state; and if the actual wearing state of the earphone is not greater than the preset value, determining that the actual wearing state of the earphone is an out-of-ear state.
In the system flow of the application scenario, the detailed implementation of each step may refer to each embodiment of the method for detecting the wearing state of the earphone according to the present invention, which is not described herein again.
In addition, the embodiment of the invention also provides a storage medium, on which a headset wearing state detection program is stored, which when executed by a processor, implements the steps of the headset wearing state detection method as described above.
Based on the first embodiment of the method for detecting the wearing state of the earphone, the first embodiment of the device for detecting the wearing state of the earphone is provided, and referring to fig. 11, fig. 11 is a block diagram of the first embodiment of the device for detecting the wearing state of the earphone.
As shown in fig. 11, the device for detecting a wearing state of an earphone according to an embodiment of the present invention includes:
an audio acquisition module 1110, configured to acquire a feedforward audio signal and a feedback audio signal when detecting a headphone wearing state detection request;
the frequency domain analysis module 1120 is configured to perform frequency domain analysis on the feedforward audio signal and the feedback audio signal, respectively, to obtain a feedforward signal spectrum and a feedback signal spectrum;
an information analysis module 1130 for obtaining target feedforward information and target feedback information from the feedforward signal spectrum and the feedback signal spectrum, respectively;
the state judging module 1140 is configured to compare the target feedforward information with the target feedback information, and determine a wearing state of the earphone according to a comparison result.
In the embodiment, when the earphone wearing state detection request is detected, a feedforward audio signal and a feedback audio signal are collected; respectively carrying out frequency domain analysis on the feedforward audio signal and the feedback audio signal to obtain a feedforward signal frequency spectrum and a feedback signal frequency spectrum; obtaining target feedforward information and target feedback information from a feedforward signal spectrum and a feedback signal spectrum respectively; and comparing the target feedforward information with the target feedback information, and determining the wearing state of the earphone according to the comparison result. The accuracy of earphone wearing state detection is improved by comparing the target feedforward information and the target feedback information of the feedforward audio signal and the feedback audio signal in the frequency domain; the wearing detection prompt tone is not required to be played, and the limitation of detecting the wearing state of the earphone by playing the prompt tone is avoided; meanwhile, the energy loss caused by misjudgment of the earphone is reduced.
Further, the frequency domain analysis module 1120 is further configured to perform signal framing on the feedforward audio signal and the feedback audio signal, respectively, to obtain a feedforward signal frame and a feedback signal frame; processing the feedforward signal frame and the feedback signal frame through a window function respectively to obtain a feedforward window frame and a feedback window frame; and respectively carrying out fast Fourier transform on the feedforward window frame and the feedback window frame to obtain a feedforward signal spectrum and a feedback signal spectrum.
Further, the information analysis module 1130 is further configured to obtain a feedforward characteristic average value and a feedback characteristic average value in a preset range from the feedforward signal spectrum and the feedback signal spectrum, respectively; determining a feedforward feature level of the feedforward audio signal according to the feedforward feature mean value; determining a feedback feature level of the feedback audio signal according to the feedback feature mean value; wherein the target feedforward information includes the feedforward feature stage; the target feedback information includes the feedback feature level.
Further, the earphone wearing state detecting apparatus further includes: a time domain analysis module; the time domain analysis module is used for carrying out differential feature analysis on the feedforward audio signal and the feedback audio signal to obtain differential feature values of the feedforward audio signal and the feedback audio signal; if the difference characteristic value is not lower than a preset difference characteristic maximum threshold value, determining that the wearing state of the earphone is in-ear state; the preset maximum difference characteristic threshold is used for representing the maximum difference characteristic value of the feedback audio signal and the feedforward audio signal in the in-ear state.
Further, the time domain analysis module is further configured to perform correlation analysis on the feedforward audio signal and the feedback audio signal if the difference feature value is lower than the preset difference feature maximum threshold value, and determine a correlation coefficient; if the correlation coefficient is higher than a preset correlation coefficient maximum threshold, determining that the wearing state of the earphone is an ear-out state; and if the correlation coefficient is lower than a preset correlation coefficient minimum threshold value, or if the correlation coefficient is between the preset correlation coefficient minimum threshold value and the preset correlation coefficient maximum threshold value and the difference characteristic value is higher than a preset difference characteristic minimum threshold value, determining that the wearing state of the earphone is in-ear state.
Further, the time domain analysis module is further configured to perform the frequency domain analysis on the feedforward audio signal and the feedback audio signal, respectively, if the correlation coefficient is between the preset minimum correlation coefficient threshold and the preset maximum correlation coefficient threshold, and the difference feature value is not higher than the preset minimum difference feature threshold.
Further, the earphone wearing state detecting apparatus further includes: a request generation module; the request generation module is used for generating a headset wearing state detection request at regular time; or when the sensor of the earphone recognizes that the wearing state of the earphone is switched to the in-ear state, generating an earphone wearing state detection request.
Other embodiments or specific implementation manners of the earphone wearing state detection device of the present invention may refer to the above method embodiments, and are not described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. read-only memory/random-access memory, magnetic disk, optical disk), comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.
Claims (10)
1. A method for detecting a wearing state of an earphone, comprising:
when detecting a headset wearing state detection request, collecting a feedforward audio signal and a feedback audio signal;
frequency domain analysis is carried out on the feedforward audio signal and the feedback audio signal respectively, so that a feedforward signal spectrum and a feedback signal spectrum are obtained;
obtaining target feedforward information and target feedback information from the feedforward signal spectrum and the feedback signal spectrum respectively;
comparing the target feedforward information with the target feedback information, and determining the wearing state of the earphone according to a comparison result.
2. The method for detecting a wearing state of headphones as claimed in claim 1, wherein the performing frequency domain analysis on the feedforward audio signal and the feedback audio signal, respectively, to obtain a feedforward signal spectrum and a feedback signal spectrum, includes:
respectively carrying out signal framing on the feedforward audio signal and the feedback audio signal to obtain a feedforward signal frame and a feedback signal frame;
processing the feedforward signal frame and the feedback signal frame through a window function respectively to obtain a feedforward window frame and a feedback window frame;
and respectively carrying out fast Fourier transform on the feedforward window frame and the feedback window frame to obtain a feedforward signal spectrum and a feedback signal spectrum.
3. The headphone wear state detection method according to claim 1, wherein the obtaining target feedforward information and target feedback information from the feedforward signal spectrum and the feedback signal spectrum, respectively, includes:
respectively acquiring a feedforward characteristic mean value and a feedback characteristic mean value in a preset range from the feedforward signal spectrum and the feedback signal spectrum;
determining a feedforward feature level of the feedforward audio signal according to the feedforward feature mean value;
determining a feedback feature level of the feedback audio signal according to the feedback feature mean value;
wherein the target feedforward information includes the feedforward feature stage; the target feedback information includes the feedback feature level.
4. The method for detecting a wearing state of headphones according to claim 1, wherein before the frequency domain analysis of the feedforward audio signal and the feedback audio signal, respectively, further comprises:
performing differential feature analysis on the feedforward audio signal and the feedback audio signal to obtain differential feature values of the feedforward audio signal and the feedback audio signal;
if the difference characteristic value is not lower than a preset difference characteristic maximum threshold value, determining that the wearing state of the earphone is in-ear state;
The preset maximum difference characteristic threshold is used for representing the maximum difference characteristic value of the feedback audio signal and the feedforward audio signal in the in-ear state.
5. The headphone wear state detection method according to claim 4, further comprising:
if the difference characteristic value is lower than the preset difference characteristic maximum threshold value, carrying out correlation analysis on the feedforward audio signal and the feedback audio signal, and determining a correlation coefficient;
if the correlation coefficient is higher than a preset correlation coefficient maximum threshold, determining that the wearing state of the earphone is an ear-out state;
and if the correlation coefficient is lower than a preset correlation coefficient minimum threshold value, or if the correlation coefficient is between the preset correlation coefficient minimum threshold value and the preset correlation coefficient maximum threshold value and the difference characteristic value is higher than a preset difference characteristic minimum threshold value, determining that the wearing state of the earphone is in-ear state.
6. The headphone wear state detection method according to claim 5, further comprising:
and if the correlation coefficient is between the preset correlation coefficient minimum threshold and the preset correlation coefficient maximum threshold, executing the frequency domain analysis on the feedforward audio signal and the feedback audio signal respectively, wherein the difference characteristic value is not higher than the preset difference characteristic minimum threshold.
7. The headphone wear state detection method according to any one of claims 1 to 6, wherein before detecting the headphone wear state detection request, further comprising:
generating a headset wearing state detection request at regular time;
or when the sensor of the earphone recognizes that the wearing state of the earphone is switched to the in-ear state, generating an earphone wearing state detection request.
8. An earphone wearing state detection device, characterized in that the earphone wearing state detection device comprises:
the audio acquisition module is used for acquiring a feedforward audio signal and a feedback audio signal when detecting a headset wearing state detection request;
the frequency domain analysis module is used for respectively carrying out frequency domain analysis on the feedforward audio signal and the feedback audio signal to obtain a feedforward signal frequency spectrum and a feedback signal frequency spectrum;
the information analysis module is used for respectively obtaining target feedforward information and target feedback information from the feedforward signal spectrum and the feedback signal spectrum;
and the state judging module is used for comparing the target feedforward information with the target feedback information and determining the wearing state of the earphone according to a comparison result.
9. A headset comprising a memory, a processor and a headset wearing state detection program stored on the memory and executable on the processor, the headset wearing state detection program being configured to implement the steps of the headset wearing state detection method according to any one of claims 1 to 7.
10. A storage medium, wherein a headphone wearing state detection program is stored on the storage medium, and the headphone wearing state detection program, when executed by a processor, realizes the steps of the headphone wearing state detection method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311558831.6A CN117440282A (en) | 2023-11-21 | 2023-11-21 | Earphone wearing state detection method and device, earphone and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311558831.6A CN117440282A (en) | 2023-11-21 | 2023-11-21 | Earphone wearing state detection method and device, earphone and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117440282A true CN117440282A (en) | 2024-01-23 |
Family
ID=89555185
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311558831.6A Pending CN117440282A (en) | 2023-11-21 | 2023-11-21 | Earphone wearing state detection method and device, earphone and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117440282A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117714939A (en) * | 2024-02-05 | 2024-03-15 | 九音科技(南京)有限公司 | In-ear detection method and system based on spectrum analysis |
-
2023
- 2023-11-21 CN CN202311558831.6A patent/CN117440282A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117714939A (en) * | 2024-02-05 | 2024-03-15 | 九音科技(南京)有限公司 | In-ear detection method and system based on spectrum analysis |
CN117714939B (en) * | 2024-02-05 | 2024-05-24 | 九音科技(南京)有限公司 | In-ear detection method and system based on spectrum analysis |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11632621B2 (en) | Method for controlling volume of wireless headset, and computer-readable storage medium | |
EP1947904B1 (en) | Sound outputting apparatus, sound outputting method, sound outputting system and sound output processing program | |
CN110418232B (en) | Volume adjusting method and device and computer readable storage medium | |
CN111294719B (en) | Method and device for detecting in-ear state of ear-wearing type device and mobile terminal | |
CN111629297B (en) | Earphone wearing state detection method and device, earphone and storage medium | |
CN113630708B (en) | Method and device for detecting abnormal earphone microphone, earphone kit and storage medium | |
CN113596657A (en) | Earphone in-ear detection method, terminal and computer readable storage medium | |
KR100842618B1 (en) | Music file playing method and apparatus | |
US20240257795A1 (en) | Noise reduction parameter setting method and apparatus, earphone device and storage medium | |
CN117440282A (en) | Earphone wearing state detection method and device, earphone and storage medium | |
CN117319870B (en) | Earphone wearing state detection method and device, earphone and storage medium | |
CN109495635A (en) | Volume adjusting method and device | |
CN117528333B (en) | State detection method and device of ear-wearing type audio equipment, audio equipment and medium | |
CN109168098B (en) | System for automatically controlling to suspend and open Bluetooth headset when mobile phone is away from ear and control method thereof | |
WO2023197474A1 (en) | Method for determining parameter corresponding to earphone mode, and earphone, terminal and system | |
CN114567849B (en) | Detection method and device, wireless earphone and storage medium | |
CN117499830B (en) | Earphone wearing state detection method and device, earphone and storage medium | |
CN114640922B (en) | Intelligent earphone and in-ear adaptation method and medium thereof | |
CN113905302B (en) | Method and device for triggering prompt message and earphone | |
CN111739493B (en) | Audio processing method, device and storage medium | |
CN118018903A (en) | Earphone wearing state detection method and device, earphone and storage medium | |
CN109151195B (en) | Earphone control method and control system during running exercise | |
CN117896648A (en) | Earphone wearing state detection method and device, earphone and storage medium | |
CN114286216B (en) | Wrist-worn equipment and air pressure adjusting method, device and system thereof | |
US20240257828A1 (en) | Signal processing apparatus, signal processing method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |