A method for determining head-related function HRTF, electronic device and storage medium

By acquiring and processing the HRIR data of the target user in the audio system and determining its HRTF, the problem of the HRTF database in the prior art does not match the size of the user's head, and a better spatial audio rendering effect and user experience are achieved.

CN114710739BActive Publication Date: 2025-05-09BEIJING HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210242779.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-11
Publication Date
2025-05-09
Estimated Expiration
2042-03-11

AI Technical Summary

Technical Problem

Due to the artificial head model or the geometric size of a small number of subjects, the existing HRTF database cannot obtain the "sound immersive" listening experience when rendering spatial audio.

Method used

By using electronic devices in the audio system to communicate with the audio acquisition device, the head-related impulse response HRIR data of the target user is obtained, and a time domain conversion process is performed to determine the HRTF of the target user.

Benefits of technology

The HRTF is determined based on the target user's head geometry, thereby improving the effect of spatial audio rendering, and users can obtain a better immersive auditory experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114710739B_ABST
    Figure CN114710739B_ABST
Patent Text Reader

Abstract

The present application provides a method for determining a head-related function HRTF, an electronic device and a storage medium, which relate to the field of three-dimensional audio technology and can improve the effect of spatial audio rendering of audio by an electronic device through HRTF; the method can enable the electronic device to determine the HRTF of a target user based on the geometric size of the target user's head; and perform audio rendering on an audio signal to be rendered according to the determined HRTF of the target user to generate a target rendering signal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of three-dimensional audio technology, and in particular to a method for determining a head related transfer function (HRTF), an electronic device, and a storage medium. Background Art

[0002] With the rapid development of high-performance computers and signal processing technology, people have put forward higher and higher requirements for voice and audio experience, and immersive audio can meet people's needs in this regard. For example, when an electronic device establishes a communication connection with a headset, the electronic device can play audio through the headset. In related technologies, the electronic device can perform spatial audio rendering on the audio to give the user an immersive auditory experience.

[0003] At present, HRTF is mainly used for spatial audio rendering. Among them, most HRTF databases are based on artificial head models (KEMAR) or based on measurements of a small number of subjects. However, due to the difference between the geometric dimensions of the artificial head models or a small number of subjects and the users, when the HRTF database measured in this way is applied to spatial audio rendering, users cannot get the "immersive" listening experience. Summary of the invention

[0004] The embodiments of the present application provide a method for determining a head related function HRTF, an electronic device, and a storage medium, which can improve the effect of spatial audio rendering of audio by the electronic device through HRTF.

[0005] The embodiments of the present application adopt the following technical solutions:

[0006] In a first aspect, a method for determining a head-related function (HRTF) is provided, the method being applied to an electronic device in an audio system, the audio system comprising an electronic device and an audio acquisition device, the audio acquisition device being worn on the ear of a target user; the electronic device being communicatively connected to the audio acquisition device; the method comprising: the electronic device acquiring M first angles, and N head-related impulse response (HRIR) data corresponding to the first angles; the first angle being used to indicate an angle between a first connecting line and a horizontal plane, the first connecting line being a connecting line between the electronic device and a center position of a head of the target user; the HRIR data comprising a second angle and a target distance; the second angle being used to indicate an angle between a second connecting line and a horizontal plane, the second connecting line being a connecting line between the electronic device and a first ear of the target user, the target distance being used to indicate a distance between the electronic device and the center position of the head; M and N being positive integers; the electronic device performing time domain conversion processing on the HRIR data to obtain the HRTF of the target user; the electronic device performing audio rendering on an audio signal to be rendered according to the HRTF corresponding to the target user to generate a target rendering signal; the target rendering signal is a rendering signal output to the ear of the target user.

[0007] Based on the first aspect, since the HRTF of the target user is determined according to the geometric dimensions of the target user's head, when the electronic device performs audio rendering on the audio signal to be rendered according to the HRTF corresponding to the target user, the user can obtain a better spatial audio rendering effect, thereby improving the user experience.

[0008] In a possible design of the first aspect, the electronic device obtains M first angles and N head-related impulse response HRIR data corresponding to the first angles, including: after the electronic device obtains each first angle, it determines the N HRIR data corresponding to the first angle until M first angles and the HRIR data corresponding to the M first angles are obtained.

[0009] In a possible design of the first aspect, the relative heights of the electronic device and the target user are different for different first angles; the electronic device obtains M first angles, including: the electronic device obtains a first parameter corresponding to the target user, and a second parameter; the first parameter is used to indicate the distance between the electronic device and the center position of the head; the second parameter is used to indicate a preset distance between the electronic device and the center position of the head on the same horizontal plane, and the second parameter is greater than or equal to a first preset value; the electronic device obtains a first angle according to the first parameter and the second parameter corresponding to the first relative height; after the electronic device moves in the vertical direction, the relative height of the electronic device and the target user changes; the electronic device obtains another first angle according to the first parameter and the second parameter corresponding to the changed relative height, until M first angles are obtained.

[0010] In a possible design of the first aspect, the first angle, the first parameter and the second parameter satisfy the following expression: φ=arccos(R0 / R); wherein φ is the first angle, R is the first parameter, and R0 is the second parameter.

[0011] In a possible design of the first aspect, the audio acquisition device is an earphone, and the earphone includes a left earplug and a right earplug; the electronic device obtains N HRIR data corresponding to a first angle, including: when the first angle remains unchanged, while the earphone rotates along a first direction on a horizontal plane, the electronic device obtains N third parameters and N target distances at N different positions; the third parameter is used to indicate the distance difference between the left earplug and the right earplug and the electronic device; the electronic device obtains a fourth parameter; the fourth parameter is used to indicate the head circumference diameter of the target user; the electronic device obtains N second angles based on the N third parameters and the fourth parameter; different second angles correspond to the third parameter at one position; the electronic device obtains N HRIR data based on the N second angles and the N target distances; one HRIR data corresponds to one second angle and one target distance.

[0012] In a possible design of the first aspect, the method further includes: the electronic device prompts the target user to rotate along a first direction on a horizontal plane through first prompt information.

[0013] In this design, the electronic device can prompt the target user to rotate along the first direction on the horizontal plane through the first prompt information, thereby preventing the user from rotating blindly and improving the user experience.

[0014] In a possible design of the first aspect, the second angle, the third parameter and the fourth parameter satisfy the following expression: θ=arccos(Δd / D); wherein θ is the second angle; Δd ​​is the third parameter, and D is the fourth parameter.

[0015] In a possible design of the first aspect, the method also includes: the electronic device uses the target distance corresponding to the starting position as a reference distance; the starting position is the position when the headset starts to rotate along a first direction on a horizontal plane; for each HRIR data, when the difference between the target distance and the reference distance is less than or equal to a second preset value, the electronic device adjusts the target distance in the HRIR data to the reference distance; when the difference between the target distance and the reference distance is greater than a third preset value, the electronic device deletes the HRIR data.

[0016] In this design, since the target user cannot ensure that the distance between the electronic device and the center of the head remains consistent during the rotation process, the distance between the electronic device and the center of the head may fluctuate within a certain range. Based on this, the electronic device can use the target distance corresponding to the starting position as a reference distance to correct the target distance, thereby obtaining more accurate HRIR data. In this way, the HRTF converted from the HRIR data will also be more accurate, improving the accuracy of determining the HRTF.

[0017] In a possible design of the first aspect, the electronic device stores K preset angles; K is a positive integer; the method also includes: when the K preset angles do not match the M first angles, the electronic device reacquires the first angle until the K preset angles match the M first angles.

[0018] In this design, the K preset angles are relatively comprehensive and accurate preset angles (i.e., pitch angles) that are pre-set. Therefore, after the electronic device obtains the M first angles, it can also match the M first angles with the K preset angles. If the K preset angles do not match the M first angles, the electronic device re-acquires the first angle until the K preset angles match the M first angles, thereby enabling the M first angles obtained by the electronic device to be more accurate, which is beneficial to improving the accuracy of the subsequently determined HRTF.

[0019] In a possible design of the first aspect, the method also includes: the electronic device prompts the target user with a preset angle and a current first angle through a second prompt information; the second prompt information is used to enable the target user to adjust the relative height of the electronic device and the target user according to the prompted preset angle and the current first angle.

[0020] In this design method, the electronic device can prompt the target user of the preset angle and the current first angle through the second prompt information. Then, the target user can adjust the relative height of the electronic device and the target user based on the current first angle and the preset angle, so that the first angle measured by the electronic device is closer to the preset angle, avoiding the user from blindly measuring the first angle; thereby making the first angle more matching with the preset angle.

