Earphone wearing state detection method and apparatus, and earphone and storage medium
By using a feedback microphone in TWS headsets to collect audio signals and analyze their power spectrum, the problem of misjudgment of existing headset wear detection is solved, and the detection accuracy and user experience are improved.
Patent Information
- Application Number
- PCT/CN2023/132852
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-09
- Filing Date
- 2023-11-21
- Publication Date
- 2025-05-15
AI Technical Summary
The wear detection scheme of existing TWS headphones is prone to misjudging the headphones into the in-ear state, resulting in inaccurate wear detection, affecting user experience and increasing power consumption.
The feedback audio signal is collected through the headphone's feedback microphone, the audio frequency is determined and its power spectrum is analyzed, and the headphone's wearing state is determined based on the energy magnitude index value.
It improves the accuracy of headphone wear status detection, reduces misjudgment, improves user experience and reduces power consumption.
Smart Images

Figure CN2023132852_15052025_PF_FP_ABST
Abstract
Description
Headphone wearing status detection method, device, headphone and storage medium Technical Field
[0001] The present application relates to the field of terminal control technology, and in particular to a method and device for detecting the wearing status of an earphone, an earphone, and a storage medium. Background Art
[0002] The market for True Wireless Stereo (TWS) earphones has been booming in recent years, gaining popularity among consumers due to their compact size, portability, and ease of use. Currently, mid-range and high-end TWS earphones support in-ear detection, allowing them to automatically play music when worn and pause music when removed, making the earphones more intelligent and energy-efficient.
[0003] The current mainstream TWS earphone wearing detection solutions mainly include capacitive sensor detection solutions and optical sensor detection solutions. The capacitive solution determines whether the earphones are in the ears by sensing the capacitance value of the human body. The advantages of the capacitive detection solution are low cost, no need for holes in the shell, and a more aesthetically pleasing appearance; the disadvantage is a high rate of misoperation. The optical detection solution uses the level signal of infrared light emission, reflection, and reception to determine whether the earphones are in the ears. Compared with the capacitive detection solution, the optical detection solution has the advantage of higher accuracy, but it is more expensive, there is also the possibility of misoperation in certain scenarios, and it has high requirements for production and assembly processes.
[0004] However, the above two solutions can easily misjudge the earphones as being in-ear. For example, in common scenarios such as when the earphones are removed and placed on a table, held in hand, or placed in a pocket, the optical or capacitive sensors can easily misjudge the earphones as being in-ear. This can lead to inaccurate wear detection, affecting the user experience and increasing the power consumption of the earphones. SUMMARY OF THE INVENTION
[0005] The embodiments of the present application provide a method, device, headset, and storage medium for detecting the wearing status of an earphone, which can improve the accuracy of detecting the wearing status of an earphone.
[0006] In a first aspect, an embodiment of the present application provides a method for detecting a wearing state of an earphone, comprising:
[0007] Get the headset wearing status detection request;
[0008] Acquire audio through the feedback microphone of the headset to obtain a feedback audio signal;
[0009] Determining the frequency of the audio, and based on the frequency, determining a target frequency band in the feedback audio signal whose frequency range meets a preset condition;
[0010] determining a power spectrum of the feedback audio signal;
[0011] Determining an energy index value of the feedback audio signal within the target frequency band based on the power spectrum;
[0012] If the energy index value is not lower than a preset minimum energy threshold corresponding to the in-ear state, it is determined that the wearing state of the earphone is the in-ear state.
[0013] In a second aspect, an embodiment of the present application further provides a device for detecting a wearing state of an earphone, comprising:
[0014] A detection request acquisition module is used to obtain a headphone wearing status detection request;
[0015] A feedback audio signal determination module is used to collect audio through the feedback microphone of the headset to obtain a feedback audio signal;
[0016] a target frequency band determination module, configured to determine the frequency of the audio, and based on the frequency, determine a target frequency band in the feedback audio signal whose frequency range satisfies a preset condition;
[0017] A power spectrum determination module, configured to determine the power spectrum of the feedback audio signal;
[0018] an energy index value determining module, configured to determine an energy index value of the feedback audio signal within the target frequency band based on the power spectrum;
[0019] The wearing state determination module is used to determine that the wearing state of the earphone is the in-ear state if the energy magnitude index value is not lower than the preset energy minimum threshold corresponding to the in-ear state.
[0020] In a third aspect, an embodiment of the present application further provides an earphone, comprising a memory storing multiple instructions; the processor loads instructions from the memory to execute the steps of any earphone wearing status detection method provided in an embodiment of the present application.
[0021] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a plurality of instructions, and the instructions are suitable for loading by a processor to execute the steps of any one of the headphone wearing status detection methods provided in the embodiments of the present application.
[0022] In a fifth aspect, an embodiment of the present application further provides a computer program product, comprising a computer program or instructions, which, when executed by a processor, implements the steps of any one of the headphone wearing status detection methods provided in the embodiments of the present application.
[0023] By adopting the scheme of the embodiment of the application, a request for detecting the wearing status of the earphone can be obtained; audio is collected through the feedback microphone of the earphone to obtain a feedback audio signal; the frequency of the audio is determined, and based on the frequency, a target frequency band in which the frequency range of the feedback audio signal meets a preset condition is determined; the power spectrum of the feedback audio signal is determined; based on the power spectrum, an energy index value of the feedback audio signal within the target frequency band is determined; if the energy index value is not lower than the preset minimum energy threshold corresponding to the in-ear state, the wearing status of the earphone is determined to be the in-ear state. By performing power spectrum analysis on the feedback audio signal collected by the feedback microphone, the target frequency band in which the frequency range of the feedback audio signal meets the preset condition and the energy index value within the target frequency band are determined, and by comparing the energy index value within the target frequency band with the preset minimum energy threshold corresponding to the in-ear state, the wearing status of the earphone is determined, thereby improving the detection accuracy of the wearing status of the earphone. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0025] FIG1 is a schematic flow chart of an embodiment of a method for detecting a headphone wearing state provided in an embodiment of the present application;
[0026] FIG2 is a schematic structural diagram of an earphone wearing status detection device provided in an embodiment of the present application;
[0027] FIG3 is a schematic structural diagram of an earphone provided in an embodiment of the present application. Modes for Carrying Out the Invention
[0028] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of this application. At the same time, in the description of the embodiments of the present application, the terms "first", "second", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0029] Embodiments of the present application provide a method and device for detecting the wearing status of an earphone, an earphone, and a computer-readable storage medium.
[0030] Specifically, this embodiment will be described from the perspective of a headphone wearing state detection device. The headphone wearing state detection device can be integrated into a headphone, that is, the headphone wearing state detection method of the embodiment of the present application can be executed by the headphone. Optionally, the headphone can be a terminal device with data processing capabilities. The terminal device is a headphone, and the type of headphone is not limited, such as wired headphones, wireless headphones, Bluetooth headphones, headphones, etc. The headphone can exist independently or as an accessory device of a device such as a head-mounted display device. This embodiment does not limit this.
[0031] Exemplarily, the headphone wearing status detection device can be specifically integrated into a TWS headphone (True Wireless Stereo). Among them, TWS headphones refer to headphones without traditional connecting cables, including Bluetooth headphones, infrared headphones, etc. TWS headphones support in-ear detection function. In-ear detection is also called wearing detection function, which is applied to TWS true wireless headphones to achieve the following main functions: judging whether the user is wearing / taking off the headphones. Currently, there are mainly capacitive sensor detection solutions and optical sensor detection solutions for implementing TWS headphone wearing detection solutions. The embodiments of the present application are suitable for capacitive sensor detection solutions, optical sensor detection solutions, or sensor detection solutions made by combining and improving them for headphone wearing status detection.
[0032] The following detailed description is provided in conjunction with the accompanying drawings. In this embodiment, the execution subject is a headset that can invoke a deduplication algorithm. It should be noted that the order in which the following embodiments are described does not limit the preferred order of the embodiments. Although the flowcharts illustrate a logical order, in some cases, the steps shown or described may be performed in a different order than that shown in the accompanying drawings.
[0033] Referring to FIG. 1 , the specific process of the headphone wearing status detection method may include steps 101 to 106, wherein:
[0034] Step 101: Obtain a headphone wearing status detection request.
[0035] In this embodiment, the above-mentioned headphone wearing status detection request refers to a request for detecting the headphone wearing status. The wearing status of the headphone includes but is not limited to the in-ear status and the out-of-ear status. Among them, the in-ear status refers to the state in which the headphone is worn and the headphone is located inside the user's ear. The in-ear status includes the state in which the headphone has just entered the user's ear, and also includes the continuous state in which the headphone is located inside the user's ear. The out-of-ear status refers to the state in which the headphone is not worn and is located outside the user's ear. For example, the headphone is in the headphone box, the headphone is on the table, the headphone is in the user's hand, the headphone is in the user's pocket, etc., which are all regarded as the headphone wearing status of the out-of-ear status.
[0036] In this embodiment, the earphones are earphones that require earphone wearing status detection in this embodiment, such as active noise reduction earphones, or the earphones are one of true wireless on-ear earphones. Specifically, if the earphones are one of true wireless on-ear earphones, the wireless connection method between the earphones and another earphone or the smart device can be at least one of WIFI communication, classic Bluetooth communication, BLE communication, LE audio, ANT communication, RF4CE communication, Zigbee communication, NFC communication, and UWB communication.
[0037] Optionally, the headphone wearing status detection request can be triggered according to actual conditions.
[0038] For example, obtaining a request for detecting the wearing status of a headset may include:
[0039] Generate headphone wearing status detection request regularly;
[0040] Alternatively, when the sensor of the headset recognizes that the wearing state of the headset is switched to the in-ear state, a headset wearing state detection request is generated.
[0041] In this example, a timer is used to generate a headphone wearing status detection request at the time the timer is triggered. The duration of the headphone wearing status detection request generated at the time the timer is triggered can be adjusted according to actual conditions. For example, if the timer is triggered for 1.5 seconds, a headphone wearing status detection request will be generated every 1.5 seconds. By generating headphone wearing status detection requests at a reasonable time, the headphone wearing status detection request can be responded to quickly, improving the response efficiency of the wear detection and enhancing the user experience.
[0042] In this example, based on the type of headphone sensor, the headphone sensor collects a signal related to the headphone sensor type, and based on the collected signal, determines whether the headphone wearing state has changed. For example, when the headphone sensor type is a capacitive sensor, the capacitive sensor collects a capacitance value, and based on a change in the capacitance value, determines whether the headphone wearing state has changed. For another example, when the headphone sensor is an optical sensor, the optical sensor collects a level signal, and based on a change in the level signal, determines whether the headphone wearing state has changed. When the headphone sensor determines, based on the collected signal, that the headphone wearing state has switched to the in-ear state, a headphone wearing state detection request is generated. The headphone wearing state is determined to have switched to the in-ear state, such as from the out-of-ear state to the in-ear state, or from another state to the in-ear state. If the headphone sensor determines, based on the collected signal, that the headphone wearing state has switched to the out-of-ear state, or that the headphone wearing state is continuously in the out-of-ear state, or that the headphone wearing state is continuously in the in-ear state, the headphone sensor continues collecting signals. Among them, the continuous out-of-ear state means that the duration of the out-of-ear state exceeds the preset duration, and the continuous in-ear state means that the duration of the in-ear state exceeds the preset duration. The preset duration is set according to actual conditions, for example, the preset duration is 200 milliseconds.
[0043] Step 102: Audio is collected through the feedback microphone of the headset to obtain a feedback audio signal.
[0044] In this embodiment, the feedback microphone can be located in front of the headphone speaker to collect audio signals in the current environment. This audio includes, but is not limited to, prompt sounds, the friction sound of the headphone against the ear canal when it is inserted into the ear, and external environmental sounds. The prompt sound can be played through the headphone and has a preset frequency.
[0045] In this embodiment, when the audio includes a prompt tone, the prompt tone is collected by the feedback microphone of the headset to obtain a feedback audio signal. When the audio includes external ambient sound, the external ambient sound is collected by the feedback microphone of the headset to obtain a feedback audio signal. Specifically, the audio settings can be set according to actual conditions.
[0046] It is understood that when the audio includes the friction sound between the earphones and the ear canal and the external environment sound, it is determined in combination with the specific scenario of the earphones. For example, when the earphones are actually worn in the ear, the audio collected by the feedback microphone is mainly the friction sound between the earphones and the ear canal. When the earphones are actually worn out of the ear, the audio collected by the feedback microphone is mainly the external environment sound.
[0047] In this embodiment, when the audio is a prompt tone, the prompt tone is used to perform a wearing status detection of the headset. The frequency of the prompt tone includes but is not limited to ultrasonic waves, infrasound waves, and audible sound waves. Among them, ultrasonic waves refer to sound waves with a frequency range exceeding 20,000 Hz, infrasound waves refer to sound waves with a frequency range below 20 Hz, and audible sound waves refer to sound waves with a frequency range of 20 Hz to 20,000 Hz that can be heard by the human ear. When the frequency of the prompt tone is within the frequency range that can be heard by the human ear, the prompt tone can be set according to actual conditions, such as the prompt tone is two "ding ding" sounds, and for example, the prompt tone is "start the in-ear detection function". The frequency of the prompt tone can be set according to the specific situation, such as setting a prompt tone with a frequency of 20 Hz, and for example, setting a prompt tone with a frequency of 10 Hz. Preferably, infrasound is set as the prompt tone.
[0048] It's understandable that when the infrasound waves are played through the headphone's speaker, the amplitude of the infrasound picked up by the feedback microphone differs significantly when the headphone is in the ear and when it's not. When the headphone is in the ear, the amplitude of the infrasound picked up by the feedback microphone is significantly larger. Using the infrasound as a reminder tone to detect the headphone's wearing status makes the detection more accurate.
[0049] In this embodiment, the audio capture may be configured with preset parameters, including but not limited to the signal length and sampling rate of the audio signal. Signal length refers to the duration of the captured audio signal, e.g., the captured signal length is 0.5 seconds to 1.2 seconds. The sampling rate refers to the number of samples of the audio signal taken per unit time, e.g., a sampling rate of 16k represents 16,000 samples taken per second.
[0050] Step 103: Determine the frequency of the audio, and based on the frequency, determine a target frequency band in the feedback audio signal whose frequency range meets a preset condition.
[0051] In this embodiment, a suitable filter is used to select the frequency band signal to be analyzed from the audio, based on the frequency range of the frequency band signal to be analyzed. The frequency corresponding to the frequency band signal is the frequency of the audio. The frequency range of the frequency band signal to be analyzed is related to the type of filter. For example, when the frequency band signal to be analyzed is a low-frequency signal, the filter is a low-frequency filter.
[0052] In this embodiment, the target frequency band refers to a frequency band in which the frequency range used for detecting the wearing status of the headphone in the feedback audio signal satisfies a preset condition. When the audio is a prompt tone of a preset frequency, the frequency range satisfying the preset condition means that the frequency range of the target frequency band includes the frequency of the playing prompt tone. The preset condition can be adjusted according to actual conditions. For example, the starting point of the frequency range of the target frequency band is the frequency of the playing prompt tone, and for another example, the middle frequency of the frequency range of the target frequency band is the frequency of the playing prompt tone.
[0053] Optionally, if the preset condition is that the middle frequency of the frequency range of the target frequency band is the frequency of the audio, determining, based on the frequency, the target frequency band whose frequency range in the feedback audio signal satisfies the preset condition includes:
[0054] Obtaining the frequency band length of the target frequency band to be determined;
[0055] Based on the frequency band length, a target frequency band is determined from the feedback audio signal with the frequency as the center.
[0056] In this example, the frequency band length refers to the length from the start frequency to the end frequency within the target frequency band's frequency range. For example, if the target frequency band's frequency range is (10Hz, 30Hz), the frequency band length is 20 units.
[0057] In this example, if the preset condition is that the middle frequency of the frequency range of the target frequency band is the frequency of the audio, then the frequency is used as the center frequency and a target frequency band having a length equal to the length of the frequency band is determined from the feedback audio signal.
[0058] For example, assuming the frequency is 40 Hz and the frequency band length is 20 units, with 40 Hz as the center frequency, a target frequency band (30 Hz, 50 Hz) having a length equal to the frequency band length is determined from the feedback audio signal. Optionally, if the preset condition is that the frequency range of the target frequency band includes the frequency of the audio, determining the target frequency band in the feedback audio signal whose frequency range meets the preset condition based on the frequency includes:
[0059] Obtaining the frequency band length of the target frequency band to be determined;
[0060] Based on the frequency and the frequency band length, a target frequency band including the frequency and having a length equal to the frequency band length is determined.
[0061] In this example, the frequency band length refers to the length from the start frequency to the end frequency within the target frequency band's frequency range. For example, if the target frequency band's frequency range is (10Hz, 30Hz), the frequency band length is 20 units.
[0062] In this example, if the preset condition is that the frequency range of the target frequency band includes the frequency of the audio, then the frequency and the frequency band length are used to determine a target frequency band that includes the frequency and has a length equal to the frequency band length.
[0063] For example, assuming that the frequency is 40 Hz and the frequency band length is 20 units, a target frequency band with a length of 20 units and including 40 Hz is determined from the feedback audio signal.
[0064] In this embodiment, by determining a target frequency band in the feedback audio signal whose frequency range meets a preset condition and analyzing the target frequency band, the accuracy of detecting the wearing state of the earphone can be improved.
[0065] Step 104: Determine the power spectrum of the feedback audio signal.
[0066] In this implementation, power spectrum, short for power spectral density function, is defined as the signal power within a unit frequency band. It shows how signal power varies with frequency, that is, how signal power is distributed in the frequency domain. The power spectrum shows how signal power varies with frequency.
[0067] In this embodiment, the feedback audio signal can be framed and windowed, and the resulting signal can be Fourier transformed to obtain a frequency domain signal. The modulus of the frequency domain signal is taken to determine the energy spectrum of the feedback audio signal. Based on the obtained energy spectrum, the power spectrum of the feedback audio signal can be determined. The frequency domain is a coordinate system used to describe the frequency characteristics of a signal. The energy spectrum, also called the energy spectral density, describes how the energy of a signal or time series is distributed over frequency. The energy spectrum is the square of the Fourier transform of the original signal.
[0068] In this embodiment, the feedback audio signal can also be filtered according to the frequency of the audio to determine the power spectrum of the filtered feedback audio signal, and the power corresponding to the audio signals of the same frequency in the power spectrum is averaged to obtain the average power spectrum of the feedback audio signal, which is composed of audio signals of different frequencies.
[0069] Step 105: Determine an energy index value of the feedback audio signal within the target frequency band based on the power spectrum.
[0070] In this embodiment, the energy index value is an indicator used to characterize the energy of the feedback audio signal within the target frequency band. This energy index value is an RMS value (root mean square), also known as the root mean square value, which characterizes the energy in the signal. The energy index value is obtained by obtaining parameters from the power spectrum and determining the energy of the parameters in the power spectrum. The parameters in the power spectrum represent the power corresponding to each frequency in the feedback audio signal.
[0071] Further, determining an energy index value of the feedback audio signal within the target frequency band based on the power spectrum includes:
[0072] determining the power of the feedback audio signal within the target frequency band based on the power spectrum;
[0073] Perform a root mean square calculation on the power within the target frequency band to determine an energy magnitude index value.
[0074] In this embodiment, the power of the feedback audio signal within the target frequency band is determined. This power includes the powers corresponding to multiple frequencies. The root mean square (RMS) calculation involves summing the squares of the powers of each frequency within the target frequency band, dividing the sum by the total number of frequencies, and then taking the square root. The total number of frequencies refers to the number of frequencies within the target frequency band.
[0075] In this embodiment, by determining the energy index value of the feedback audio signal within the target frequency band and comparing the energy index value with the energy threshold corresponding to the power spectrum under different wearing states of the earphone, the wearing state of the earphone can be accurately determined, thereby improving the accuracy of the earphone wearing state detection.
[0076] Step 106: If the energy index value is not lower than the preset minimum energy threshold corresponding to the in-ear state, determine that the wearing state of the earphone is the in-ear state.
[0077] In this embodiment, the preset minimum energy threshold is used to represent the minimum energy threshold in the power spectrum of the audio after being collected by the feedback microphone in the in-ear state. In other words, if the energy index value is not lower than the preset minimum energy threshold corresponding to the in-ear state, the earphone can be determined to be in-ear.
[0078] It is understood that the preset minimum energy threshold can be obtained through experimental pre-measurement. The purpose of setting the above-mentioned preset minimum energy threshold is to identify whether the earphone is in the in-ear state by comparing the energy index value with the preset minimum energy threshold. When the earphone is switched to the in-ear state, the energy index value and the preset minimum energy threshold are used to determine whether the earphone is indeed in the in-ear state, thereby improving the accuracy of the earphone wearing state detection.
[0079] When audio is collected through the feedback microphone of the headset, audio is also collected through the feedforward microphone of the headset to obtain a feedforward audio signal;
[0080] The method further comprises:
[0081] Performing sound pressure level analysis on the feedforward audio signal and the feedback audio signal to determine a first sound pressure level of the feedforward audio signal and a second sound pressure level of the feedback audio signal;
[0082] determining a sound pressure level difference between the first sound pressure level and the second sound pressure level;
[0083] If the sound pressure level difference is not lower than the maximum sound pressure level difference threshold, it is determined that the wearing state of the earphone is the in-ear state; otherwise, it is determined that the wearing state of the earphone is the out-of-ear state.
[0084] In this embodiment, the feedforward microphone can be positioned outside the earphone housing to collect audio signals from the external environment. For example, when the earphones are actually worn in the ear, the audio collected by the feedforward microphone is primarily the friction sound generated by the earphones and the ear canal. When the earphones are actually worn out of the ear, the audio collected by the feedforward microphone is external ambient sound.
[0085] In this embodiment, the above-mentioned sound pressure level analysis refers to the process of performing sound pressure level analysis on the feedforward audio signal collected by the feedforward microphone and the feedback audio signal collected by the feedback microphone. The sound pressure level is used to characterize the sound energy of the collected audio signal. The first sound pressure level refers to the sound pressure level corresponding to the feedforward audio signal collected by the feedforward microphone after the sound pressure level analysis is performed on the feedforward audio signal collected by the feedforward microphone. The second sound pressure level refers to the sound pressure level corresponding to the feedback audio signal collected by the feedback microphone after the sound pressure level analysis is performed on the feedback audio signal collected by the feedback microphone.
[0086] In this embodiment, the above-mentioned sound pressure level difference may refer to the difference between two sound pressure levels, or may be the difference between the absolute values of two sound pressure levels. The method for calculating the sound pressure level difference may be adjusted according to actual conditions. Preferably, the present application determines the sound pressure level difference by calculating the difference between the absolute values of the first sound pressure level and the second sound pressure level. By calculating the difference between the absolute values of the first sound pressure level and the second sound pressure level, the energy difference between the first sound pressure level corresponding to the audio signal collected by the feedforward microphone and the second sound pressure level of the audio signal collected by the feedback microphone can be obtained more accurately. By comparing the energy difference with the maximum sound pressure level difference threshold, the accuracy of the headphone wearing status detection can be improved.
[0087] In this embodiment, the maximum sound pressure level difference threshold is used to represent the maximum sound pressure level difference between the second sound pressure level corresponding to the audio signal collected by the feedback microphone and the first sound pressure level corresponding to the audio signal collected by the feedforward microphone in the out-of-ear state. That is, if the sound pressure level difference is not less than the maximum sound pressure level difference threshold, the earphones can be determined to be in-ear.
[0088] It is understandable that the maximum sound pressure level difference threshold can be obtained by pre-measurement through experiments. The purpose of setting the above maximum sound pressure level difference threshold is to identify whether the earphone is in the in-ear state by comparing the maximum sound pressure level difference threshold with the sound pressure level difference value. When the earphone is switched to the in-ear state, the maximum sound pressure level difference threshold and the sound pressure level difference value are used to determine whether the earphone is indeed in the in-ear state, thereby improving the accuracy of the earphone wearing state detection.
[0089] Optionally, performing sound pressure level analysis on the feedforward audio signal and the feedback audio signal includes:
[0090] If the energy index value is lower than the preset minimum energy threshold, sound pressure level analysis is performed on the feedforward audio signal and the feedback audio signal.
[0091] In this example, the energy index value is compared with the preset energy minimum threshold. If the energy index value is lower than the preset energy minimum threshold, it means that the current wearing status of the headset cannot be determined. The sound pressure level analysis is performed on the feedforward audio signal and the feedback audio signal. By performing sound pressure level analysis on the feedforward audio signal collected by the feedforward microphone and the feedback audio signal collected by the feedback microphone, the sound pressure level difference between the feedforward audio signal collected by the feedforward microphone and the feedback audio signal collected by the feedback microphone can be determined. According to the sound pressure level difference, the wearing status of the headset is further determined. Combined with power spectrum analysis and sound pressure level analysis, the accuracy of headphone wearing status detection is improved.
[0092] Optionally, determining the first sound pressure level of the feedforward audio signal and the second sound pressure level of the feedback audio signal includes:
[0093] Performing spectrum analysis on the feedforward audio signal and the feedback audio signal to determine a first spectrum of the feedforward audio signal and a second spectrum of the feedback audio signal;
[0094] Modifying spectrum parameters of the first spectrum and spectrum parameters of the second spectrum;
[0095] A first sound pressure level of the feedforward audio signal and a second sound pressure level of the feedback audio signal are determined based on the modified first spectrum and the modified second spectrum.
[0096] In this embodiment, spectrum analysis refers to the process of performing Fourier transform on the feedforward audio signal collected by the feedforward microphone and the feedback audio signal collected by the feedback microphone, and analyzing the Fourier transformed signals. The spectrum includes an amplitude spectrum and a phase spectrum. The amplitude spectrum is a spectrum composed of the amplitude of each frequency point, and the phase spectrum is a spectrum composed of the phase of each frequency point. Among them, the first spectrum is used to characterize the distribution of the signal frequency of the feedforward audio signal after Fourier transform. The second spectrum is used to characterize the distribution of the signal frequency of the feedback audio signal after Fourier transform.
[0097] In this embodiment, the spectrum parameters are related to the type of spectrum; when the spectrum is an amplitude spectrum, the spectrum parameters are the amplitudes of each frequency point; when the spectrum is a phase spectrum, the spectrum parameters are the phases of each frequency point. The specific setting can be based on the actual situation. The correction methods include but are not limited to A-weighting, B-weighting, and C-weighting. The correction method can also be other correction methods. Among them, in the embodiment of the present application, weighting refers to correcting the spectrum parameters according to certain rules. A-weighting simulates the frequency characteristics of the human ear to low-intensity sounds below 55dB sound pressure level; B-weighting simulates the frequency characteristics of the human ear to medium-intensity sounds of 55-85dB sound pressure level; C-weighting simulates the frequency characteristics of the human ear to high-intensity sounds above 85dB sound pressure level. The selected correction method is related to the frequency of the audio. When the audio is low-frequency audio, it is preferred to use A-weighting for correction.
[0098] In this embodiment, by performing spectral analysis on the feedforward audio signal and the feedback audio signal, and correcting the spectral parameters of the first spectrum and the spectral parameters of the second spectrum, the first sound pressure level of the feedforward audio signal and the second sound pressure level of the feedback audio signal are determined based on the corrected first spectrum and the corrected second spectrum, and the accuracy of the headphone wearing status detection is improved by combining power spectrum analysis and sound pressure level analysis.
[0099] This embodiment further provides a headphone wearing state detection device, which can be integrated into a headphone.
[0100] For example, as shown in FIG2 , the headphone wearing state detection device may include:
[0101] The detection request acquisition module 201 is used to obtain a headphone wearing status detection request.
[0102] The feedback audio signal determining module 202 is configured to collect audio through the feedback microphone of the headset to obtain a feedback audio signal.
[0103] The target frequency band determination module 203 is configured to determine the frequency of the audio, and based on the frequency, determine a target frequency band in the feedback audio signal whose frequency range meets a preset condition.
[0104] The power spectrum determination module 204 is configured to determine the power spectrum of the feedback audio signal.
[0105] The energy index value determining module 205 is configured to determine the energy index value of the feedback audio signal within the target frequency band based on the power spectrum.
[0106] The wearing state determining module 206 is configured to determine that the wearing state of the earphone is the in-ear state if the energy magnitude index value is not lower than a preset minimum energy threshold corresponding to the in-ear state.
[0107] Optionally, in the device of the embodiment of the present application, when audio is collected through the feedback microphone of the headset, audio is also collected through the feedforward microphone of the headset to obtain a feedforward audio signal;
[0108] The headphone wearing state detection device further includes:
[0109] a sound pressure level analysis unit, configured to perform sound pressure level analysis on the feedforward audio signal and the feedback audio signal to determine a first sound pressure level of the feedforward audio signal and a second sound pressure level of the feedback audio signal;
[0110] a sound pressure level difference determining unit, configured to determine a sound pressure level difference between the first sound pressure level and the second sound pressure level;
[0111] The wearing state determining unit is configured to determine that the wearing state of the earphone is an in-ear state if the sound pressure level difference is not lower than a maximum sound pressure level difference threshold; otherwise, determine that the wearing state of the earphone is an out-of-ear state.
[0112] Optionally, in the apparatus of the embodiment of the present application, in the sound pressure level analysis unit, performing sound pressure level analysis on the feedforward audio signal and the feedback audio signal includes:
[0113] If the energy index value is lower than the preset minimum energy threshold, sound pressure level analysis is performed on the feedforward audio signal and the feedback audio signal.
[0114] Optionally, in the apparatus of the embodiment of the present application, in the sound pressure level analysis unit, determining the first sound pressure level of the feedforward audio signal and the second sound pressure level of the feedback audio signal includes:
[0115] a spectrum analysis unit, configured to perform spectrum analysis on the feedforward audio signal and the feedback audio signal to determine a first spectrum of the feedforward audio signal and a second spectrum of the feedback audio signal;
[0116] a correction unit, configured to correct the spectrum parameters of the first spectrum and the spectrum parameters of the second spectrum;
[0117] A sound pressure level determining unit is configured to determine a first sound pressure level of the feedforward audio signal and a second sound pressure level of the feedback audio signal based on the modified first spectrum and the modified second spectrum.
[0118] Optionally, in the apparatus of the embodiment of the present application, in the target frequency band determination module 203, determining, based on the frequency, a target frequency band in the feedback audio signal whose frequency range satisfies a preset condition includes:
[0119] A frequency band length obtaining unit, configured to obtain the frequency band length of the target frequency band to be determined;
[0120] A target frequency band determining unit is configured to determine, based on the frequency and the frequency band length, a target frequency band containing the frequency and having a length equal to the frequency band length.
[0121] Optionally, in the apparatus of the embodiment of the present application, in the energy index value determining module 205, determining the energy index value of the feedback audio signal within the target frequency band based on the power spectrum includes:
[0122] a power determination unit, configured to determine the power of the feedback audio signal within the target frequency band based on the power spectrum;
[0123] The energy index value determining unit is used to perform root mean square calculation on the power within the target frequency band to determine the energy index value.
[0124] Optionally, in the apparatus of the embodiment of the present application, in the detection request acquisition module 201, acquiring the headphone wearing status detection request includes:
[0125] A first generating unit, configured to periodically generate a headphone wearing status detection request;
[0126] or,
[0127] The second generating unit is configured to generate a headphone wearing state detection request when the sensor of the headphone recognizes that the wearing state of the headphone is switched to the in-ear state.
[0128] The device of this embodiment determines the wearing state of the earphone by comparing the energy index value within the target frequency band with the corresponding preset minimum energy threshold in the in-ear state, thereby improving the detection accuracy of the wearing state of the earphone.
[0129] Correspondingly, an embodiment of the present application also provides a headset, and the type of the headset is not limited, such as a wired headset, a wireless headset, a Bluetooth headset, a head-mounted headset, etc.
[0130] As shown in Figure 3, Figure 3 is a schematic diagram of the structure of the headset provided in an embodiment of the present application. The headset 300 includes a processor 301 having one or more processing cores, a memory 302 having one or more computer-readable storage media, and a computer program stored in the memory 302 and executable on the processor. The processor 301 is electrically connected to the memory 302. Those skilled in the art will appreciate that the headset structure shown in the figure does not limit the headset and may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0131] Processor 301 is the control center of headset 300. It connects all components of headset 300 using various interfaces and circuits. It executes various functions of headset 300 and processes data by running or loading software programs and / or units stored in memory 302 and accessing data stored in memory 302. Processor 301 can be a CPU, a network processor (NP), etc., and can implement or execute the various methods, steps, and logic blocks disclosed in the embodiments of this application.
[0132] In the embodiment of the present application, the processor 301 in the headset 300 loads instructions corresponding to one or more application processes into the memory 302 according to the following steps, and the processor 301 runs the application stored in the memory 302 to implement various functions, such as:
[0133] Get the headset wearing status detection request;
[0134] Acquire audio through the feedback microphone of the headset to obtain a feedback audio signal;
[0135] Determining the frequency of the audio, and based on the frequency, determining a target frequency band in the feedback audio signal whose frequency range meets a preset condition;
[0136] determining a power spectrum of the feedback audio signal;
[0137] Determining an energy index value of the feedback audio signal within the target frequency band based on the power spectrum;
[0138] If the energy index value is not lower than the preset minimum energy threshold corresponding to the in-ear state, the wearing state of the earphone is determined to be the in-ear state. Further, the various functions implemented by running the application stored in the memory 302 can also be referred to the description of the aforementioned embodiment and will not be repeated here.
[0139] Furthermore, various functions implemented by running the application stored in the memory 302 can also be described in the aforementioned embodiments and will not be repeated here.
[0140] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0141] Optionally, as shown in FIG3 , the headset 300 further includes: a radio frequency circuit 303, an audio circuit 304, an input unit 305, and a power supply 306. The processor 301 is electrically connected to the radio frequency circuit 303, the audio circuit 304, the input unit 305, and the power supply 306, respectively. Those skilled in the art will appreciate that the headset structure shown in FIG3 does not limit the headset, and may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0142] The RF circuit 303 can be used to send and receive RF signals to establish wireless communication with network devices or other headphones such as terminals through wireless communication, and to send and receive signals (such as audio signals to achieve audio playback) between network devices or other headphones.
[0143] The audio circuit 304 can be used to play and collect audio signals through a speaker and microphone. The audio circuit 304 can convert received audio data into electrical signals and transmit them to the speaker, which then converts them into sound signals for output. The microphone, on the other hand, converts collected sound signals into electrical signals, which are then received by the audio circuit 304 and converted into audio data. The audio data is then output to the processor 301 for processing, and then sent to, for example, another headset via the RF circuit 303. Alternatively, the audio data can be output to the memory 302 for further processing.
[0144] The input unit 305 may be used to receive input control information (such as volume adjustment information, song switching information, playback speed fast forward, fast rewind information, etc.). Optionally, the input unit may include a mechanical button.
[0145] Power supply 306 is used to power the various components of headset 300. Optionally, power supply 306 can be logically connected to processor 301 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. Power supply 306 can also include one or more DC or AC power supplies, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and other arbitrary components.
[0146] Although not shown in FIG. 3 , the headset 300 may further include a sensor (such as an optical sensor and a capacitive sensor), a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.
[0147] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0148] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0149] To this end, an embodiment of the present application provides a computer-readable storage medium storing a plurality of computer programs, which can be loaded by a processor to execute any of the headphone wearing status detection methods provided in the embodiments of the present application. For example, the computer program can execute the following steps of the headphone wearing status detection method:
[0150] Get the headset wearing status detection request;
[0151] Acquire audio through the feedback microphone of the headset to obtain a feedback audio signal;
[0152] Determining the frequency of the audio, and based on the frequency, determining a target frequency band in the feedback audio signal whose frequency range meets a preset condition;
[0153] determining a power spectrum of the feedback audio signal;
[0154] Determining an energy index value of the feedback audio signal within the target frequency band based on the power spectrum;
[0155] If the energy index value is not lower than a preset minimum energy threshold corresponding to the in-ear state, it is determined that the wearing state of the earphone is the in-ear state.
[0156] Furthermore, for the detailed steps of the above method steps, please refer to the description in the above embodiments, which will not be repeated here.
[0157] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0158] The computer-readable storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0159] Since the computer program stored in the computer-readable storage medium can execute any one of the headphone wearing status detection methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the headphone wearing status detection methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0160] According to one aspect of the present application, a computer program product or computer program is also provided. The computer program product or computer program includes computer instructions stored in a computer-readable storage medium. A processor of a headset reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the headset to perform the methods provided in various optional implementations of the above embodiments.
[0161] In the above-mentioned embodiments of the headphone wearing state detection device, computer-readable storage medium, headphone, and computer program product, the descriptions of each embodiment have different focuses. For parts not described in detail in a particular embodiment, reference can be made to the relevant descriptions of other embodiments. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes and beneficial effects of the above-described headphone wearing state detection device, computer-readable storage medium, computer program product, headphone, and corresponding units can be referred to the description of the headphone wearing state detection method in the above embodiments, and the details will not be repeated here.
[0162] The above is a detailed introduction to the headphone wearing status detection method, device, headphone, computer-readable storage medium and computer program product provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for detecting a wearing state of an earphone, characterized in that: include: Get the headset wearing status detection request; Collecting audio through the feedback microphone of the headset to obtain a feedback audio signal; Determine the frequency of the audio, and based on the frequency, determine a target frequency band in the feedback audio signal whose frequency range meets a preset condition; determining a power spectrum of the feedback audio signal; Based on the power spectrum, determining an energy index value of the feedback audio signal within the target frequency band; If the energy index value is not lower than a preset minimum energy threshold corresponding to the in-ear state, it is determined that the wearing state of the earphone is the in-ear state.
2. The headphone wearing status detection method according to claim 1, characterized in that: When audio is collected through the feedback microphone of the headset, audio is also collected through the feedforward microphone of the headset to obtain a feedforward audio signal; The method further comprises: Performing sound pressure level analysis on the feedforward audio signal and the feedback audio signal to determine a first sound pressure level of the feedforward audio signal and a second sound pressure level of the feedback audio signal; determining a sound pressure level difference between the first sound pressure level and the second sound pressure level; If the sound pressure level difference is not lower than the maximum sound pressure level difference threshold, it is determined that the wearing state of the earphone is an in-ear state; otherwise, it is determined that the wearing state of the earphone is an out-of-ear state.
3. The headphone wearing status detection method according to claim 2, characterized in that: The performing sound pressure level analysis on the feedforward audio signal and the feedback audio signal comprises: If the energy index value is lower than the preset minimum energy threshold, a sound pressure level analysis is performed on the feedforward audio signal and the feedback audio signal.
4. The headphone wearing status detection method according to claim 2, characterized in that: The determining the first sound pressure level of the feedforward audio signal and the second sound pressure level of the feedback audio signal comprises: Performing spectrum analysis on the feedforward audio signal and the feedback audio signal to determine a first spectrum of the feedforward audio signal and a second spectrum of the feedback audio signal; Modifying spectrum parameters of the first spectrum and spectrum parameters of the second spectrum; A first sound pressure level of the feedforward audio signal and a second sound pressure level of the feedback audio signal are determined based on the modified first frequency spectrum and the modified second frequency spectrum.
5. The headphone wearing status detection method according to any one of claims 1 to 4, characterized in that: The determining, based on the frequency, a target frequency band in which the frequency range of the feedback audio signal meets a preset condition comprises: Obtaining the frequency band length of the target frequency band to be determined; Based on the frequency and the frequency band length, a target frequency band including the frequency and having a length equal to the frequency band length is determined.
6. The headphone wearing status detection method according to any one of claims 1 to 4, characterized in that: Determining the energy index value of the feedback audio signal within the target frequency band based on the power spectrum includes: Based on the power spectrum, determining the power of the feedback audio signal within the target frequency band; The power within the target frequency band is calculated by a root mean square (RMS) to determine an energy index value.
7. The headphone wearing status detection method according to any one of claims 1 to 4, characterized in that: The obtaining of the headphone wearing status detection request includes: Generate headphone wearing status detection request regularly; Alternatively, when the sensor of the earphone recognizes that the wearing state of the earphone is switched to the in-ear state, an earphone wearing state detection request is generated.
8. A device for detecting a wearing state of an earphone, characterized in that: include: A detection request acquisition module is used to obtain a headphone wearing status detection request; A feedback audio signal determination module, used to collect audio through a feedback microphone of the headset to obtain a feedback audio signal; A target frequency band determination module, used to determine the frequency of the audio, and based on the frequency, determine a target frequency band in the feedback audio signal whose frequency range meets a preset condition; A power spectrum determination module, used to determine the power spectrum of the feedback audio signal; An energy index value determination module, used to determine the energy index value of the feedback audio signal within the target frequency band based on the power spectrum; The wearing state determination module is used to determine that the wearing state of the earphone is the in-ear state if the energy magnitude index value is not lower than the preset energy minimum threshold corresponding to the in-ear state.
9. A headset, characterized in that: It comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of the headphone wearing status detection method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for a processor to load to execute the steps of the headphone wearing status detection method according to any one of claims 1 to 7.
Citation Information
Patent Citations
In-ear state detection method and device for ear-mounted device, and mobile terminal
CN111294719A
Earphone wearing state detection method and device, earphone and storage medium
CN111629297A
Wearing detection method, wearable device and storage medium
CN115314804A
Method and device for detecting earphone wearing status, and earphone
US20210266658A1
Cited By
Wearing detection method, wearable device and storage medium
CN115314804A