A method of earpiece tap detection
By calculating the change in the three-axis acceleration data of the headphones to determine the dynamic tapping threshold, and combining the detection range and filtering conditions, the problem of misjudgment of user tapping events in headphone tapping detection is solved, thus improving the user experience.
Patent Information
- Application Number
- CN202511299802.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-12
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2045-09-12
AI Technical Summary
Existing headphone tap detection methods cannot effectively distinguish between user tapping events, accidental touch events, and double-tap events, resulting in a poor user experience.
Triaxial acceleration data is acquired by an accelerometer, the change in acceleration is calculated to determine the dynamic tapping threshold, and multiple detection intervals and filtering conditions are combined to determine pre-tap events and consecutive tap events, and the number of consecutive taps is analyzed.
It improves environmental adaptability, effectively filters short-term random vibrations and misidentifications, and enhances the user experience.
Smart Images

Figure CN120812513B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of earphones, in particular to an earphone knock detection method. BACKGROUND
[0002] Among the interaction modes of earphones, knock control has become a common function due to its convenience. In traditional solutions, an acceleration sensor is usually used, and threshold judgment is made based on the acceleration amplitude. When the acceleration amplitude exceeds the set threshold, it is considered that a knock event is detected. This way, during user movement, such as walking or running, the earphone will also produce acceleration changes, which can easily trigger false positives, causing the earphone to frequently execute incorrect instructions. Moreover, when the earphone is subjected to external light impact or shaking, it may also be misjudged as a knock operation.
[0003] In the prior art, to improve the recognition accuracy of knock control interaction, a common solution is to combine the signals of multiple sensors and adjust the decision weight to improve the accuracy of knock device detection. However, this approach also increases the cost of the device, which is not conducive to the lightweight needs of the device. When there is only an acceleration sensor, it is difficult to effectively distinguish between user knock events, accidental touch events, and double-click events, resulting in poor user experience. SUMMARY
[0004] To overcome the shortcomings of the prior art, the present application aims to provide an earphone knock detection method to solve the technical problem of the prior art that cannot effectively distinguish between user knock events, accidental touch events, and double-click events, resulting in poor user experience.
[0005] To achieve the above-mentioned purpose, in a first aspect, the present application provides an earphone knock detection method, comprising the following steps:
[0006] obtaining three-axis acceleration data of the earphone in a current collection window through an acceleration sensor, and calculating the change amount of acceleration based on the three-axis acceleration data to determine a dynamic knock threshold;
[0007] determining whether the current instantaneous knock intensity at the current time is greater than the dynamic knock threshold;
[0008] if the current instantaneous knock intensity is greater than the dynamic knock threshold, it is determined to be a pre-knock event;
[0009] if there is a second pre-knock with an instantaneous knock intensity greater than the dynamic knock threshold in a first detection interval for double-click waiting after the pre-knock event is determined, it is determined to be a double-click event and the number of knocks is recorded;
[0010] If there is no pre-hitting with a transient hitting force greater than the dynamic hitting threshold in the first detection interval for a continuous hitting waiting after the continuous hitting event, the continuous hitting judgment is ended and the actual continuous hitting number is analyzed based on the hitting number.
[0011] According to an aspect of the above technical solution, the calculation expression of the transient hitting force is:
[0012]
[0013]
[0014] In the formula, p is the transient hitting force, is the x-axis acceleration data at the i-th moment, is the y-axis acceleration data at the i-th moment, is the y-axis acceleration data at the i-th moment, is the change amount of acceleration;
[0015] The calculation expression of the dynamic hitting threshold is:
[0016]
[0017]
[0018]
[0019] In the formula, L is the dynamic hitting threshold, is the sum of absolute values of three-axis acceleration data, is the mean value of the sum of absolute values of acceleration data from the i-8th moment to the i-th moment, is the minimum value of the sum of absolute values of acceleration data in the preset time window. According to an aspect of the above technical solution, after the step of determining the pre-hitting event, the method further comprises:
[0020] The first detection interval includes a front detection interval and a rear detection interval.
[0021]
[0022] If there is a third pre-hitting with a transient hitting force greater than a first preset value in the front detection interval after determining the pre-hitting event, and the transient hitting force of the third pre-hitting is less than a second preset value, the third pre-hitting is ignored.
[0023] According to an aspect of the above technical solution, after the step of determining the pre-hitting event, the method further comprises:
[0024] a second detection interval after the first determination time when the pre-tap event is determined, the second detection interval being between the first determination time and the first detection interval, and recording the number of interval taps with a tap force greater than the tap threshold value;
[0025] If a third detection interval after the first determination time has a fourth pre-tap with a tap force greater than the dynamic tap threshold value, and the number of interval taps meets the first preset range, the fourth pre-tap is ignored, and the third detection interval is located at the beginning of the previous detection interval.
[0026] According to an aspect of the above technical solution, after the step of determining the pre-tap event, the method further comprises:
[0027] If a third detection interval after the first determination time has a fifth pre-tap with a tap force greater than the dynamic tap threshold value, and the number of interval taps is greater than the tap number threshold value, the fifth pre-tap is ignored, the current continuous tap waiting time is corrected to a preset waiting value, and the current interval tap number is modified to a preset number, which meets the first preset range.
[0028] According to an aspect of the above technical solution, the method further comprises:
[0029] Obtain the average value of multiple sets of three-axis acceleration data, if the average value of the x-axis is 3500-4500, and the average values of the y-axis and the z-axis are both -800-800, the earphone is considered to be in a suspected placement state for a first preset time;
[0030] If there is a detection value with a tap force greater than a third preset value in the fourth detection interval, and the number of detection values is greater than a fourth preset value, the earphone is considered to be in a continuous low-intensity vibration state;
[0031] If the earphone is in a low-intensity vibration state, the continuous tap number is cleared and the response of the three-axis acceleration data is suspended for a second preset time;
[0032] If the sum of the absolute values of the three-axis acceleration data is greater than a fifth preset value, and in a fifth detection interval, the sum of the absolute values of the three-axis acceleration data is less than a sixth preset value, the earphone is considered to be in a falling state;
[0033] If the earphone is in a falling state, the continuous tap number is cleared and the response of the three-axis acceleration data is suspended for a third preset time;
[0034] If the sum of the absolute values of the three-axis acceleration data is 0, the tap number is cleared and the response of the three-axis acceleration data is suspended for a fourth preset time.
[0035] According to an aspect of the above technical solution, the method further comprises:
[0036] If the earphone is in a suspected placement state, the maximum instantaneous tapping force in the sixth detection interval after each pre-tapping event in the continuous tapping event state is obtained as the instantaneous tapping correction force of each tapping;
[0037] After the continuous tapping judgment is completed, the filtered tapping number of times in which the continuous instantaneous tapping correction force in the continuous tapping event state is greater than the preset tapping threshold value is obtained, and the filtered tapping number of times is taken as the actual tapping number of times.
[0038] According to an aspect of the above technical solution, the method further comprises:
[0039] After the continuous tapping judgment is completed, the maximum value of the axial acceleration difference in the sixth detection interval after each pre-tapping event in the continuous tapping event state is obtained;
[0040] The angle between the tapping direction and the expected tapping direction is calculated based on the maximum value, and if the angle between the tapping direction corresponding to each pre-tapping event in the continuous tapping event state and the expected tapping direction is greater than a preset angle, and the instantaneous tapping force corresponding to each pre-tapping event is less than a seventh preset value, then the tapping is determined to be invalid.
[0041] According to an aspect of the above technical solution, the method further comprises:
[0042] After the continuous tapping judgment is completed, if the instantaneous tapping force corresponding to each pre-tapping event is less than an eighth preset value, then the tapping is determined to be invalid.
[0043] According to an aspect of the above technical solution, the method further comprises:
[0044] After the continuous tapping judgment is completed, it is determined whether the earphone is in a suspected placement state;
[0045] If the earphone is in a suspected placement state, the rotation angle of the earphone posture before and after tapping is calculated, and if the rotation angle exceeds a first rotation angle threshold value, then the tapping is determined to be invalid.
[0046] If the earphone is not in a suspected placement state, the rotation angle of the earphone posture before and after tapping is calculated, and if the rotation angle exceeds a second rotation angle threshold value, then the tapping is determined to be invalid.
[0047] Compared with the prior art, the beneficial effects of the present application are that the dynamic tapping threshold value is determined by calculating the acceleration change based on the three-axis acceleration data, which improves the environmental adaptability compared with the setting of a fixed threshold value, and the response force and time of tapping and the continuous tapping time after tapping are filtered, effectively filtering short-time random vibration, such as false recognition caused by wearing adjustment or movement, and improving the user experience. BRIEF DESCRIPTION OF DRAWINGS
[0048] Figure 1 a flow chart of the earphone knock detection method in an embodiment of the present application;
[0049] Figure 2 a data graph of the sum of absolute values of three-axis acceleration data in a motion state in an embodiment of the present application;
[0050] Figure 3 a data graph of the sum of absolute values of three-axis acceleration data in a non-motion state in an embodiment of the present application;
[0051] Figure 4 a three-axis acceleration data change graph of the vibration generated in the earphone wearing / prevention process in an embodiment of the present application;
[0052] The following detailed description will further describe the present application in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION
[0053] In order to facilitate the understanding of the present application, the present application will be described more fully below with reference to the accompanying drawings. Several embodiments of the present application are shown in the drawings. However, the present application can be realized in many different forms and is not limited to the embodiments described herein. On the contrary, these embodiments are provided so that the disclosure of the present application is more thorough and comprehensive.
[0054] It should be noted that when an element is referred to as being "fixedly attached" to another element, it can be directly on the other element or there can be intervening elements. When an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements can be present. As used herein the terms "vertical", "horizontal", "left", "right", and the like are merely used for the purpose of illustration.
[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0056] Embodiment One
[0057] Referring to Figure 1 , a flow chart of the earphone knock detection method in an embodiment of the present application is shown. As shown in the figure, the method includes the following steps:
[0058] Step S100: Acquire triaxial acceleration data of the earphone in the current acquisition window using an accelerometer, and calculate the change in acceleration based on the triaxial acceleration data to determine the dynamic tapping threshold. In some application scenarios of this embodiment, the accelerometer provides a set of acceleration data every 4ms as the aforementioned triaxial acceleration data.
[0059] Preferably, the expression for calculating the instantaneous striking force is as follows:
[0060] ;
[0061] , , ;
[0062] In the formula, p is the instantaneous striking force. The x-axis acceleration data at time i. The data represents the y-axis acceleration at time i. The data represents the y-axis acceleration at time i. The change in acceleration;
[0063] The calculation expression for the dynamic tapping threshold is:
[0064] ;
[0065] ;
[0066] ;
[0067] In the formula, L is the dynamic tapping threshold. This is the sum of the absolute values of the three-axis acceleration data. Let be the mean of the sum of the absolute values of the acceleration data from time i-8 to time i. Within the preset time window The minimum value is calculated by taking the average of the sum of the absolute values of the current set of triaxial acceleration data and the previous 8 sets of triaxial acceleration data. Use the smallest value from the 120 sets of data (480ms) prior to the current time. This is used to measure the intensity of the user's current movement, and then the dynamic tap threshold is calculated based on the intensity of the movement. The minimum value of the dynamic tap threshold is 5000; if it is less than 5000, it is counted as 5000. For ease of understanding, the sum of the absolute values of the three-axis acceleration data during movement and the sum of the absolute values of the three-axis acceleration data during non-movement are shown in the following graphs: Figure 2 , Figure 3 As shown, Figure 2 As shown, the data fluctuates greatly at this time, and the tap threshold is relatively high.Figure 3 At this time, the data is relatively stable, and the knocking threshold is low.
[0068] In step S200, it is determined whether the current instantaneous knocking strength at the current time is greater than the dynamic knocking threshold.
[0069] In step S300, if the current instantaneous knocking strength is greater than the dynamic knocking threshold, it is determined that a pre-knocking event occurs.
[0070] Specifically, the three-axis acceleration change value is calculated as the instantaneous knocking strength. By calculating the three-axis acceleration and measuring the current motion intensity of the user of the earphone, different knocking thresholds are calculated according to different motion intensities. When the knocking strength is greater than the knocking threshold, it is considered that a knock occurs.
[0071] In step S400, if there is a second pre-knocking with the instantaneous knocking strength greater than the dynamic knocking threshold in the first detection interval for the knocking waiting after the pre-knocking event is determined, it is determined that a double-knocking event occurs and the number of knocks is recorded. Preferably, the first detection interval is 130ms-430ms, that is, when the second knock occurs between 130ms-430ms after the first knock, and the double-knocking filtering detection is passed, it is considered as a double-knocking.
[0072] Preferably, in the embodiment, after the step of determining the pre-knocking event, the method further comprises:
[0073] The first detection interval includes a front detection interval and a rear detection interval.
[0074] If there is a third pre-knocking with the instantaneous knocking strength greater than a first preset value in the front detection interval after the pre-knocking event is determined, and the instantaneous knocking strength of the third pre-knocking is less than a second preset value, the third pre-knocking is ignored. Specifically, for the pre-knocking event with the instantaneous knocking strength greater than the dynamic knocking threshold occurring in the front part of the first detection interval, that is, 130ms to 200ms, if the instantaneous knocking strength of the previous knock is greater than 30000, and the instantaneous knocking strength of the current knock is less than 6000. This knock is ignored, but the records of the previous double-knocking number and the double-knocking waiting duration are not cleared, and the next knock is continued to be waited for to form a double-knocking. This part is mainly used to prevent false touches caused by motion.
[0075] Preferably, in the embodiment, after the step of determining the pre-knocking event, the method further comprises:
[0076] In the second detection interval after the first determination time point of the pre-tap event, the number of interval taps of the transient tap intensity greater than the tap threshold is recorded, and the second detection interval is between the first determination time point and the first detection interval. Preferably, in the present embodiment, the above-mentioned second detection interval is 40ms to 130ms, that is, before the first detection interval, how many taps are generated (the data transient tap intensity is greater than the dynamic tap threshold) is recorded as the number of interval taps.
[0077] If there is a fourth pre-tap with a transient tap intensity greater than the dynamic tap threshold in the third detection interval after the first determination time point, and the number of interval taps meets the first preset range, the fourth pre-tap is ignored, and the third detection interval is located at the beginning of the previous detection interval. When a tap is generated between the third detection interval (130ms-160ms) of the continuous tap waiting and the number of interval taps is 1-5, the tap is ignored;
[0078] After the step of determining the pre-tap event, the method further comprises:
[0079] If there is a fifth pre-tap with a transient tap intensity greater than the dynamic tap threshold in the third detection interval after the first determination time point, and the number of interval taps is greater than the tap number threshold, the fifth pre-tap is ignored, the current continuous tap waiting time is corrected to a preset waiting value, and the current interval tap number is modified to a preset number, which meets the first preset range.
[0080] When a tap is generated between the continuous tap waiting of 130ms-160ms, and the number of interval taps is greater than 5, the tap is ignored, and the continuous tap waiting time is changed to 80ms (the purpose is to encounter continuous tentative taps, which will cause continuous ignoring of tentative taps and delay of the time for waiting for the next tap, finally skip this data and return to single tap; change the continuous tap waiting time from 130-160ms to 80ms, which is equivalent to allowing the next continuous tap to be delayed by 50-80ms), and the number of interval taps is modified to 2 (the purpose is that since the continuous tap waiting time is delayed by 50-80ms, there is no data in this time length, the first time length for counting the number of interval taps is long (40ms-130ms, a total of 90ms), and 2 is a compensation for the shortened time; and it is convenient to unify the parameters without additional parameters for the modified interval tap number), thereby filtering the continuous taps caused by continuous tentative taps. This part is mainly used to prevent false touch caused by wearing.
[0081] Preferably, in the present embodiment, the above-mentioned method further comprises:
[0082] The average value of multiple sets of three-axis acceleration data is obtained. If the average value of the x-axis is 3500~4500, and the average values of the y-axis and z-axis are both -800~800, then the headphones are considered to be in a suspected placement state and maintained for a first preset time. Specifically, the first preset time is preferably 8 seconds. The average value of the acceleration of each axis of the first 30 sets of data is calculated. If the average value of the x-axis acceleration is between 3500-4500, and the average values of the y and z accelerations are between ±800, then the current state is considered to be a suspected placement state, and this state is maintained for the next 8 seconds. The average value of the acceleration of each axis of the first 90 sets of data is recorded every 30 sets of data. This is used to detect changes in the headphone's attitude.
[0083] If, within the fourth detection interval, there is a detection value where the instantaneous tapping force is greater than the third preset value, and the number of such detection values is greater than the fourth preset value, then the headphones are considered to be in a state of continuous low-intensity vibration. Specifically, if the instantaneous tapping force is greater than 5000, it is recorded once. If more than 20 out of the last 30 sets of data show an instantaneous tapping force greater than 5000, then the headphones are considered to be currently in a state of continuous low-intensity vibration.
[0084] If the earphone is in a low-intensity vibration state, the number of consecutive taps is cleared and the response of the three-axis acceleration data is paused for a second preset time; the second preset time is 160ms. If the earphone is detected to be in a continuous low-intensity vibration state, the current number of taps (used for consecutive tap judgment) is cleared and the response to 40 sets of tap data is paused (160ms) to prevent accidental touches due to placement.
[0085] If the sum of the absolute values of the three-axis acceleration data is greater than the fifth preset value, and within the fifth detection interval, there exists a sum of the absolute values of the three-axis acceleration data that is less than the sixth preset value, then the earphone is considered to be in a dropped state. The fifth preset value includes two sets of parameter settings, one set being 20000 and the other being 50000. The sixth preset value also includes two sets of parameters, 120 and 300, corresponding to the above 20000 / 40000.
[0086] If the headphones are in a drop state, the number of consecutive clicks is cleared and the response of the three-axis acceleration data is paused for a third preset time; the third preset time is 2000ms. The sum of the absolute values of the three-axis acceleration data... If the value is greater than 20000 / 40000, and the absolute value of one of the three-axis acceleration data points in the previous two sets of data is less than 120 / 300, then the tapping in the current set of data is considered to have occurred due to a drop. The current tapping count is then cleared, and the response to tapping data is paused for 500 sets (2000ms).
[0087] If the sum of the absolute values of the triaxial acceleration data is 0, clear the number of taps and suspend the response of the three-axis acceleration data for a fourth preset time. The fourth preset time is 440 ms, is 0, it means that the sensor probably provides false data, and the data around this time is usually abnormal, so clear the current number of taps and suspend the response of the 110 groups of data (440 ms).
[0088] Preferably, in the embodiment, the method further comprises:
[0089] If the earphone is in the suspected placement state, the maximum instantaneous tapping force in the sixth detection interval after each pre-tap event in the continuous tapping event state is obtained as the instantaneous tapping correction force of each tap.
[0090] After the end of the continuous tapping judgment, the filtered continuous tapping number in which the continuous instantaneous tapping correction force in the continuous tapping event state is greater than the preset tapping threshold is obtained, and the filtered continuous tapping number is taken as the actual continuous tapping number. Preferably, the sixth detection interval is within 20 ms after the first judgment time of the continuous tapping judgment,
[0091] Understandably, if the current state is judged to be the suspected placement state in the posture evaluation and recording, the continuous tapping is filtered as follows. The maximum instantaneous tapping force in the range of 20 ms after each tap in the continuous tapping is taken as the instantaneous tapping force of each tap, the maximum continuous number of taps in which the instantaneous tapping force is greater than 11000 is obtained, and the continuous tapping number obtained in the (continuous tapping recognition) is updated. (For example, the four-tap forces are 12000, 12000, 8000, and 12000, and the final continuous tapping number obtained after filtering is 2, which is a double-tap tapping. This part is used to prevent false touch caused by placement and to make a series of judgments on the taps in the continuous tapping after the end of the continuous tapping, and to filter and detect the continuous tapping force factors in the suspected placement state.
[0092] Preferably, in the embodiment, the method further comprises: after the end of the continuous tapping judgment, obtaining the maximum value of the acceleration difference of each axis in the sixth detection interval after each pre-tap event in the continuous tapping event state.
[0093] An angle between the knocking direction and the expected knocking direction is calculated based on the maximum value, and if the angle between the knocking direction corresponding to each pre-knocking event in the continuous knocking event state and the expected knocking direction is greater than a preset angle, and the instantaneous knocking strength corresponding to each pre-knocking event is less than a seventh preset value, it is determined that the knocking is invalid. Specifically, the maximum value of the acceleration difference of each axis within 20 ms after each knocking in the continuous knocking is obtained, and the angle between the knocking direction and the x-axis is calculated based on the maximum value. If the angle between the knocking direction of each knocking in a continuous knocking and the x-axis (the expected knocking direction) is greater than 75 degrees, and the instantaneous knocking strength is greater than 30,000, it is considered that the knocking is invalid. This part is mainly used to prevent false touch caused by movement, wearing and placement, and is used for the final series of judgments on the knocking in the continuous knocking after the continuous knocking is ended, and the knocking angle factor is filtered and detected.
[0094] Preferably, in the embodiment, the method further comprises: after the end of the continuous knocking judgment, if the instantaneous knocking strength corresponding to each pre-knocking event is less than an eighth preset value, it is determined that the knocking is invalid. The eighth preset value is 9,000, and if the maximum instantaneous knocking strength in a continuous knocking is less than 9,000, the continuous knocking is ignored. This part is used for the final series of judgments on the knocking in the continuous knocking after the continuous knocking is ended, and the knocking strength factor is filtered and detected.
[0095] Preferably, in the embodiment, the method further comprises:
[0096] After the end of the continuous knocking judgment, it is judged whether the earphone is in a suspected placement state;
[0097] If the earphone is in the suspected placement state, the rotation angle of the earphone posture before and after the knocking is calculated, and if the rotation angle exceeds a first rotation angle threshold, it is determined that the knocking is invalid.
[0098] If the earphone is not in the suspected placement state, the rotation angle of the earphone posture before and after the knocking is calculated, and if the rotation angle exceeds a second rotation angle threshold, it is determined that the knocking is invalid.
[0099] The first rotation angle threshold is preferably 90 degrees, and the second rotation angle threshold is preferably 30 degrees, that is, if the rotation angle of the earphone posture exceeds the rotation angle threshold of 90 degrees (an approximate value), the continuous knocking is ignored. If the earphone posture before the knocking is in the suspected placement state, the rotation angle threshold is reduced to 30 degrees (an approximate value). This part is used for the final series of judgments on the knocking in the continuous knocking after the continuous knocking is ended, and the change factor of the earphone posture is filtered and detected.
[0100] Specifically, the average value of the acceleration of each axis of 90 groups of data before the continuous hitting is obtained, and the average value of the acceleration of each axis of 60 groups of data from 80 ms to 320 ms after the last hitting in the continuous hitting is obtained. The absolute value sum of the change value of the average value of the acceleration of each axis in the two groups of calculated data is calculated.
[0101] If the earphone is not in the suspected placement state, when the absolute value sum of the change value of the average value of the acceleration of each axis in the two groups of calculated data is greater than 6000, the continuous hitting is ignored.
[0102] If the earphone is in the suspected placement state, when the absolute value sum of the change value of the average value of the acceleration of each axis in the two groups of calculated data is greater than 2000, the continuous hitting is ignored.
[0103] For easy understanding, the vibration generated in the wearing / prevention process is easy to be misrecognized as hitting, and the gravity direction has obvious change before and after the hitting, and the three-axis acceleration data are as shown in the figure. Figure 2 In the figure, the gravity direction changes from the y-axis positive square to the x-axis positive direction.
[0104] In step S500, if there is no pre-hitting with a transient hitting force greater than the dynamic hitting threshold in the first detection interval for continuous hitting waiting after the continuous hitting event, the continuous hitting judgment is ended, and the actual continuous hitting number is analyzed based on the number of hits.
[0105] After the hitting is detected, after experiencing various state judgments, the temporary hitting state is still maintained, then the continuous hitting recognition is entered, and after the continuous hitting is ended, the continuous hitting is subjected to various filtering detections, and finally the generation of a double hitting, a triple hitting or more continuous hitting is determined.
[0106] In summary, the earphone hitting detection method in the above embodiment of the application determines the dynamic hitting threshold by calculating the change amount of acceleration based on the three-axis acceleration data, improves the environmental adaptability relative to the setting of the fixed threshold, filters the response force and time of the hitting and the continuous hitting time after the hitting, effectively filters the short-time random vibration such as the misrecognition caused by wearing adjustment or movement, and improves the user experience.
Claims
1. A method of ear click detection, the method comprising: The method comprises the following steps: obtaining three-axis acceleration data of the earphone in the current collection window through an acceleration sensor, and determining a dynamic tapping threshold value based on the three-axis acceleration data and a change amount of acceleration; determining whether the current instantaneous tapping force at the current time is greater than the dynamic tapping threshold value; if the current instantaneous tapping force is greater than the dynamic tapping threshold value, determining a pre-tapping event; if a second pre-tapping with an instantaneous tapping force greater than the dynamic tapping threshold value exists in a first detection interval for a continuous tapping waiting after the pre-tapping event is determined, determining a continuous tapping event and recording a tapping number; if no pre-tapping with an instantaneous tapping force greater than the dynamic tapping threshold value exists in the first detection interval for the continuous tapping waiting after the continuous tapping event, ending the continuous tapping determination and analyzing an actual continuous tapping number based on the tapping number; a calculation expression of the instantaneous tapping force is: ; , , ; wherein p is the instantaneous striking force, is the x-axis acceleration data at the i-th moment, is the y-axis acceleration data at the i-th moment, is the z-axis acceleration data at the i-th moment, is the x-axis change amount of acceleration, is the y-axis change amount of acceleration, is the z-axis change amount of acceleration. a calculation expression of the dynamic tapping threshold value is: ; ; ; In the formula, L is the dynamic tapping threshold value, is the sum of absolute values of three-axis acceleration data, is the mean of the sum of absolute values of acceleration data from the i-8th moment to the ith moment, is the minimum value of the sum of absolute values of three-axis acceleration data in a preset time window, is the minimum value of the sum of absolute values of three-axis acceleration data in a preset time window, The method further comprises: obtaining an average value of a plurality of sets of three-axis acceleration data, and if the average value of the x-axis is 3500-4500 and the average values of the y-axis and the z-axis are both -800-800, regarding the earphone as a suspected placement state for a first preset time; if detection values with an instantaneous tapping force greater than a third preset value exist in a fourth detection interval and the number of the detection values is greater than a fourth preset value, regarding the earphone as a continuous low-intensity vibration state; if the earphone is in a low-intensity vibration state, emptying the continuous tapping number and pausing a response of the three-axis acceleration data for a second preset time; if a sum of absolute values of the three-axis acceleration data is greater than a fifth preset value and the sum of the absolute values of the three-axis acceleration data is less than a sixth preset value in a fifth detection interval, regarding the earphone as a falling state; if the earphone is in a falling state, emptying the continuous tapping number and pausing the response of the three-axis acceleration data for a third preset time; if the sum of the absolute values of the three-axis acceleration data is 0, emptying the tapping number and pausing the response of the three-axis acceleration data for a fourth preset time.
2. The earphone tap detection method of claim 1, wherein, After the step of determining the pre-tapping event, the method further comprises: the first detection interval comprises a front detection interval and a rear detection interval; if a third pre-tapping with an instantaneous tapping force greater than a first preset value exists in the front detection interval after the pre-tapping event is determined, and the instantaneous tapping force of the third pre-tapping is less than a second preset value, ignoring the third pre-tapping.
3. The earphone tap detection method of claim 2, wherein, After the step of determining the pre-tapping event, the method further comprises: recording an interval tapping number with an instantaneous tapping force greater than a tapping threshold value in a second detection interval after a second detection time of the first determination time after the pre-tapping event is determined, the second detection interval being between the first determination time and the first detection interval; if a fourth pre-tapping with an instantaneous tapping force greater than a dynamic tapping threshold value exists in a third detection interval after the first determination time, and the interval tapping number meets a first preset range, ignoring the fourth pre-tapping, the third detection interval being located in a starting part of the front detection interval.
4. The earphone tap detection method of claim 3, wherein, After the step of determining the pre-tapping event, the method further comprises: If the third detection interval after the first determination moment exists a fifth pre-tap with a momentary tapping force greater than a dynamic tapping threshold, and the interval tapping number is greater than a tapping number threshold, the fifth pre-tap is ignored, the current continuous tapping waiting time is corrected to a preset waiting value, and the current interval tapping number is modified to a preset number, and the preset number meets a first preset range.
5. The earphone tap detection method of claim 1, wherein, The method further comprises: If the earphone is in a suspected placement state, a maximum momentary tapping force in a sixth detection interval after each pre-tap event in the continuous tapping event state is obtained as a momentary tapping correction force of each tap; After the continuous tapping judgment is ended, a filtered continuous tapping number with a continuous momentary tapping correction force greater than a preset tapping threshold in the continuous tapping event state is obtained, and the filtered continuous tapping number is taken as an actual continuous tapping number.
6. The earphone tap detection method of claim 4, wherein, The method further comprises: After the continuous tapping judgment is ended, a maximum value of the axis acceleration difference in the sixth detection interval after each pre-tap event in the continuous tapping event state is obtained; An angle between a tapping direction and an expected tapping direction is calculated based on the maximum value, if the angles between the tapping directions corresponding to each pre-tap event in the continuous tapping event state and the expected tapping direction are all greater than a preset angle, and the momentary tapping forces corresponding to each pre-tap event are all less than a seventh preset value, it is determined as invalid tapping.
7. The earphone tap detection method of claim 4, wherein, The method further comprises: After the continuous tapping judgment is ended, if the momentary tapping forces corresponding to each pre-tap event are all less than an eighth preset value, it is determined as invalid tapping.
8. The earphone tap detection method of claim 4, wherein, The method further comprises: After the continuous tapping judgment is ended, it is judged whether the earphone is in a suspected placement state; If the earphone is in a suspected placement state, a rotation angle of the earphone posture before and after tapping is calculated, if the rotation angle exceeds a first rotation angle threshold, it is determined as invalid tapping; If the earphone is not in a suspected placement state, a rotation angle of the earphone posture before and after tapping is calculated, if the rotation angle exceeds a second rotation angle threshold, it is determined as invalid tapping.
Citation Information
Patent Citations
Using tap gestures to control hearing aid functionality
EP4311261A1