[0021] In a possible design of the first aspect, the method also includes: the electronic device interpolates M first angles to obtain interpolated first angles, and obtains N HRIR data corresponding to the interpolated first angles; the difference between the interpolated first angles and the first angles is less than or equal to a first threshold; the electronic device interpolates N HRIR data to obtain interpolated HRIR data; the difference between a second angle in the interpolated HRIR data and a second angle in the HRIR data is less than or equal to a second threshold; the electronic device performs time domain conversion processing on the HRIR data to obtain the HRTF of the target user, including: the electronic device performs time domain conversion processing on the interpolated HRIR data to obtain the HRTF of the target user; wherein the interpolation processing includes one of linear interpolation, bilinear interpolation or centroid interpolation.

[0022] In this design method, since the first angle and HRIR data measured by the electronic device are small and cannot be directly applied to spatial audio rendering, the electronic device can interpolate M first angles and interpolate N HRIR data to obtain more first angles and HRIR data, thereby improving the audio rendering effect.

[0023] In a possible design of the first aspect, the electronic device obtains a fourth parameter, including: when the electronic device remains stationary at a target position, while the earphone rotates along a first direction on a horizontal plane, the electronic device obtains m fifth parameters at m positions; the target position is used to indicate the position of the electronic device and the earphone on the same horizontal plane; the fifth parameter is used to indicate the distance difference between the left earbud and the right earbud and the electronic device; m is a positive integer; and the electronic device obtains the fourth parameter based on the maximum and minimum values ​​of the m fifth parameters.

[0024] In a possible design of the first aspect, the electronic device corresponds to the target user; or, the electronic device corresponds to the HRTF; or, the correspondence between the target user and the HRTF is stored in the electronic device.

[0025] In a second aspect, an electronic device is provided, which has the function of implementing the function described in the first aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0026] According to a third aspect, an electronic device is provided, which includes a display screen, a memory and one or more processors; the display screen, the memory and the processor are coupled; the memory is used to store computer program code, and the computer program code includes computer instructions; when the computer instructions are executed by the processor, the electronic device performs the following steps: the electronic device obtains M first angles, and N head-related impulse response HRIR data corresponding to the first angles; the first angle is used to indicate the angle between a first line and a horizontal plane, and the first line is a line between the electronic device and the center position of the head of a target user; the HRIR data includes a second angle and a target distance; the second angle is used to indicate the angle between a second line and a horizontal plane, and the second line is a line between the electronic device and the first ear of the target user, and the target distance is used to indicate the distance between the electronic device and the center position of the head; M and N are positive integers; the electronic device performs time domain conversion processing on the HRIR data to obtain the HRTF of the target user; the electronic device performs audio rendering on the audio signal to be rendered according to the HRTF corresponding to the target user to generate a target rendering signal; the target rendering signal is a rendering signal output to the ear of the target user.

[0027] In a possible design of the third aspect, when the computer instructions are executed by the processor, the electronic device specifically performs the following steps: after each first angle is acquired by the electronic device, N HRIR data corresponding to the first angle are determined until M first angles and the HRIR data corresponding to the M first angles are acquired.

[0028] In a possible design of the third aspect, the relative height of the electronic device and the target user is different for different first angles; when the computer instructions are executed by the processor, the electronic device specifically performs the following steps: the electronic device obtains a first parameter and a second parameter corresponding to the target user; the first parameter is used to indicate the distance between the electronic device and the center position of the head; the second parameter is used to indicate a preset distance between the electronic device and the center position of the head on the same horizontal plane, and the second parameter is greater than or equal to a first preset value; the electronic device obtains a first angle based on the first parameter and the second parameter corresponding to the first relative height; after the electronic device moves in the vertical direction, the relative height of the electronic device and the target user changes; the electronic device obtains another first angle based on the first parameter and the second parameter corresponding to the changed relative height, until M first angles are obtained.

[0029] In a possible design of the third aspect, the first angle, the first parameter and the second parameter satisfy the following expression: φ=arccos(R0 / R); wherein φ is the first angle, R is the first parameter, and R0 is the second parameter.

[0030] In a possible design of the third aspect, the audio acquisition device is an earphone, and the earphone includes a left earplug and a right earplug; when the computer instruction is executed by the processor, the electronic device specifically performs the following steps: when the first angle remains unchanged, while the earphone rotates along the first direction on the horizontal plane, the electronic device obtains N third parameters and N target distances at N different positions; the third parameter is used to indicate the distance difference between the left earplug and the right earplug and the electronic device; the electronic device obtains a fourth parameter; the fourth parameter is used to indicate the head circumference diameter of the target user; the electronic device obtains N second angles based on the N third parameters and the fourth parameter; different second angles correspond to the third parameter at one position; the electronic device obtains N HRIR data based on the N second angles and the N target distances; one HRIR data corresponds to one second angle and one target distance.

[0031] In a possible design of the third aspect, when the computer instruction is executed by the processor, the electronic device further performs the following steps: the electronic device prompts the target user to rotate along a first direction on a horizontal plane through first prompt information.

[0032] In a possible design of the third aspect, the second angle, the third parameter and the fourth parameter satisfy the following expression: θ=arccos(Δd / D); wherein θ is the second angle; Δd ​​is the third parameter, and D is the fourth parameter.

[0033] In a possible design of the third aspect, when the computer instructions are executed by the processor, the electronic device further performs the following steps: the electronic device uses the target distance corresponding to the starting position as the reference distance; the starting position is the position when the earphone starts to rotate along the first direction on the horizontal plane; for each HRIR data, when the difference between the target distance and the reference distance is less than or equal to the second preset value, the electronic device adjusts the target distance in the HRIR data to the reference distance; when the difference between the target distance and the reference distance is greater than the third preset value, the electronic device deletes the HRIR data.

[0034] In a possible design of the third aspect, the electronic device stores K preset angles; K is a positive integer; when the computer instruction is executed by the processor, the electronic device also performs the following steps: when the K preset angles do not match the M first angles, the electronic device re-acquires the first angle until the K preset angles match the M first angles.

[0035] In a possible design of the third aspect, when the computer instructions are executed by the processor, the electronic device also performs the following steps: the electronic device prompts a preset angle and a current first angle to the target user through a second prompt information; the second prompt information is used to enable the target user to adjust the relative height of the electronic device and the target user according to the prompted preset angle and the current first angle.

[0036] In a possible design of the third aspect, when the computer instruction is executed by the processor, the electronic device also performs the following steps: the electronic device interpolates the M first angles to obtain the interpolated first angles, and obtains N HRIR data corresponding to the interpolated first angles; the difference between the interpolated first angles and the first angles is less than or equal to the first threshold; the electronic device interpolates the N HRIR data to obtain the interpolated HRIR data; the difference between the second angle in the interpolated HRIR data and the second angle in the HRIR data is less than or equal to the second threshold; the electronic device performs time domain conversion processing on the HRIR data to obtain the HRTF of the target user, including: the electronic device performs time domain conversion processing on the interpolated HRIR data to obtain the HRTF of the target user; wherein the interpolation processing includes one of linear interpolation, bilinear interpolation or centroid interpolation.

[0037] In a possible design of the third aspect, when the computer instructions are executed by the processor, the electronic device specifically performs the following steps: when the electronic device remains stationary at the target position, while the earphone rotates along the first direction on a horizontal plane, the electronic device obtains m fifth parameters at m positions; the target position is used to indicate the position of the electronic device and the earphone on the same horizontal plane; the fifth parameter is used to indicate the distance difference between the left earbud and the right earbud and the electronic device; m is a positive integer; the electronic device obtains a fourth parameter based on the maximum and minimum values ​​of the m fifth parameters.

[0038] In a possible design of the third aspect, the electronic device corresponds to the target user; or, the electronic device corresponds to the HRTF; or, the correspondence between the target user and the HRTF is stored in the electronic device.

[0039] In a fourth aspect, an audio system is provided, comprising: an electronic device and an audio acquisition device; the audio acquisition device is worn on the ear of a target user; the electronic device is communicatively connected to the audio acquisition device; and the electronic device is used to execute any of the methods described in the first aspect.

[0040] In a possible design of the fourth aspect, the audio system also includes: an audio playback device; the audio playback device is used to play a swept frequency signal of a first frequency band, and the electronic device is used to play a swept frequency signal of a second frequency band; the first frequency band is different from the second frequency band.

[0041] In this design, the electronic device and the audio playback device simultaneously play sweep frequency signals of different frequency bands, which can reduce the time for playing the sweep frequency signals, thereby reducing the time for the electronic device to determine the HRTF, which is beneficial to reducing the power consumption of the device.

[0042] In a fifth aspect, a computer-readable storage medium is provided, wherein computer instructions are stored in the computer-readable storage medium. When the computer instructions are executed on a computer, the computer can execute any of the methods described in the first aspect.

[0043] In a sixth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any of the methods described in the first aspect.

[0044] Among them, the technical effects brought about by any design method in the second to sixth aspects can refer to the technical effects brought about by different design methods in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 A schematic diagram of the structure of an audio system provided in an embodiment of the present application;

