Microphone position detection method, earphone and storage medium
By acquiring the feature vector of the breathing signal in the earphone and combining it with the feature vector from the calibration stage to calculate the microphone position, the problem of active frequency sweeping affecting the user experience is solved, and accurate position calculation without frequency sweeping detection is achieved, thus improving detection reliability.
Patent Information
- Application Number
- CN202511294073.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-11
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2045-09-11
AI Technical Summary
When actively scanning frequencies, the sound is perceived by the user, affecting the headphone's user experience. Existing microphone position detection methods also affect the normal use of the headphones.
By acquiring the breathing signal when the headphones are connected, the target feature vector after noise reduction is extracted. Combined with the feature vectors when the telescopic rod is fully retracted and extended during the calibration phase, the telescopic ratio is calculated to determine the position of the microphone, thus avoiding active frequency sweep detection.
It enables accurate calculation of microphone position without frequency sweep detection, improving detection reliability and ensuring the user experience of the headphones.
Smart Images

Figure CN120769210B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of headphone technology, and in particular to a microphone position detection method, a headphone, and a storage medium. Background Technology
[0002] On gaming headsets, users can adjust the microphone extension lever to customize the microphone position and improve voice quality. The microphone's extension position is often correlated with optimal noise reduction parameters and audio processing algorithms, making the detection of the microphone extension lever's position crucial.
[0003] In related microphone position detection methods, position detection is usually performed by collecting the frequency sweep signal of the speaker from the microphone. However, the sound during active frequency sweeping can be perceived by the user, affecting the normal use of the headphones.
[0004] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main purpose of this application is to provide a microphone position detection method, an earphone, and a storage medium, aiming to solve the technical problem that the sound is perceived by the user during active frequency sweeping, resulting in a reduced user experience for the earphone.
[0006] To achieve the above objectives, this application proposes a microphone position detection method applied to an earphone, the earphone having a telescopic rod and a microphone mounted on the telescopic rod, the microphone position detection method comprising:
[0007] Acquire a breathing signal of a preset duration collected by the microphone when the earphone is in a connected state;
[0008] Extract the target feature vector of the noise-reduced respiratory signal;
[0009] Obtain the first feature vector when the telescopic rod is fully retracted, and the second feature vector when the telescopic rod is fully extended, as determined during the calibration phase.
[0010] The telescopic ratio of the telescopic pole is calculated based on the target feature vector, the first feature vector, and the second feature vector, and the target position of the microphone is determined based on the telescopic ratio.
[0011] In one embodiment, the step of extracting the target feature vector of the denoised respiratory signal includes:
[0012] Extract the effective frequency band of the noise-reduced respiratory signal and divide the effective frequency band into multiple frequency bands;
[0013] Calculate the energy of multiple frequency bands corresponding to multiple frequency bands;
[0014] Calculate the spectral centroid corresponding to the effective frequency band;
[0015] The target feature vector is constructed based on the energy of the multiple frequency bands and the centroid of the spectrum, wherein the energy of the multiple frequency bands and the centroid of the spectrum are sub-elements of the target feature vector.
[0016] In one embodiment, the step of calculating the energy of multiple frequency bands corresponding to multiple frequency bands includes:
[0017] The accumulated value of the current frequency band is obtained by summing the squares of the moduli of each frequency within the current frequency band.
[0018] Based on a preset logarithmic formula, the logarithm of the accumulated value of the current frequency band is calculated to obtain the frequency band energy of the current frequency band;
[0019] Obtain the energy of the multiple frequency bands after the calculation is completed.
[0020] In one embodiment, the step of calculating the spectral centroid corresponding to the effective frequency band includes:
[0021] Calculate the sum of energy at all frequency points within the effective frequency band, the energy corresponding to each frequency point, and the product between the frequency point and the energy;
[0022] The weighted energy is obtained by summing the products, and the quotient between the weighted energy and the sum of the energies is calculated to obtain the spectral centroid corresponding to the effective frequency band.
[0023] In one embodiment, the step of calculating the extension ratio of the telescopic pole based on the target feature vector, the first feature vector, and the second feature vector, and determining the target position of the microphone based on the extension ratio, includes:
[0024] Determine the first Euclidean distance between the target feature vector and the first feature vector;
[0025] Determine the second Euclidean distance between the second feature vector and the first feature vector;
[0026] The scaling ratio is determined based on the quotient of the first Euclidean distance and the second Euclidean distance, and the target position is determined based on the scaling ratio.
[0027] In one embodiment, the step of calculating the extension ratio of the telescopic rod based on the target feature vector, the first feature vector, and the second feature vector, and determining the target position of the microphone based on the extension ratio, further includes:
[0028] Determine the third Euclidean distance between the target feature vector and the second feature vector;
[0029] The scaling ratio is determined based on the quotient of the third Euclidean distance and the second Euclidean distance, and the target position is determined based on the scaling ratio.
[0030] In one embodiment, before the step of acquiring a breathing signal of a preset duration collected by the microphone when the earphone is in a connected state, the microphone position detection method further includes:
[0031] When the headphones are in the first calibration stage, the microphone collects a first calibration signal of the preset duration, and the telescopic rod is in a fully retracted state during the first calibration stage.
[0032] Extract the first calibration frequency band of the first calibration signal after noise reduction, and extract the frequency band energy and spectral centroid based on the first calibration frequency band to obtain the first feature vector;
[0033] When the headphones are in the second calibration stage, the microphone collects a second calibration signal of the preset duration, and the telescopic rod is in the fully extended state during the second calibration stage;
[0034] Extract the second calibration frequency band of the noise-reduced second calibration signal, and extract the frequency band energy and spectral centroid based on the second calibration frequency band to obtain the second feature vector.
[0035] In one embodiment, the earphone is provided with a rigid rotating rod and a microphone disposed on the rigid rotating rod. After the step of extracting the target feature vector of the noise-reduced breathing signal, the microphone position detection method further includes:
[0036] Obtain the rotation feature vectors of the rigid rotating rod at the maximum and minimum rotation angles during the calibration phase;
[0037] The target rotation position of the rigid rotating rod is calculated based on the target feature vector and the rotation feature vector, and the target position is determined based on the target rotation position.
[0038] In addition, to achieve the above objectives, this application also proposes an earphone, the earphone comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the microphone position detection method as described above.
[0039] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the microphone position detection method described above.
[0040] One or more technical solutions proposed in this application have at least the following technical effects:
[0041] After the headphones are connected to the device, the breathing signal currently captured by the microphone is acquired. Then, the target feature vector of the noise-reduced breathing signal is extracted. This vector is combined with the first feature vector determined during the calibration phase when the telescopic rod is fully retracted, and the second feature vector when the telescopic rod is fully extended, to calculate the extension ratio of the telescopic rod at the time of the current breathing signal acquisition. Finally, the target position of the microphone is calculated based on this extension ratio. In this way, by fitting the feature vector of real-time breathing and the feature vectors of the telescopic rod in its fully extended and fully retracted states during the calibration phase, the current extension ratio of the telescopic rod is obtained. The microphone position is then calculated in real-time using this extension ratio. This achieves microphone position detection without frequency sweep detection, improving detection reliability while ensuring a good user experience for the headphones. Attached Figure Description
[0042] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0043] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1 A schematic diagram showing the use of a rigid telescopic rod or a rigid rotating rod for the earphones in this application;
[0045] Figure 2 This is a flowchart illustrating the first embodiment of the microphone position detection method of this application.
[0046] Figure 3 This is a flowchart illustrating the second embodiment of the microphone position detection method of this application.
[0047] Figure 4 A simplified flowchart illustrating the microphone position detection method provided in the third embodiment of this application;
[0048] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the microphone position detection method in this application embodiment.
[0049] Explanation of icon numbers:
[0050] 1. Rigid telescopic rod;
[0051] 2. Rigid rotating rod;
[0052] 3. Knob.
[0053] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0054] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0055] The main solution of this application embodiment is: to obtain a breathing signal of a preset duration collected by the microphone when the earphone is in a connected state;
[0056] Extract the target feature vector of the noise-reduced respiratory signal;
[0057] Obtain the first feature vector when the telescopic rod is fully retracted, and the second feature vector when the telescopic rod is fully extended, as determined during the calibration phase.
[0058] The telescopic ratio of the telescopic pole is calculated based on the target feature vector, the first feature vector, and the second feature vector, and the target position of the microphone is determined based on the telescopic ratio.
[0059] In this embodiment, for ease of description, the following description uses headphones as the execution subject.
[0060] On gaming headsets, users can adjust the microphone extension lever to customize the microphone position and improve voice quality. The microphone's extension position is often correlated with optimal noise reduction parameters and audio processing algorithms, making the detection of the microphone extension lever's position crucial.
[0061] In related microphone position detection methods, position detection is usually performed by collecting the frequency sweep signal of the speaker from the microphone. However, the sound during active frequency sweeping can be perceived by the user, affecting the normal use of the headphones.
[0062] This application provides a solution that obtains the current extension ratio of the telescopic rod by fitting the feature vector during real-time breathing and the feature vectors of the telescopic rod being fully extended and fully retracted during the calibration phase. The microphone position is then calculated in real time based on the extension ratio, thus achieving microphone position detection without frequency sweep detection. This improves detection reliability while ensuring the user experience of the headphones.
[0063] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0064] This application provides a microphone position detection method applied to headphones. The headphones have a telescopic rod and a microphone mounted on the telescopic rod. When the telescopic rod extends or retracts, the position of the microphone relative to the headphones changes accordingly. The telescopic rod is a rigid telescopic rod, such as... Figure 1 As shown in Figure A, telescopic rod 1 allows the microphone to move within its linear telescopic range, thereby adjusting the microphone's position. The telescopic range of rod 1 is fixed, while the microphone moves within a specific area.
[0065] Based on this, refer to Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the microphone position detection method of this application.
[0066] In this embodiment, the microphone position detection method includes steps S10~S30:
[0067] Step S10: Obtain the breathing signal of a preset duration collected by the microphone when the earphone is in a connected state.
[0068] Connection status refers to the headset connecting to the client via wired or wireless connection, and this being a non-first-time connection, or the headset being detected as being worn by the user, such as by using simple sensors to identify the distance between the headset and the user's ear to determine if the headset is being worn. In gaming headsets, position detection is typically achieved through sensors; however, sensor detection not only increases hardware costs but also adds complexity to the headset structure, resulting in lower reliability and accuracy. Even if the microphone position can be calculated by collecting the frequency sweep signal from the speaker, the active frequency sweep tone can be perceived by the user, affecting normal use.
[0069] Therefore, in this embodiment, when it is detected that the user is wearing headphones (i.e., the headphones are connected to the client), the microphone on the telescopic pole is activated to collect the user's breathing sounds in real time. The collection duration is a preset duration, such as 10 seconds, 20 seconds, etc. The preset duration can be set according to the actual situation. The preset duration is usually the same as the duration of the calibration breathing signal collected during the calibration phase.
[0070] Step S20: Extract the target feature vector of the noise-reduced respiratory signal.
[0071] When the telescopic pole is in different extension ratios, the distance between the microphone and the sound source, such as the user's mouth, varies, and the breathing signals collected from different sound source acquisition positions differ. Therefore, in this embodiment, after the breathing signal undergoes noise reduction processing, the feature vector of the noise-reduced signal is calculated. This is used to analyze the distance or positional relationship between the microphone and the sound source by analyzing the feature vectors of the telescopic pole in different extension states, thereby determining the target position of the microphone.
[0072] Specifically, the target feature vector includes the frequency band energy of the denoised signal band and the spectral centroid of that band. The current frequency band energy and the spectral centroid of that band can be calculated using a preset frequency band energy calculation formula. Furthermore, when the position of the telescopic rod changes, the signal attenuation / enhancement patterns differ across different frequency bands within a signal segment. Therefore, to reflect the characteristics corresponding to different frequency bands, the current frequency band can be divided into multiple bands, and the frequency band energy corresponding to each band can be calculated. This captures this frequency-dependent change pattern and improves the accuracy of subsequent position calculations.
[0073] Furthermore, when denoising respiratory signals, the ambient noise spectrum one second prior to signal acquisition can be used as a noise template:
[0074] Where N(f) is the frequency domain representation of environmental noise, FFT is the Fast Fourier Transform, and noise_signal is the time domain noise signal.
[0075] The collected respiratory signals were then analyzed. Perform spectral subtraction calculation:
[0076] ,
[0077] in, The frequency domain representation of the calibration signal includes the target signal and ambient noise. for The modulus represents the magnitude of the calibration signal at frequency f. The modulus of the noise amplitude spectrum. This is the amplitude spectrum of the calibration signal after spectral subtraction.
[0078] Optionally, after noise reduction processing of the respiratory signal, bandpass filtering can be used to preserve specific frequency bands, such as the effective frequency band of respiratory sounds in the range of 100–1000 Hz.
[0079] ,
[0080] Signals in this frequency band contain the core characteristics of breathing, thus effectively filtering out noise interference.
[0081] Step S30: Obtain the first feature vector when the telescopic rod is fully retracted and the second feature vector when the telescopic rod is fully extended, as determined during the calibration phase.
[0082] In this embodiment, when a user uses the headphones for the first time, the user's breathing sound needs to be calibrated. During the calibration phase, voice prompts can be played via a mobile application or the headphones to guide the user to breathe normally while remaining still. The calibration phase consists of two stages. The first stage prompts the user to fully extend the telescopic rod, and then the microphone captures breathing sounds for a preset duration, such as 10 seconds. The second stage prompts the user to fully retract the telescopic rod, and then the microphone captures breathing sounds for another preset duration, such as 10 seconds. The frequency band energy and spectral centroid of the breathing signals captured in the two different stages are then calculated to obtain the feature vector for each stage. The signals captured during the calibration phase also require noise reduction processing.
[0083] By acquiring the first and second feature vectors determined during the calibration phase, the actual spatial distance can be determined based on the spatial distance between the feature vectors, thereby quantifying the difference between the target feature vector and the calibration feature vector, and calculating the actual extension ratio of the telescopic pole.
[0084] Step S40: Calculate the extension ratio of the telescopic rod based on the target feature vector, the first feature vector, and the second feature vector, and determine the target position of the microphone based on the extension ratio.
[0085] It should be noted that the extension ratio refers to the proportion of the telescopic rod that has been extended relative to the entire extension process, or the proportion that remains unextended.
[0086] In eigenvector analysis, each feature, such as frequency band energy and spectral centroid, is considered a dimension of the feature space. When the position of the telescopic pole changes, the frequency domain attenuation law of the signal changes, causing the various features to change together. By mapping these features to coordinates in the feature space, using Euclidean distance to quantify the differences in the feature vectors, and combining this with the two endpoints from the calibration phase, the physical position ratio of the telescopic pole can be derived.
[0087] The extension ratio of the telescopic pole is linearly related to the change of the feature vector F. The first feature vector F1 and the second feature vector F2 can be regarded as the two endpoints of a straight line. That is, the extension ratio from fully retracted to fully extended corresponds to 0 to 1. The target feature vector F' will fall on this straight line or approximately fall on the straight line due to noise. Its position can be calculated by distance ratio.
[0088] Therefore, as an optional implementation, the first Euclidean distance between the target feature vector F' and the first feature vector F1 can be calculated. Simultaneously calculate the second Euclidean distance between the second eigenvector F2 and the first eigenvector F1. Then, based on the first Euclidean distance Second Euclidean distance The quotient is used to determine the scaling ratio P, and finally, the target position is determined based on the scaling ratio. The scaling ratio calculation formula is as follows:
[0089]
[0090] in, Here, n represents the vector dimension, and the second Euclidean distance is calculated similarly. Therefore, when the eigenvector contains frequency band energy E and spectral centroid C, the square root of the sum can be taken to obtain the Euclidean distance. For example, when the eigenvector contains energy from the low, mid, and high frequency bands, as well as the spectral centroid, the formula for calculating the first Euclidean distance is as follows:
[0091] Where E1 represents low-frequency energy, E2 represents mid-frequency energy, and E3 represents high-frequency energy.
[0092] It is understandable that the extension ratio of the telescopic pole is linearly related to the change of the feature vector F. The first feature vector F1 and the second feature vector F2 can be considered as the two endpoints of a straight line; that is, the extension ratio from fully retracted to fully extended corresponds to 0 to 1. The target feature vector F' will fall on this line, or approximately on it due to noise. Its position can be calculated using the distance ratio. The first Euclidean distance represents the proportion of the current extension position of the telescopic pole from its fully retracted position to the total extension distance. Therefore, the extension ratio P calculated based on the quotient of the first and second Euclidean distances can be understood as the proportion of the telescopic pole that has been extended.
[0093] In another optional implementation, a third Euclidean distance between the target feature vector and the second feature vector can also be determined. Then, based on the quotient of the third and second Euclidean distances, the extension ratio is determined, and the target position is determined based on the extension ratio. Here, the third Euclidean distance represents the proportion of the current extension position of the telescopic rod from its fully extended position to the total extension distance. Therefore, the extension ratio P calculated based on the quotient of the third and second Euclidean distances can be understood as the proportion of the telescopic rod not fully extended. The extended and non-extended proportions of the telescopic rod are complementary. It should be noted that both the extended and non-extended proportions describe different directions of the telescopic rod's extension length.
[0094] After determining the extension ratio, since the extension position of the headphone's extension rod is fixed, the target position can be determined directly through the mapping relationship between the extension ratio and the target position. For example, if the extension ratio is 50%, the corresponding microphone position is (x1, y1, z1).
[0095] This embodiment provides a microphone position detection method. By acquiring the breathing signal when the earphone is connected, a target feature vector is calculated based on the noise-reduced breathing signal. Simultaneously, the calibration feature vector from the calibration stage is acquired. Finally, by calculating the Euclidean distance between the target feature vector and the calibration feature vector, as well as the Euclidean distance between the calibration feature vectors, the extension ratio in the extension or retraction direction is obtained. The microphone position is then determined based on the extension ratio. In this way, the microphone position can be detected using the user's normal breathing signal, without the need for active frequency scanning or additional sensor modules. This improves the reliability of microphone position calculation while avoiding any reduction in the user's auditory experience due to microphone position detection.
[0096] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 3 Step S20 includes steps S21 to S24:
[0097] Step S21: Extract the effective frequency band of the noise-reduced respiratory signal and divide the effective frequency band into multiple frequency bands.
[0098] In this embodiment, to reflect the characteristics corresponding to different frequency bands, the current frequency band can be divided into multiple frequency bands. The effective frequency band typically refers to the 100Hz–1000Hz band, while the multiple frequency bands are usually three bands: a low-frequency band (100–300Hz), a mid-frequency band (300–600Hz), and a high-frequency band (600–1000Hz). By dividing the effective frequency band into multiple bands, more fine-grained and physically meaningful feature dimensions can be provided for subsequent Euclidean distance calculations based on the frequency energy corresponding to each band. This accurately captures the energy distribution in the frequency domain, thereby improving the accuracy of Euclidean distance-based calculations.
[0099] In addition, the effective frequency band range can be selected based on actual needs, and multiple different frequency bands can be further divided.
[0100] Step S22: Calculate the energy of multiple frequency bands corresponding to the multiple frequency bands.
[0101] In this embodiment, the formula for calculating frequency band energy is as follows:
[0102] ,
[0103] in, For the energy of a certain frequency band, For the range of frequency bands, such as the energy of the low-frequency band, Corresponding to 100Hz and 300Hz. These are the effective frequency bands after noise reduction. Based on the above formula, the frequencies of each band are calculated to obtain the energy values of the three frequency bands: , , Therefore, for any one of multiple frequency bands, the squares of the moduli of each frequency within the current frequency band can be summed to obtain the accumulated value of the current frequency band. Then, based on a preset logarithmic formula, the logarithm of the accumulated value of the current frequency band is calculated, thereby obtaining the frequency band energy of the current frequency band. Finally, the fully calculated energies of multiple frequency bands are obtained.
[0104] It should be noted that in the above calculation formula, decibels (dB) are one-tenth of bels, and the definition of a bel is based on the logarithm of the power ratio to base 10. Since the calculation result for frequency band energy is in decibels, the logarithmic value with a parameter of 10 is used for the calculation.
[0105] Step S23: Calculate the spectral centroid corresponding to the effective frequency band.
[0106] In this embodiment, the formula for calculating the spectral centroid C is as follows:
[0107] ,
[0108] That is, first calculate the energy of all frequency points within the effective frequency band. The energy corresponding to each frequency point and the product between frequency point and energy The weighted energy is then obtained by summing the products. Finally, the quotient between the weighted energy and the sum of energies is calculated to obtain the centroid of the spectrum.
[0109] Step S24: Construct the target feature vector based on the energy of the multiple frequency bands and the spectral centroid.
[0110] In this embodiment, the energy of multiple frequency bands and the centroid of the spectrum are sub-elements of the target feature vector, that is, the obtained feature vector is... .
[0111] This embodiment divides the current frequency band into multiple frequency bands and calculates the frequency energy corresponding to each of the multiple frequency bands, thereby reflecting the characteristics of the breathing signal in different frequency bands, improving the accuracy of the Euclidean distance calculated based on the target feature vector, and thus improving the accuracy of the microphone position calculation.
[0112] Based on the first or second embodiment of this application, in the third embodiment of this application, during the calibration stage, the process of obtaining the first feature vector and the second feature vector is the same as the process of obtaining the target feature vector. Both require collecting a respiratory signal for a preset duration, denoising the respiratory signal, and then calculating the frequency band energy and spectral centroid of the signal.
[0113] Specifically, in this embodiment, it is necessary to acquire a first calibration signal of a preset duration collected by the microphone when the headphones are in the first calibration stage, during which the telescopic rod is in a fully retracted state. Next, the first calibration frequency band of the noise-reduced first calibration signal is extracted, and the frequency band energy and spectral centroid are extracted based on the first calibration frequency band, thereby constructing a first feature vector based on the frequency band energy and spectral centroid. The calibration stage can also be divided into multiple frequency bands and the frequency band energy of different frequency bands can be extracted.
[0114] At the same time, the second calibration signal of a preset duration collected by the microphone can also be obtained when the headphones are in the second calibration stage. During the second calibration stage, the telescopic rod is in a fully extended state. Then, the second calibration frequency band of the noise-reduced second calibration signal is extracted, and the spectral energy and spectral centroid are extracted based on the second calibration frequency band to obtain the second feature vector.
[0115] For example, to help understand the implementation flow of the microphone position detection method obtained by combining the above embodiments, please refer to... Figure 4 , Figure 4 A simplified flowchart of a microphone position detection method is provided. Specifically, calibration is performed during initial use. Breathing sounds can be collected when the telescopic pole is fully retracted and fully extended. The breathing signals are then processed (i.e., noise reduction), followed by feature extraction to obtain and store the calibrated first and second feature vectors.
[0116] During the wear detection process, the earphone detects whether it is being worn. When the user is wearing the earphone, the current breathing sound is collected and noise reduction is performed on the breathing sound. Then, feature extraction is performed to obtain the target feature vector. Finally, the frequency band energy and spectral centroid in the feature vector are fitted by linear fitting to obtain the extension ratio of the telescopic rod. Based on the extension ratio, the actual position of the microphone is determined.
[0117] Based on the first embodiment of this application, in the fourth embodiment of this application, as follows: Figure 1 As shown in Figure B, the earphone is equipped with a rigid rotating rod 2. The user can adjust the position of the rigid rotating rod 2 using the knob 3, thereby adjusting the position of the microphone. The rigid rotating rod is set with a maximum rotation angle. For example, with the direction of gravity as the reference, the rotation direction is 0-180°, meaning that the rigid rotating rod can only rotate to one side of the face and cannot rotate to the back of the head.
[0118] Based on this, after obtaining the target feature vector of the respiratory signal, step S20 is followed by steps S40 to S50:
[0119] Step S40: Obtain the rotation feature vectors of the rigid rotating rod at the maximum and minimum rotation angles during the calibration phase.
[0120] In this embodiment, corresponding to the two feature vectors of the telescopic rod in its fully retracted and fully extended states, when the earphone is equipped with a rigid rotating rod, it is necessary to obtain the rotational feature vectors of the rigid rotating rod in these two extreme states during the calibration phase, thereby determining the characteristics of the breathing signals collected at the two positions. The method for obtaining the rotational feature vectors is the same as the method for obtaining the first and second feature vectors, and will not be elaborated upon here.
[0121] Step S50: Calculate the target rotation position of the rigid rotating rod based on the target feature vector and the rotation feature vector, and determine the target position based on the target rotation position.
[0122] After obtaining the rotation feature vector, the ratio of the current position of the rigid rotating rod to the rotation distance is calculated using the same method, and the target position is determined based on this ratio. Therefore, the position of the rotating rod, i.e., the position of the microphone, can be detected using normal breathing audio signals, reducing system complexity without affecting the user's actual headphone experience.
[0123] This application provides an earphone, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to perform the microphone position detection method in the first embodiment described above.
[0124] The following is for reference. Figure 5 The diagram shows a structural schematic of an earphone suitable for implementing embodiments of this application. Figure 5 The headphones shown are merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of this application.
[0125] like Figure 5As shown, the headphones may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for headphone operation. The processing device 1001, the ROM 1002, and the RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the input / output interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. The communication device 1009 allows the headset to communicate wirelessly or wiredly with other devices to exchange data. Although headsets with various systems are shown in the figures, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.
[0126] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0127] The headphones provided in this application employ the microphone position detection method described in the above embodiments, which solves the technical problem that sound is perceived by the user during active frequency sweeping, resulting in a reduced user experience. Compared with the prior art, the beneficial effects of the headphones provided in this application are the same as those of the microphone position detection method provided in the above embodiments, and other technical features of the headphones are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0128] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0129] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0130] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the microphone position detection method in the above embodiments.
[0131] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory (EPROM, or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, radio frequency (RF), etc., or any suitable combination thereof.
[0132] The aforementioned computer-readable storage medium may be included in the headphones; or it may exist independently and not assembled into the headphones.
[0133] The aforementioned computer-readable storage medium carries one or more programs that, when executed by the headphones, cause the headphones to:
[0134] Acquire a breathing signal of a preset duration collected by the microphone when the earphone is in a connected state;
[0135] Extract the target feature vector of the noise-reduced respiratory signal;
[0136] Obtain the first feature vector when the telescopic rod is fully retracted, and the second feature vector when the telescopic rod is fully extended, as determined during the calibration phase.
[0137] The telescopic ratio of the telescopic pole is calculated based on the target feature vector, the first feature vector, and the second feature vector, and the target position of the microphone is determined based on the telescopic ratio.
[0138] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0139] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0140] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0141] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the microphone position detection method described above. This solves the technical problem that sound is perceived by the user during active frequency sweeping, leading to a reduced user experience for the headphones. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the microphone position detection method provided in the above embodiments, and will not be repeated here.
[0142] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A method for detecting the position of a microphone, characterized in that, Applied to headphones, the headphones are provided with a telescopic rod and a microphone disposed on the telescopic rod, the microphone position detection method includes: Acquire a breathing signal of a preset duration collected by the microphone when the earphone is in a connected state; Extract the target feature vector of the noise-reduced respiratory signal; Obtain the first feature vector when the telescopic rod is fully retracted, and the second feature vector when the telescopic rod is fully extended, as determined during the calibration phase. Based on the target feature vector, the first feature vector, and the second feature vector, the telescopic ratio of the telescopic pole is calculated, and the target position of the microphone is determined based on the telescopic ratio, including determining the first Euclidean distance between the target feature vector and the first feature vector; Determine the second Euclidean distance between the second feature vector and the first feature vector; The scaling ratio is determined based on the quotient of the first Euclidean distance and the second Euclidean distance, and the target position is determined based on the scaling ratio.
2. The microphone position detection method as described in claim 1, characterized in that, The step of extracting the target feature vector of the noise-reduced respiratory signal includes: Extract the effective frequency band of the noise-reduced respiratory signal and divide the effective frequency band into multiple frequency bands; Calculate the energy of multiple frequency bands corresponding to multiple frequency bands; Calculate the spectral centroid corresponding to the effective frequency band; The target feature vector is constructed based on the energy of the multiple frequency bands and the centroid of the spectrum, wherein the energy of the multiple frequency bands and the centroid of the spectrum are sub-elements of the target feature vector.
3. The microphone position detection method as described in claim 2, characterized in that, The step of calculating the energy of multiple frequency bands corresponding to multiple frequency bands includes: The accumulated value of the current frequency band is obtained by summing the squares of the moduli of each frequency within the current frequency band. Based on a preset logarithmic formula, the logarithm of the accumulated value of the current frequency band is calculated to obtain the frequency band energy of the current frequency band; Obtain the energy of the multiple frequency bands after the calculation is completed.
4. The microphone position detection method as described in claim 2, characterized in that, The step of calculating the spectral centroid corresponding to the effective frequency band includes: Calculate the sum of energy at all frequency points within the effective frequency band, the energy corresponding to each frequency point, and the product between the frequency point and the energy; The weighted energy is obtained by summing the products, and the quotient between the weighted energy and the sum of the energies is calculated to obtain the spectral centroid corresponding to the effective frequency band.
5. The microphone position detection method as described in claim 1, characterized in that, The step of calculating the extension ratio of the telescopic pole based on the target feature vector, the first feature vector, and the second feature vector, and determining the target position of the microphone based on the extension ratio, further includes: Determine the third Euclidean distance between the target feature vector and the second feature vector; The scaling ratio is determined based on the quotient of the third Euclidean distance and the second Euclidean distance, and the target position is determined based on the scaling ratio.
6. The microphone position detection method as described in claim 1, characterized in that, Before the step of acquiring the breathing signal of a preset duration collected by the microphone when the earphone is in a connected state, the microphone position detection method further includes: When the headphones are in the first calibration stage, the microphone collects a first calibration signal of the preset duration, and the telescopic rod is in a fully retracted state during the first calibration stage. Extract the first calibration frequency band of the first calibration signal after noise reduction, and extract the frequency band energy and spectral centroid based on the first calibration frequency band to obtain the first feature vector; When the headphones are in the second calibration stage, the microphone collects a second calibration signal of the preset duration, and the telescopic rod is in the fully extended state during the second calibration stage; The second calibration frequency band of the noise-reduced second calibration signal is extracted, and the frequency band energy and spectral centroid are extracted based on the second calibration frequency band to obtain the second feature vector.
7. The microphone position detection method as described in claim 1, characterized in that, The earphone is provided with a rigid rotating rod and a microphone disposed on the rigid rotating rod. After the step of extracting the target feature vector of the noise-reduced breathing signal, the microphone position detection method further includes: Obtain the rotation feature vectors of the rigid rotating rod at the maximum and minimum rotation angles during the calibration phase; The target rotation position of the rigid rotating rod is calculated based on the target feature vector and the rotation feature vector, and the target position is determined based on the target rotation position.
8. An earphone, characterized in that, The earphone includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the microphone position detection method as claimed in any one of claims 1 to 7.
9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the microphone position detection method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Headset having microphone
CN104254029A
Headset
CN109361975A