[0046] Figure 2 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0047] Figure 3 A schematic diagram of the hardware structure of an audio acquisition device provided in an embodiment of the present application;

[0048] Figure 4 A schematic diagram of a software framework of an electronic device provided in an embodiment of the present application;

[0049] Figure 5 A flow chart of a method for determining HRTF provided in an embodiment of the present application Figure 1 ;

[0050] Figure 6 A flow chart of a method for determining HRTF provided in an embodiment of the present application Figure 2 ;

[0051] Figure 7 A schematic diagram of the time for a left earplug and a right earplug to receive a sweep frequency signal provided in an embodiment of the present application Figure 1 ;

[0052] Figure 8 A schematic diagram of an interface of a method for determining HRTF provided in an embodiment of the present application;

[0053] Fig. 9 A schematic diagram of the time for a left earplug and a right earplug to receive a sweep frequency signal provided in an embodiment of the present application Figure 2 ;

[0054] Fig.10 A schematic diagram of the time for a left earplug and a right earplug to receive a sweep frequency signal provided in an embodiment of the present application Figure 3 ;

[0055] Fig.11 A schematic diagram of interpolating the distance difference between the left earbud and the right earbud and the electronic device provided in an embodiment of the present application;

[0056] Fig.12 A schematic diagram of different pitch angles provided in an embodiment of the present application;

[0057] Fig.13 A schematic plan view of a pitch angle provided in an embodiment of the present application;

[0058] Fig.14 A schematic diagram of the structure of HRIR data provided in an embodiment of the present application;

[0059] Fig.15 A schematic diagram of correcting HRIR data provided in an embodiment of the present application;

[0060] Fig.16 A schematic diagram of interpolating HRIR data provided in an embodiment of the present application;

[0061] Fig.17 A schematic diagram of the structure of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0062] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the present application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship, for example, A / B can represent A or B; "and / or" in the present application is only a kind of association relationship describing the associated objects, indicating that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. And, in the description of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or its similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not necessarily limit the differences. At the same time, in the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design solutions. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete manner for ease of understanding.

[0063] The embodiment of the present application provides a method for determining HRTF, which enables an electronic device to measure the HRTF of a target user based on the geometric size of the target user's head and establish an HRTF database. Since the HRTF database is obtained by the electronic device based on the geometric size of the target user's head, the HRTF database can enable the target user to obtain a better spatial audio rendering effect when applied to spatial audio rendering.

[0064] In some embodiments, when the electronic device plays audio for the first time, the electronic device can prompt the target user to determine the target user's HRTF. In other embodiments, when the electronic device is turned on for the first time, the electronic device can prompt the target user to determine the target user's HRTF. Exemplarily, the "settings application" of the electronic device includes an "exclusive audio mode" setting item, and the target user can enter the "exclusive audio mode" to obtain the target user's HRTF based on the target user's own head geometry.

[0065] It should be noted that the target user described in the embodiments of the present application refers to the user of the electronic device, and the target user may be the owner of the electronic device. In this way, the target user determines the target user's (hereinafter referred to as the user) own HRTF according to the geometric size of his own head and saves it in the electronic device. In actual applications, when the user uses an electronic device to play audio, the electronic device can render the audio based on the existing HRTF, thereby achieving better audio rendering effects and improving user experience.

[0066] The HRTF determination method provided in the embodiment of the present application can be applied to an audio system, which may include at least one electronic device and an audio acquisition device, and a communication connection (such as a wired connection and a wireless connection) is established between the electronic device and the audio acquisition device. The wireless connection may be, for example, a Bluetooth connection.

[0067] In an embodiment of the present application, the electronic device is used to play the sweep frequency signal; the audio acquisition device is used to receive the sweep frequency signal and send a reflection signal to the electronic device, so that the electronic device calculates the time when the audio acquisition device receives the sweep frequency signal according to the reflection signal sent by the audio acquisition device. In some embodiments, the electronic device plays the sweep frequency signal through a speaker; the audio acquisition device receives the sweep frequency signal through a microphone, and the audio acquisition device sends the reflection signal to the electronic device through a channel (such as a wired channel or a wireless channel) that establishes a communication connection with the electronic device.

[0068] It should be noted that the embodiments of the present application do not limit the specific number of electronic devices included in the audio system. For example, the audio system may include one electronic device, two electronic devices, or three electronic devices. In the process of determining the HRTF database, different electronic devices can play swept frequency signals of different frequency bands. In some embodiments, the audio system may also include an electronic device and multiple audio playback devices; wherein the electronic device can be used to play the swept frequency signal and can also be used to determine the HRTF data; and the audio playback device is only used to play the swept frequency signal.

[0069] In some embodiments, taking the example of an audio system including three electronic devices, in the process of obtaining the HRTF database, three electronic devices can be used to simultaneously transmit a frequency sweep signal, and the frequency sweep signal played by each electronic device has a different frequency band. Exemplarily, electronic device 1 transmits a frequency sweep signal in the 50Hz to 2kHz frequency band; electronic device 2 transmits a frequency sweep signal in the 2kHz to 10kHz frequency band; electronic device 3 transmits a frequency sweep signal in the 10kHz to 20kHz frequency band. Exemplarily, electronic device 1 can be the electronic device described in the embodiment of the present application, and electronic device 2 and electronic device 3 can be the audio playback devices described in the embodiment of the present application, such as audio equipment, speakers, and other devices with speakers.

[0070] Usually, the frequency range that an audio acquisition device can receive is approximately 50Hz to 20kHz, so the frequency range of the swept frequency signal played by the electronic device can be distributed between 50Hz and 20kHz. If the audio system includes only one electronic device, then it may take 30 seconds for the electronic device to transmit a swept frequency signal of 50Hz to 20kHz; however, when the audio system includes three electronic devices, the three electronic devices can respectively transmit swept frequency signals of different frequency bands, and the time for each electronic device to transmit the swept frequency signal will be shortened to 10s. In this way, the time it takes for the electronic device to transmit the swept frequency signal can be reduced, thereby increasing the speed at which the electronic device determines the HRTF, which is beneficial to reducing the power consumption of the device.

[0071] Among them, the electronic device can be, for example, a mobile phone, a tablet computer, a television, a personal computer (PC), a personal digital assistant (PDA), a netbook or a smart wearable device (such as a smart watch, a smart bracelet, etc.), any device with a speaker. The audio acquisition device can be, for example, a device with a microphone (MIC). Such as various types of headphones (wired headphones or wireless headphones) with a microphone. Exemplarily, the wireless headset can be, for example, a true wireless stereo (TWS) headset.

[0072] The following describes in detail the technical solution provided in the embodiment of the present application by taking an audio system including an electronic device, the electronic device being a mobile phone, and the audio acquisition device being a TWS headset as an example.

[0073] The specific architecture of the audio system that may be involved in the technical solution provided in the embodiment of the present application can be referred to Figure 1 As shown. The system architecture may include a mobile phone 100 and a TWS headset 200. Among them, in an embodiment of the present application, a wireless communication connection (such as a Bluetooth connection) may be established between the mobile phone 100 and the TWS headset 200. In the case where the mobile phone 100 and the TWS headset 200 establish a Bluetooth connection for the first time, illustratively, the mobile phone 100 and the TWS headset 200 may respectively respond to the user's operation of turning on Bluetooth and turn on the Bluetooth function respectively. Then, the mobile phone 100 may establish a Bluetooth connection with the TWS headset 200 in response to the user's Bluetooth pairing operation. Or the TWS headset 200 establishes a Bluetooth connection with the mobile phone 100 in response to the user's Bluetooth pairing operation. After the mobile phone 100 and the TWS headset 200 establish a Bluetooth connection for the first time, as long as the mobile phone 100 and the TWS headset 200 both turn on the Bluetooth function and the distance is less than a certain threshold, a Bluetooth connection will be automatically established.

[0074] For example, Figure 2 A mobile phone 100 is shown in the embodiment of the present application. Figure 2 As shown, the mobile phone 100 may include components such as a processor 110, a memory 120, a display screen 130, a microphone 140, a speaker 150, a wireless communication module 160, an antenna, a power supply 170, and a sensor 180.

[0075] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processor (NPU), etc. Different processing units may be independent devices or integrated in the same processor.

[0076] The controller can be the decision maker that directs the various components of the mobile phone 100 to work in coordination according to the instructions. It is the nerve center and command center of the mobile phone 100. The controller generates an operation control signal according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.

[0077] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0078] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0079] It is understandable that the interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration and does not constitute a structural limitation of the electronic device. In other embodiments, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0080] The memory 120 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the mobile phone 100 by running the instructions stored in the memory 120. The memory 120 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the mobile phone 100 (such as audio data, a phone book, etc.), etc. In addition, the memory 120 may include a random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, other volatile solid-state storage devices, a universal flash storage (UFS), etc.

[0081] The display screen 130 is used to display images, videos, etc. The display screen includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Mini-LED, Micro-OLED, Micro-OLED, quantum dot light-emitting diodes (QLED), etc.

[0082] Microphone 140, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When a user makes a call or sends a voice message, the user can speak by approaching the microphone with his mouth to input the sound signal into the microphone. The mobile phone 100 can be provided with at least one microphone.

[0083] The speaker 150, also called a "speaker", is used to convert audio signals into sound signals. The mobile phone 100 can receive music or listen to hands-free calls through the speaker.

[0084] Antennas are used to transmit and receive electromagnetic wave signals.

[0085] The wireless communication module 160 can provide a communication processing module for wireless communication solutions including wireless local area networks (WLAN) (for example, wireless fidelity (Wi-Fi)), Bluetooth, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the mobile phone 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via an antenna, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation via the antenna.

[0086] In some embodiments, the antenna of the mobile phone 100 is coupled to the wireless communication module 160. This allows the mobile phone 100 to communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), LTE, 5G new wireless communication (NR), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS) and / or satellite based augmentation system (SBAS).

[0087] The sensor 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, a gravity sensor, and an ultrasonic sensor, etc. In the embodiment of the present application, the ultrasonic sensor is used to measure the distance between the mobile phone and the center of the head.

[0088] For example, Figure 3 The present invention provides a schematic diagram of the structure of an earplug (such as a left earplug 200a and a right earplug 200b) of a TWS headset 200. Figure 3 As shown, the earplug of the TWS headset 200 (such as the left earplug 200a) may include a processor 210, a memory 220, a sensor 230, a wireless communication module 240, a speaker 250, a microphone 260, a power supply 270, and an input / output interface 280.

[0089] The memory 220 may be used to store application code, such as an application code for establishing a wireless connection with another earplug (such as the right earplug 200b) of the TWS headset 200, and for pairing the earplug with the mobile phone 100. The processor 210 may control the execution of the above application code to implement the earplug function of the TWS headset 200 in the embodiment of the present application.

[0090] The memory 220 may also store a Bluetooth address for uniquely identifying the earplug, and a Bluetooth address of another earplug of the TWS headset 200. In addition, the memory 220 may also store connection data of a mobile phone 100 that has been successfully paired with the earplug before. For example, the connection data may be the Bluetooth address of the mobile phone 100 that has been successfully paired with the earplug. Based on the connection data, the earplug can be automatically paired with the electronic device without having to configure the connection therewith, such as performing legitimacy verification. The above Bluetooth address may be a media access control (MAC) address.

[0091] The sensor 230 may be a distance sensor or a proximity light sensor. The earplug may determine whether it is worn by the user through the sensor 230. For example, the earplug may use a proximity light sensor to detect whether there is an object near the earplug, thereby determining whether the earplug is worn by the user. When it is determined that the earplug is worn, the earplug may turn on the speaker 250. In some embodiments, the earplug may also include a bone conduction sensor, combined into a bone conduction headset. Using the bone conduction sensor, the earplug can obtain the vibration signal of the vocal bone, parse the voice signal, and realize the voice function. In other embodiments, the earplug may also include a touch sensor for detecting the user's touch operation. In other embodiments, the earplug may also include a fingerprint sensor for detecting the user's fingerprint, identifying the user's identity, etc. In other embodiments, the earplug may also include an ambient light sensor, which can adaptively adjust some parameters, such as the volume, according to the brightness of the perceived ambient light.

[0092] The wireless communication module 240 is used to support short-range data exchange between the earplugs of the TWS headset 200 and various devices (such as the mobile phone 100 in the above embodiment). In some embodiments, the wireless communication module 240 can be a Bluetooth transceiver. The earplugs of the TWS headset 200 can establish a wireless connection with the above-mentioned mobile phone 100 through the Bluetooth transceiver to achieve short-range data exchange between the two.

[0093] The speaker 250 may also be called a “receiver”, and may be used to convert an audio electrical signal into a sound signal and play the sound signal.

[0094] Microphone 260 may also be called a “microphone” or a “microphone” and is used to convert sound signals into audio electrical signals.

[0095] The power supply 270 can be used to power various components included in the earplug of the TWS headset 200. In some embodiments, the power supply 270 can be a battery, such as a rechargeable battery.

[0096] Typically, the TWS headset 200 is equipped with an earplug box. The earplug box can be used to store the left and right earplugs of the TWS headset 200. The earplug box can be used to store the left earplug 200a and the right earplug 200b of the TWS headset 200. In addition, the earplug box can also charge the left and right earplugs of the TWS headset 200. Accordingly, in some embodiments, the above-mentioned earplugs may also include: an input / output interface 280. The input / output interface 280 can be used to provide any wired connection between the earplugs of the TWS headset 200 and the earplug box.

[0097] In some embodiments, the input / output interface 280 may be an electrical connector. When the earplugs of the TWS headset 200 are placed in the earplug box, the earplugs of the TWS headset 200 may be electrically connected to the earplug box (such as the input / output interface of the earplug box) through the electrical connector. After the electrical connection is established, the earplug box can charge the power supply 270 of the earplugs of the TWS headset 200. After the electrical connection is established, the earplugs of the TWS headset 200 may also communicate data with the earplug box. For example, the earplugs of the TWS headset 200 may receive pairing instructions from the earplug box through the electrical connection. The pairing instruction is used to instruct the earplugs of the TWS headset 200 to turn on the wireless communication module 240, so that the earplugs of the TWS headset 200 can be paired and connected with the mobile phone 100 using the corresponding wireless communication protocol (such as Bluetooth).

[0098] Of course, the earplug of the TWS headset 200 may not include the input / output interface 280. In this case, the earplug can realize the charging or data communication function based on the wireless connection established with the earplug box through the wireless communication module 240.

[0099] In addition, in some embodiments, the earplug box may further include a processor, a memory and other components. The memory may be used to store application code, and the processor of the earplug box controls the execution to realize the functions of the earplug box. For example, when the user opens the lid of the earplug box, the processor of the earplug box executes the application code stored in the memory, and can send a pairing command to the earplug of the TWS headset 200 in response to the user's operation of opening the lid.

[0100] It is understandable that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the earplug of the TWS headset 200. Figure 3More or fewer components shown in the figure may be combined with two or more components, or may have different component configurations. For example, the earplug may also include an indicator light (which may indicate the status of the earplug such as the battery level), a dust screen (which may be used in conjunction with a handset), and other layouts. Figure 3 The various components shown in the drawings may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing or application specific integrated circuits.

[0101] It should be noted that the structures of the left and right earplugs of the TWS earphone 200 can be the same. For example, the left and right earplugs of the TWS earphone 200 can both include Figure 3 Alternatively, the structures of the left and right earplugs of the TWS headset 200 may also be different. For example, one earplug of the TWS headset 200 (such as the left earplug 200a) may include Figure 3 The components shown, while another earplug (such as the right earplug 200b) may include Figure 3 Other components except microphone 260.

[0102] In some embodiments, the software system of the mobile phone 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture or a cloud architecture. The present application embodiment takes the layered architecture Android system as an example to exemplarily illustrate the software structure of the mobile phone 100.

[0103] Figure 4 A software structure diagram of an electronic device provided in an embodiment of the present application.

[0104] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

[0105] The application layer can include a series of application packages.

[0106] like Figure 4 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and voice assistant.

[0107] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0108] like Figure 4As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0109] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0110] Content providers are used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, making and receiving calls, browsing history and bookmarks, phone books, etc.

[0111] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0112] The phone manager is used to provide communication functions of the mobile phone 100, such as management of call status (including answering, hanging up, etc.).

[0113] The resource manager provides various resources for applications, such as localized characters, icons, pictures, layout files, video files, etc.

[0114] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0115] Android Runtime includes core libraries and virtual machines. Android Runtime is responsible for scheduling and management of the Android system.

[0116] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0117] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0118] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0119] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0120] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0121] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis and layer processing, etc.

[0122] A 2D graphics engine is a drawing engine for 2D drawings.

[0123] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0124] Before describing the embodiments of the present application, the related technologies involved in the embodiments of the present application are first explained.

[0125] It should be noted that HRTF is the frequency domain transfer function from the sound source to both ears. HRTF uses spherical coordinates (r, θ, φ) to represent the position of the sound source. Among them, r is the distance between the sound source and the center of the head; θ represents the direction of the sound source on the horizontal plane (abbreviated as azimuth); φ represents the direction of the sound source on the median vertical plane (abbreviated as pitch angle). Among them, on the median vertical plane, φ = -90° represents directly below, φ = 0° represents the horizontal plane, and φ = +90° represents directly above; on the horizontal plane, θ = 0° represents directly in front, θ = 90° represents directly to the right, θ = 180° represents directly behind, and θ = 270° represents directly to the left. In the case of a free field, HRTF is defined as:

[0126] Among them, P L , P R are the sound pressures generated by the sound source in the left ear and the right ear respectively; P0 is the sound pressure at the center of the head when the head does not exist; r is the distance from the sound source to the center of the head; f is the frequency of the sound wave; θ is the azimuth angle, and φ is the pitch angle.

[0127] It should be noted that the time domain representation of HRTF is head-related impulse response (HRIR);l =(r,θ,φ,f),h r =(r,θ,φ,f) and H L , H R are the Fourier transforms of each other.

[0128] In some embodiments, HRTF may be obtained by collecting HRIR data and performing time domain conversion processing (such as Fourier transform) on the data.

[0129] The HRTF determination method provided in the embodiment of the present application is described in detail below in conjunction with the accompanying drawings of the specification.

[0130] Figure 5 A flow chart of a method for determining HRTF provided in an embodiment of the present application is shown as follows: Figure 5 As shown, the method includes: S301-S306.

[0131] S301. The mobile phone determines the diameter of the user's head circumference.

[0132] It should be noted that in the subsequent collection of HRIR data, it is necessary to calculate the rotation angle of the user's head relative to the mobile phone, that is, the second angle (or azimuth angle, θ) described in the embodiment of the present application. The azimuth angle θ is related to the user's head circumference diameter, so it is necessary to first obtain the user's head circumference diameter (that is, the fourth parameter described in the embodiment of the present application).

[0133] In some embodiments, the process of obtaining the user's head circumference diameter is as follows: Figure 6 As shown, exemplarily, the process includes: step 1, the mobile phone is fixed at the target position 1 (or target position), and the sweep signal is played. The target position is used to indicate the position of the mobile phone and the TWS headset on the same horizontal plane. For example, the target position 1 can be the direction facing the user's face. In other words, when the mobile phone is at the target position 1, the mobile phone screen is facing the user's face.

[0134] Generally, the frequency range that a TWS headset can receive is about 50 Hz to 20 kHz, so the frequency range of the sweep frequency signal played by the mobile phone can be distributed between 50 Hz and 20 kHz. Exemplarily, the mobile phone plays the sweep frequency signal through a speaker.

[0135] Step 2: The mobile phone instructs the TWS headset to use the earplugs to receive the sweep signal.

[0136] For example, Figure 1 As shown, the mobile phone can instruct the left earplug 200a and the right earplug 200b of the TWS headset to receive the sweep frequency signal. For example, the mobile phone can instruct the microphones in the left earplug 200a and the right earplug 200b of the TWS headset to receive the sweep frequency signal.

[0137] Step 3. The mobile phone determines the distance difference between the left and right earbuds of the TWS headset and the mobile phone based on the time difference of the earbuds receiving the sweep signal.

[0138] In some embodiments, the time difference between the earplugs receiving the sweep frequency signal may be referred to as interaural time difference (ITD), which refers to the time interval between the sweep frequency signal reaching the left earplug 200a and the right earplug 200b.

[0139] For example, the distance difference between the left earbud and the right earbud of the TWS headset and the mobile phone satisfies the following expression: Among them, ΔS is the distance difference between the left earbud and the right earbud of the TWS headset and the mobile phone (that is, the fifth parameter described in the embodiment of the present application), v is the propagation speed of the sweep frequency signal in the air, and Δt is the binaural sound pressure time difference.

[0140] Generally, the propagation speed of the sweep signal in the air is 340m / s. For example, the time when the left earbud receives the sweep signal is t1, and the time when the right earbud receives the sweep signal is t2. For example, the distance difference between the left earbud and the right earbud of the TWS headset and the mobile phone can be expressed as:

[0141] For example, Figure 7 As shown in the figure, when the mobile phone is at target position 1, that is, the mobile phone is directly in front of the user's face; on this basis, the time for the left and right earbuds of the TWS headset to receive the sweep signal is the same (that is, t1 = t2). In this way, the distance difference ΔS between the left and right earbuds of the TWS headset and the mobile phone is zero.

[0142] Step 4: The mobile phone remains at the target position 1, and the mobile phone instructs the user's head to rotate a preset angle along the first direction on the horizontal plane, and steps 2-3 are re-executed until the user's head returns to the starting position.

[0143] When the mobile phone instructs the user's head to rotate along the first direction by a preset angle, the user's head will drive the headset to rotate along the first direction. Therefore, when the headset rotates along the first direction on the horizontal plane, the mobile phone re-executes steps 2-3 to obtain m fifth parameters at m positions, where one position corresponds to one preset angle. m is a positive integer.

[0144] In some embodiments, the first direction may be, for example, a clockwise direction; or the first direction may be a counterclockwise direction. It should be noted that the following embodiments of the present application are all illustrated by taking the first direction as a clockwise direction as an example. In addition, the present application does not limit the preset angle. Exemplarily, the preset angle may be, for example, 45° or 90° or other suitable angles, which shall be subject to the actual situation.

[0145] It should be noted that the user's head returning to the starting position means that after the user's head rotates 360° clockwise, the user's face is facing the mobile phone screen again.

[0146] In some embodiments, the mobile phone instructs the user's head to rotate by a preset angle along a first direction on a horizontal plane through a prompt message (or first prompt message). Exemplarily, the prompt message includes at least one of a voice prompt message and a text prompt message. For example, Figure 8 As shown in (a), the mobile phone can play a voice message like "Turn your head 90° clockwise". Figure 8 In some embodiments, the mobile phone can also instruct the user to turn his head through a prompting method of vibration + voice + pop-up window.

[0147] For example, Fig. 9 As shown, when the user's head turns 90° clockwise, the mobile phone is located to the right of the user's face. In this case, the left earbud of the TWS headset is closest to the mobile phone, and the right earbud of the TWS headset is farthest from the mobile phone. Therefore, when the mobile phone plays the sweep signal, the left earbud receives the sweep signal first, and then the right earbud receives the sweep signal, that is, the time it takes for the left earbud to receive the sweep signal is less than the time it takes for the right earbud to receive the sweep signal. In this way, the time difference between the left and right earbuds in receiving the sweep signal is minimized, so that the distance difference between the left and right earbuds and the mobile phone is minimized at this angle (for example, it can be marked as ΔS min ).

[0148] Another example is Fig.10 As shown in the figure, after the user's head rotates 270° clockwise, the mobile phone is located to the left of the user's face. In this case, the right earbud of the TWS headset is closest to the mobile phone, and the left earbud of the TWS headset is farthest from the mobile phone. Therefore, when the mobile phone plays the sweep signal, the right earbud receives the sweep signal first, and then the left earbud receives the sweep signal, that is, the time it takes for the left earbud to receive the sweep signal is greater than the time it takes for the right earbud to receive the sweep signal. In this way, the time difference between the left and right earbuds in receiving the sweep signal is the largest, so that the distance difference between the left and right earbuds and the mobile phone is the largest at this angle (for example, it can be marked as ΔS max ).

[0149] It should be noted that Figure 7 , Fig. 9 as well as Fig.10 The mobile phone and the user's face shown in the figure are both in the horizontal plane and are for reference only. In actual application, when the mobile phone is at the target position 1, the mobile phone is facing the user's face; then, the mobile phone remains in the same position and the user's head rotates clockwise. For example, the user's legs rotate clockwise, thereby driving the head to rotate clockwise.

[0150] In some embodiments, the mobile phone can calculate the distance difference ΔS between the left and right earbuds of the TWS headset and the mobile phone during the movement of the user's head (such as clockwise rotation), that is, every time the user's head rotates a certain angle, the mobile phone can calculate the distance difference ΔS between the left and right earbuds of the TWS headset and the mobile phone at that angle. In some embodiments, since the number of distance differences ΔS calculated by the mobile phone during the clockwise rotation of the user's head is small, resulting in the inaccuracy of the determined head circumference diameter, the mobile phone can also perform target processing based on the results of the calculated distance difference ΔS to obtain more distance differences ΔS. Exemplarily, the target processing can be, for example, interpolation processing. Among them, the interpolation processing includes one or more of linear interpolation, bilinear interpolation, or center of gravity interpolation.

[0151] For example, after the mobile phone performs target processing on the calculated distance difference ΔS, the change rule of the distance difference ΔS from the left earplug and the right earplug to the mobile phone is as follows: Fig.11 As shown, for example, by Fig.11 It can be seen that when the user's head rotates clockwise from 0° to 90°, the distance difference ΔS gradually decreases; when the user's head rotates clockwise to 90°, the distance difference ΔS is the smallest. Correspondingly, when the user's head rotates clockwise from 90° to 270°, the distance difference ΔS gradually increases; when the user's head rotates clockwise to 270°, the distance difference ΔS is the largest. Correspondingly, when the user's head rotates clockwise from 270° to 360°, the distance difference ΔS gradually decreases.

[0152] In combination with step 1 and step 2 in the above embodiment, in some embodiments, the mobile phone can determine the head circumference diameter of the user by calculating the distance difference ΔS during the movement of the user's head. For example, the head circumference diameter of the user satisfies the following expression: Where D is the user's head circumference, ΔS max is the maximum value of the distance difference, ΔS min is the minimum distance difference.

[0153] S302: The mobile phone measures M pitch angles (or first angles) between the mobile phone and the center position of the head.

[0154] Wherein, M is a positive integer.

[0155] It should be noted that the pitch angle refers to the angle between the first connecting line (or the first connecting line) and the horizontal plane. The first connecting line is used to indicate the connecting line between the mobile phone and the center position of the head. The pitch angle can be marked as φ, for example.

[0156] In some embodiments, the mobile phone is fixed with a retractable bracket, and the height of the mobile phone above the ground is changed to obtain M pitch angles between the mobile phone and the center of the head. In other words, the relative heights of the mobile phone and the user are different for different pitch angles. The relative height between the mobile phone and the user refers to the different heights of the mobile phone relative to the user, with the user as a reference. For example, with the user's head as a reference, when the height of the mobile phone is changed with a retractable bracket, the height of the mobile phone relative to the user's head changes. Of course, the relative height between the mobile phone and the user can also be represented by using the user's ear as a reference, or using the center of the user's head as a reference, etc., and the embodiments of the present application are not limited to this.

[0157] For example, Fig.12 As shown, a spherical coordinate system is established with the center position of the head O as the origin coordinate. For example, when the phone is at position 1, since the phone and the TWS headset are on the same horizontal plane, the pitch angle between the phone and the center position of the head is φ1 = 0°. When the phone is at position 2, the pitch angle between the phone and the center position of the head is φ2. When the phone is at position 3, the pitch angle between the phone and the center position of the head is φ3. By Fig.12 It can be seen that the pitch angle between the mobile phone and the center of the head is: the angle between the line between the mobile phone and the center of the head and the horizontal plane.

[0158] Take the pitch angle between the mobile phone and the center of the head as φ2 as an example. Fig.13 As shown, the pitch angle can be calculated by measuring the distance R between the mobile phone and the center of the head. For example, the pitch angle satisfies the following expression: φ = arccos (R0 / R); where φ is the pitch angle, R is the distance between the mobile phone and the center of the head (or the first parameter), and R0 is the minimum distance between the mobile phone and the center of the head (or the second parameter). Wherein, R0 is a preset distance pre-set on the mobile phone.

[0159] It should be noted that when the mobile phone and the TWS headset are on the same horizontal plane, the distance between the mobile phone and the center of the head is the smallest, that is, the distance is R0. In some embodiments, the minimum distance between the mobile phone and the center of the head is greater than or equal to 2m (meters), that is, R0 ≥ 2m, to ensure that the mobile phone and the TWS headset are in far-field conditions.

[0160] In some embodiments, the mobile phone can measure the distance between the mobile phone and the center of the head through an ultrasonic sensor. Exemplarily, the ultrasonic sensor uses the principle of ultrasonic ranging to measure the distance between the mobile phone and the center of the head. The ultrasonic ranging principle refers to that an ultrasonic transmitter transmits ultrasonic waves in a certain direction, and timing starts at the same time as the transmission moment. The ultrasonic waves propagate in the air and return immediately when they encounter obstacles on the way. The ultrasonic receiver stops timing immediately when it receives the reflected wave.

[0161] In an embodiment of the present application, the ultrasonic transmitter may be, for example, a speaker, and the mobile phone sends a sweep signal through the speaker. The ultrasonic receiver may be, for example, a microphone, and the mobile phone may receive a reflected signal of the sweep signal through the microphone. Exemplarily, the mobile phone sends a sweep signal through a speaker, and starts timing at the moment of transmission; the sweep signal propagates in the air, and a reflected signal is generated when the sweep signal hits the user's head, and the mobile phone stops timing immediately after receiving the reflected signal through the microphone. In some embodiments, the distance between the mobile phone and the center of the head satisfies the following expression: Among them, R is the distance between the mobile phone and the center of the head, v is the propagation speed of the sweep signal in the air, and t is the time it takes for the mobile phone to send out the sweep signal and receive the reflected signal.

[0162] Combining the above embodiments and Fig.12 and Fig.13 As shown, specifically, by changing the height of the mobile phone above the ground, the mobile phone is located at different positions on the median vertical plane; for different positions, the mobile phone first measures the distance R between the mobile phone and the center position of the head at that position, and then the mobile phone calculates the pitch angle φ of the mobile phone at that position based on the distance R and the minimum distance R0, thereby obtaining M pitch angles.

[0163] S303: For each pitch angle, the mobile phone measures N HRIR data corresponding to the pitch angle.

[0164] It should be noted here that in the embodiment of the present application, after each pitch angle is obtained by the mobile phone, N HRIR data corresponding to the pitch angle will be measured until M pitch angles and HRIR data corresponding to the M pitch angles are obtained.

[0165] Each of the N HRIR data includes an azimuth (or second angle) and a distance between the mobile phone and the center of the head (or target distance). Exemplarily, the HRIR data may be labeled as (θ, r), wherein θ represents the azimuth, and r represents the distance between the mobile phone and the center of the head.

[0166] Take the pitch angle φ1 as an example for illustration, and combine Fig.12As shown, the position of the mobile phone corresponding to the pitch angle φ1 is position 2. Fix the mobile phone at position 2 and play the sweep signal. After the sweep signal is played, the user's head rotates along the first direction to the measurement position 1, and the mobile phone plays the sweep signal again. After the sweep signal is played, the user's head rotates along the first direction to the measurement position 2, and the mobile phone plays the sweep signal again. This cycle is repeated until the user's head returns to the starting position. That is to say, when the pitch angle remains unchanged, while the headset (i.e., the user's head) rotates along the first direction on the horizontal plane, the mobile phone can obtain N third parameters and N target distances from N different positions (i.e., different measurement positions). Then, the mobile phone can calculate N second angles for each third parameter and fourth parameter. Based on this, the mobile phone can obtain N HRIR data based on the N second angles and N target distances.

[0167] In some embodiments, the mobile phone can prompt the user to rotate along the first direction on the horizontal plane through the first prompt information. Figure 8 (a) and Figure 8 As shown in (b) in the figure, they will not be listed here one by one.

[0168] It should be noted that, for the example description of the frequency sweep signal and the first direction, reference may be made to the above embodiments, which will not be described in detail here.

[0169] In some embodiments, at each measurement position, the mobile phone measures the HRIR data corresponding to the measurement position. For example, the user's head rotates along the first direction to the measurement position 1. For example, Fig.14 As shown, the azimuth refers to the angle between the second connecting line (or the second connecting line) and the horizontal plane. The second connecting line is used to indicate the connecting line between the mobile phone and the first earplug (or the first ear).

[0170] It should be noted that the first earplug can be a left earplug or a right earplug, which is not limited in this embodiment of the present application. Fig.14 The first earplug is taken as an example to illustrate.

[0171] In some embodiments, the azimuth angle can be calculated based on the distance difference between the left earplug and the right earplug of the TWS headset and the mobile phone (or the third parameter) and the user's head circumference diameter (or the fourth parameter). In some embodiments, the azimuth angle satisfies the following expression: θ=arccos(Δd / D); where θ is the azimuth angle, Δd is the distance difference between the left earplug and the right earplug of the TWS headset and the mobile phone, and D is the user's head circumference diameter.

[0172] Among them, the method for calculating the distance difference Δd between the left earbud and the right earbud of the TWS headset and the mobile phone can refer to the example of step 3 in the above embodiment, and will not be repeated here.

[0173] It should be understood that the HRIR data also includes the distance r between the mobile phone and the center of the head; wherein the mobile phone can measure the distance between the mobile phone and the center of the head through an ultrasonic sensor. For an example of measuring the distance between the mobile phone and the center of the head through an ultrasonic sensor, reference can be made to the above embodiment, which will not be described one by one here.

[0174] In some embodiments, since the user cannot ensure that the distance r between the mobile phone and the center of the head is always consistent during the rotation process, the distance r may fluctuate within a certain range. Based on this, in the embodiment of the present application, when the mobile phone measures the HRIR data corresponding to each pitch angle, the mobile phone can also perform correction processing on the HRIR data. The correction processing includes correction or deletion.

[0175] Exemplarily, when the user's head is at the starting position, the distance r between the mobile phone and the center of the head calculated by the mobile phone is used as the reference distance (for example, it can be marked as r0). The starting position is the position when the headset starts to rotate along the first direction on the horizontal plane. On this basis, if the difference between the target distance and the reference distance is less than or equal to the preset value, the mobile phone corrects the target distance (that is, the mobile phone adjusts the target distance in the HRIR data to the reference distance); if the difference between the target distance and the reference distance is greater than the preset value, the mobile phone deletes the HRIR data. Exemplarily, if Fig.15 As shown, Fig.15 The HRIR data indicated by the circle is the HRIR data calculated by the mobile phone, and the HRIR data indicated by the five-pointed star is the HRIR data after correction by the mobile phone.

[0176] S304: The mobile phone compares the M pitch angles with a preset pitch angle sequence to determine whether measurement of all pitch angles in the preset pitch angle sequence has been completed.

[0177] The preset pitch angle sequence includes K preset pitch angles (or preset angles). Exemplarily, the preset pitch angle sequence may be, for example, [-40°, -20°, -10°, 0°, 10°, 25°, 40°, 60°].

[0178] In some embodiments, when the mobile phone is at a position corresponding to the above-mentioned K preset pitch angles, the sweep frequency signal can better surround the user's head when the mobile phone plays the sweep frequency signal, so that the user's ears can better receive the sweep frequency signal. Based on this, after the mobile phone measures M pitch angles, it is necessary to compare them with the preset pitch angle sequence to determine whether the M pitch angles measured by the mobile phone match the preset pitch angle sequence. When the M pitch angles do not match the preset pitch angles in the preset pitch angle sequence, the mobile phone remeasures the pitch angle until all the measured pitch angles match the preset pitch angles in the preset pitch angle sequence.

[0179] In this way, when the M pitch angles measured by the mobile phone match the preset pitch angles in the preset pitch angle sequence, the N HRIR data obtained by the mobile phone for each pitch angle will be more accurate and comprehensive. Then, the mobile phone performs time domain conversion processing on the HRIR data to obtain the HRTF. When the mobile phone plays audio, the mobile phone can render the audio according to the obtained HRTF, thereby further improving the audio rendering effect, allowing users to experience a good spatial audio effect.

[0180] Among them, the mobile phone determines whether the measurement of all pitch angles in the preset pitch angle sequence is completed, which means that the mobile phone measures the M pitch angles, and the mobile phone can determine whether the M pitch angles match the preset pitch angle sequence (i.e., K preset pitch angles). In some embodiments, when the difference between the pitch angle and the preset pitch angle is less than a threshold value, the mobile phone determines that the pitch angle matches the preset pitch angle. In other embodiments, when the pitch angle is exactly the same as the preset pitch angle, the mobile phone determines that the pitch angle matches the preset pitch angle. Among them, the threshold value can be set according to the actual situation, and the embodiment of the present application is not limited to this. For example, the threshold value can be 1°, 2° or 3°, etc.

[0181] Taking a preset pitch angle (such as 40°) in the above preset pitch angle sequence as an example, for example, when a pitch angle among the M pitch angles is 38°, and the difference between the pitch angle and the preset pitch angle (such as 40°) is less than the threshold, the mobile phone determines that the pitch angle matches the preset pitch angle. For another example, when a pitch angle among the M pitch angles is 40°, which is exactly the same as the preset pitch angle (such as 40°), the mobile phone determines that the pitch angle matches the preset pitch angle.

[0182] It should be understood that the above embodiment is only illustrated by taking one preset pitch angle as an example. In actual implementation, the mobile phone needs to determine whether each preset pitch angle in the preset pitch angle sequence matches the M pitch angles.

[0183] In some embodiments, when the mobile phone is measuring the pitch angle, the mobile phone can prompt the user of the currently measured pitch angle and the preset pitch angle through the second prompt information, so that the user can preset the pitch angle according to the pitch angle prompted by the mobile phone, and adjust the relative height between the mobile phone and the user so that the measured pitch angle matches the preset pitch angle. This can prevent the user from blindly measuring the pitch angle and increase the difficulty of the user's measurement.

[0184] For example, the mobile phone can prompt the user with the second prompt information by voice; or the mobile phone can prompt the user with the second prompt information by voice + pop-up window; or the mobile phone can also prompt the user with the second prompt information by voice + pop-up window + vibration. For the example description of the second prompt information, please refer to the above embodiment, which will not be listed here one by one.

[0185] For example, the mobile phone prompts the user that the currently measured pitch angle is 38° and the preset pitch angle is 40°. In this way, the user can appropriately raise the height of the mobile phone so that the measured pitch angle is closer to 40°.

[0186] S305. The mobile phone compensates the pitch angle and HRIR data according to a preset frequency response.

[0187] Among them, the preset frequency response refers to the frequency response of the mobile phone speaker and the microphone of the TWS headset. The frequency response is used to indicate the difference in the processing ability of the speaker (or microphone) for signals of different frequencies. Exemplarily, the frequency response can be represented by a frequency response curve. The frequency response curve refers to the curve of gain change with frequency. The ideal frequency response curve should be flat, that is, the ideal frequency response curve is a straight line, which can prevent the sound signal from being distorted.

[0188] In some embodiments, due to the influence of the frequency response of the mobile phone speaker and the microphone of the TWS headset, the pitch angle and HRIR data measured by the mobile phone may produce errors, so the mobile phone can compensate the pitch angle and HRIR data according to the preset frequency response. Exemplarily, the preset frequency response can be, for example, the ideal frequency response curve of the speaker and the microphone, so that the swept frequency signal is not distorted, and the accuracy of the pitch angle and HRIR data measured by the mobile phone can be ensured.

[0189] S306: The mobile phone performs interpolation processing on the pitch angle and HRIR data.

[0190] The interpolation process includes one of linear interpolation, bilinear interpolation or centroid interpolation.

[0191] In some embodiments, since the number of pitch angles and HRIR data measured by the mobile phone is small, the directly obtained HRTF database cannot be directly applied to spatial audio rendering. Based on this, after the mobile phone interpolates the measured HRIR data, it can obtain a larger number of pitch angles and HRIR data, thereby making the HRTF database more complete. When the HRTF database is applied to spatial audio rendering, the user can obtain a more perfect spatial audio rendering effect.

[0192] In some embodiments, the mobile phone performs interpolation processing between each two adjacent pitch angles among the M pitch angles to obtain the interpolated pitch angle; at the same time, the mobile phone can also obtain N HRIR data corresponding to the interpolated pitch angle. Exemplarily, the interval between the interpolated pitch angle and the measured pitch angle is less than or equal to the first threshold. The first threshold can be, for example, 3° or 5°; or the first threshold can also be other suitable angles, which is not limited in the embodiments of the present application.

[0193] In some embodiments, the mobile phone performs interpolation processing between each two adjacent HRIR data among N HRIR data to obtain interpolated HRIR data. Exemplarily, the azimuth interval between the interpolated HRIR data and the measured HRIR data is less than or equal to the second threshold. The second threshold may be, for example, 1° or 2°; or the second threshold may also be other suitable angles, which is not limited in the embodiments of the present application. On this basis, the mobile phone performs time domain conversion processing on the interpolated HRIR data to obtain the HRTF of the target user.

[0194] Take the example of a mobile phone interpolating between two adjacent HRIR data in N HRIR data as an example. Fig.16 As shown, Fig.16 The HRIR data indicated by the five-pointed star are calculated by the mobile phone, and the HRIR data indicated by the triangle are interpolated by the mobile phone.

[0195] It should be noted that in the above embodiment, the HRIR data (θ, r) corresponding to each pitch angle φ measured by the mobile phone is HRIR data in the time domain; on this basis, the mobile phone performs time domain conversion processing (such as Fourier transform) on the HRIR data corresponding to each pitch angle φ to obtain the HRTF of the target user.

[0196] In some embodiments, in actual applications, when the mobile phone plays audio, the mobile phone outputs an audio signal to be rendered, and the mobile phone can perform audio rendering on the audio to be rendered according to the HRTF corresponding to the target user obtained in advance, and generate a target rendering signal. Among them, the target rendering signal is a rendering signal output to the ear of the target user. In this way, since the mobile phone can render the audio according to the HRTF corresponding to the predetermined target user when playing audio, the target user can obtain a better spatial audio effect and improve the user experience.

[0197] In some embodiments, the mobile phone corresponds to the target user. On this basis, when the mobile phone plays audio, the mobile phone can render the audio according to the HRTF of the target user corresponding to it. In other embodiments, the mobile phone corresponds to HRTF. On this basis, when the mobile phone plays audio, the mobile phone can render the audio according to the HRTF corresponding to it. In some other embodiments, the correspondence between the target user and HRTF is stored in the mobile phone. For example, target user 1 corresponds to HRTF1; target user 2 corresponds to HRTF2. On this basis, when the mobile phone plays audio, the mobile phone can first identify the user who is currently using the mobile phone to play audio (for example, the mobile phone recognizes that the user is target user 1), so the mobile phone can render the audio according to HRTF1 corresponding to target user 1.

[0198] In combination with the above embodiments, since the mobile phone obtains the HRTF database based on the geometric dimensions of the user's head, the HRTF database can enable the user to obtain better spatial audio effects when applied to spatial audio rendering. In addition, the HRTF determination method provided in the embodiment of the present application can be applied to all mobile phones and headphones, and the mobile phone does not need to be equipped with a structured light device (such as a three-dimensional scanner), and the headphones do not need to be equipped with an inertial sensor device (inertial measurement unit, IMU). Users can measure independently, which is conducive to improving user experience.

[0199] The present application embodiment provides an electronic device, which may include a display screen, a memory, and one or more processors; the memory stores computer program code, which includes computer instructions. When the computer instructions are executed by the processor, the electronic device can perform the functions or steps performed by the mobile phone in the above embodiment. The structure of the electronic device can refer to Figure 2 The structure of the mobile phone 100 is shown.

[0200] The present application also provides a chip system, such as Fig.17 As shown, the chip system 1800 includes at least one processor 1801 and at least one interface circuit 1802. The processor 1801 may be Figure 2 The processor 110 is shown. The interface circuit 1802 may be, for example, an interface circuit between the processor 110 and an external memory; or an interface circuit between the processor 110 and an internal memory.

[0201] The processor 1801 and the interface circuit 1802 can be interconnected via lines. For example, the interface circuit 1802 can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit 1802 can be used to send signals to other devices (such as the processor 1801). Exemplarily, the interface circuit 1802 can read instructions stored in the memory and send the instructions to the processor 1801. When the instructions are executed by the processor 1801, the electronic device can execute the various steps performed by the mobile phone 180 in the above embodiment. Of course, the chip system can also include other discrete devices, which is not specifically limited in the embodiments of the present application.

[0202] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes each function or step executed by the mobile phone in the above method embodiment.

[0203] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute each function or step executed by the mobile phone in the above method embodiment.

[0204] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0205] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0206] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0207] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0208] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0209] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A method for determining a head-related function HRTF, characterized in that: An electronic device applied to an audio system, the audio system comprising the electronic device and an earphone, the earphone being worn on the ear of a target user; the electronic device being communicatively connected with the earphone; the method comprising: The electronic device executes the following method to obtain N head-related impulse response HRIR data corresponding to each first angle of the M first angles: Acquire the first angle; the first angle is used to indicate the angle between a first connecting line and a horizontal plane, the first connecting line being a connecting line between the electronic device and the center position of the head of the target user; During the process of the earphone rotating along the first direction on the horizontal plane, the electronic device obtains N third parameters and N target distances at N different positions; the third parameter is used to indicate the distance difference between the left earplug of the earphone and the right earplug of the earphone and the electronic device; the target distance is used to indicate the distance between the electronic device and the center position of the head; one position corresponds to one HRIR data, and the one HRIR data includes a second angle and a target distance: The electronic device acquires a fourth parameter; the fourth parameter is used to indicate the head circumference diameter of the target user; The electronic device obtains N second angles according to the N third parameters and the fourth parameter; the second angle is the arccosine value of the ratio of the third parameter to the fourth parameter; the second angle is used to indicate the angle between a second connecting line and a horizontal plane, and the second connecting line is a connecting line between the electronic device and the first ear of the target user; M and N are positive integers; The HRIR data corresponding to the M first angles are subjected to time domain conversion processing to obtain the HRTF of the target user; the electronic device performs audio rendering on the audio signal to be rendered according to the HRTF corresponding to the target user to generate a target rendering signal; the target rendering signal is a rendering signal for outputting to the ear of the target user.

2. The method according to claim 1, characterized in that The method further comprises: After acquiring each first angle, the electronic device determines N HRIR data corresponding to the first angle until the M first angles and the HRIR data corresponding to the M first angles are acquired.

3. The method according to claim 1, characterized in that The first angle is different, and the relative height between the electronic device and the target user is different; and obtaining the first angle includes: The electronic device obtains a first parameter and a second parameter corresponding to the target user; the first parameter is used to indicate the distance between the electronic device and the center position of the head; the second parameter is used to indicate a preset distance between the electronic device and the center position of the head on the same horizontal plane, and the second parameter is greater than or equal to a first preset value; the electronic device obtains a first angle according to the first parameter and the second parameter corresponding to the relative height.

4. The method according to claim 3, characterized in that The method further comprises: After the electronic device moves in the vertical direction, the relative height between the electronic device and the target user changes; The electronic device obtains another first angle according to the first parameter corresponding to the changed relative height and the second parameter, until M first angles are obtained.

5. The method according to claim 3 or 4, characterized in that: The first angle, the first parameter and the second parameter satisfy the following expression: φ=arccos(R0 / R); wherein φ is the first angle, R is the first parameter, and R0 is the second parameter.

6. The method according to claim 1, characterized in that The method further comprises: The electronic device prompts the target user to rotate along a first direction on a horizontal plane through first prompt information.

7. The method according to claim 1, characterized in that The second angle, the third parameter and the fourth parameter satisfy the following expression: θ=arccos(Δd / D); wherein θ is the second angle; Δd ​​is the third parameter, and D is the fourth parameter.

8. The method according to claim 1, characterized in that: The method further comprises: The electronic device uses the target distance corresponding to the starting position as a reference distance; the starting position is the position of the headset when it starts to rotate along the first direction on the horizontal plane; For each HRIR data, when the difference between the target distance and the reference distance is less than or equal to a second preset value, the electronic device adjusts the target distance in the HRIR data to the reference distance; when the difference between the target distance and the reference distance is greater than a third preset value, the electronic device deletes the HRIR data.

9. The method according to any one of claims 1-4, 6-8, characterized in that: The electronic device stores K preset angles; K is a positive integer; the method further includes: When the K preset angles do not match the M first angles, the electronic device reacquires the first angle until the K preset angles match the M first angles.

10. The method according to claim 9, characterized in that The method also includes: the electronic device prompts the target user with a preset angle and a current first angle through a second prompt message; the second prompt message is used to enable the target user to adjust the relative height between the electronic device and the target user according to the prompted preset angle and the current first angle.

11. The method according to claim 8, characterized in that The method further comprises: The electronic device performs interpolation processing on the M first angles to obtain an interpolated first angle, and obtains N HRIR data corresponding to the interpolated first angle; the difference between the interpolated first angle and the first angle is less than or equal to a first threshold; The electronic device performs interpolation processing on the N HRIR data to obtain interpolated HRIR data; the difference between the second angle in the interpolated HRIR data and the second angle in the HRIR data is less than or equal to a second threshold; The performing time domain conversion processing on the HRIR data corresponding to the M first angles to obtain the HRTF of the target user includes: The electronic device performs time domain conversion processing on the interpolated HRIR data to obtain the HRTF of the target user; The interpolation process includes one of linear interpolation, bilinear interpolation or centroid interpolation.

12. The method according to claim 1, characterized in that The electronic device acquires a fourth parameter, including: When the electronic device remains stationary at the target position, the electronic device obtains m fifth parameters at m positions during the process of the earphone rotating along the first direction on the horizontal plane; the target position is used to indicate the position of the electronic device and the earphone on the same horizontal plane; the fifth parameter is used to indicate the distance difference between the left earplug and the right earplug and the electronic device; m is a positive integer; The electronic device obtains the fourth parameter according to the maximum value and the minimum value of the m fifth parameters.

13. The method according to claim 1, characterized in that The electronic device corresponds to the target user; or, The electronic device corresponds to the HRTF; or, The electronic device stores the corresponding relationship between the target user and the HRTF.

14. An audio system, characterized in that: include: Electronic devices and audio acquisition equipment; The audio acquisition device is worn on the ear of the target user; the electronic device is communicatively connected with the audio acquisition device; and the electronic device is used to execute the method according to any one of claims 1 to 13.

15. The system according to claim 14, characterized in that The audio system further includes: an audio playback device; the audio playback device is used to play a swept frequency signal of a first frequency band, and the electronic device is used to play a swept frequency signal of a second frequency band; the first frequency band is different from the second frequency band.

16. An electronic device, characterized in that: include: A display screen, a memory and one or more processors; the display screen, the memory and the processor are coupled; The memory is used to store computer program codes, and the computer program codes include computer instructions; when the processor executes the computer instructions, the electronic device executes the method according to any one of claims 1 to 13.

17. A computer-readable storage medium, characterized in that: The method comprises computer instructions; when the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 13.

Citation Information

Patent Citations

  • Method for generating customized spatial audio with head tracking

    CN110021306A

  • Structural Modeling of the Head Related Impulse Response

    US20170094440A1