Voice call method and electronic device

By identifying the fast large angle state in electronic devices and applying corresponding noise reduction algorithms, the signal-to-noise ratio change caused by changes in the equipment position is solved, and the quality of voice calls is improved.

CN118433316BActive Publication Date: 2025-03-25HONOR DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410591567.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-17
Publication Date
2025-03-25
Estimated Expiration
2043-04-17

AI Technical Summary

Technical Problem

During the voice call of electronic devices, as the device position changes and the signal-to-noise ratio changes, the sound signal correction result is inaccurate when the preset noise reduction algorithm is directly applied, which affects the call quality.

Method used

By acquiring the first audio signal and the second audio signal, it is determined whether the electronic device is in a fast large angle state. If it is in this state, the corresponding fast large angle state noise reduction algorithm is used to process the audio signal.

Benefits of technology

It improves the audio signal correction effect in the fast large angle state and improves the voice call quality of electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118433316B_ABST
    Figure CN118433316B_ABST
Patent Text Reader

Abstract

The embodiments of the present application are applicable to the field of audio data processing, and provide a method for voice call and an electronic device, the electronic device comprising a first microphone and a second microphone, by acquiring a first audio signal and a second audio signal, and then determining whether the electronic device is in a first state based on the first audio signal and the second audio signal; if the electronic device is in the first state, a first algorithm is used to perform noise reduction processing on the first audio signal to obtain a third audio signal, and the third audio signal is output, wherein the first state refers to a fast and large-angle state, and the first algorithm refers to a noise reduction algorithm corresponding to the fast and large-angle state, that is, the method for voice call provided by the embodiments of the present application can use a matching noise reduction algorithm to process the current audio signal when the electronic device is in the fast and large-angle state, thereby improving the correction effect on the first audio signal, and thereby improving the voice call quality of the electronic device.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the Chinese patent application with application number 202310432571.1 filed on April 17, 2023 and application name “Voice Call Method and Electronic Device”. Technical Field

[0002] The present application relates to the field of audio data processing, and more specifically, to a method and electronic device for voice communication. Background Art

[0003] At present, electronic devices (such as mobile phones) are usually equipped with multiple microphones. Among them, the microphone installed at the bottom of the electronic device and close to the user's mouth is called the main microphone, which is used to collect the user's voice signal; the microphone installed in other areas of the electronic device is called the secondary microphone, which is used to collect environmental noise.

[0004] When the user adjusts the position of the electronic device, the distance between the main microphone and the user's mouth increases from small to large, so the sound signal collected by the main microphone decreases from large to small, and because the position of the secondary microphone remains basically unchanged, the noise signal collected by the secondary microphone remains basically unchanged. In other words, the signal-to-noise ratio of the electronic device changes as the position of the electronic device changes. In this case, since the signal-to-noise ratio of the electronic device changes, if the preset noise reduction algorithm is directly used to correct the sound signal collected by the main microphone, the correction result of the sound signal collected by the main microphone will be inaccurate, which will lead to a decrease in the voice call quality of the electronic device.

[0005] Based on this, how to improve the voice call quality of electronic devices has become an urgent problem to be solved. Summary of the invention

[0006] The present application provides a voice call method, which can improve the voice call quality of an electronic device.

[0007] In a first aspect, a method for voice calling is provided. The method is applied to an electronic device, wherein the electronic device includes a plurality of microphones, wherein the plurality of microphones include a first microphone and a second microphone, wherein the first microphone is used to collect a voice signal of a user, and the second microphone is used to collect a noise signal of an environment in which the electronic device is located. The method includes:

[0008] Acquire a first audio signal and a second audio signal, the first audio signal being an audio signal collected by a first microphone, and the second audio signal being an audio signal collected by a second microphone;

[0009] Determining whether the electronic device is in a first state based on the first audio signal and the second audio signal, the first state refers to a state in which the duration of the electronic device moving from the first posture to the second posture is less than a first threshold, wherein the first posture refers to a posture in which the distance between the first microphone and the user's mouth is less than a second threshold, the second posture refers to a posture in which the distance between the first microphone and the user's mouth is greater than a third threshold, and in the process of moving from the first posture to the second posture, the distance between the second microphone and the user's mouth is less than a fourth threshold;

[0010] If the electronic device is in the first state, the first audio signal is subjected to noise reduction processing using the first algorithm to obtain a third audio signal;

[0011] A third audio signal is output.

[0012] The voice call method provided in the embodiment of the present application is applied to an electronic device, where the electronic device includes a first microphone and a second microphone, the first microphone is used to collect the user's voice signal, and the second microphone is used to collect the noise signal of the environment in which the electronic device is located, by obtaining the first audio signal and the second audio signal, and then determining whether the electronic device is in a first state based on the first audio signal and the second audio signal, if the electronic device is in the first state, using a first algorithm to perform noise reduction processing on the first audio signal to obtain a third audio signal, and outputting the third audio signal, wherein the first state refers to a state in which the duration of the electronic device moving from a first posture to a second posture is less than a first threshold, the first posture refers to a posture in which the distance between the main microphone and the user is less than a second threshold, and the second posture refers to a posture in which the distance between the first microphone and the user is greater than the third threshold. Threshold position, and in the process of moving from the first position to the second position, the distance between the second microphone and the user is less than the fourth threshold, that is, the first state refers to the fast large angle state, and the first algorithm refers to the noise reduction algorithm corresponding to the fast large angle state. That is to say, using the voice call method provided in the embodiment of the present application, when it is determined that the electronic device is in the first state through the first audio signal and the second audio signal, the first audio signal is subjected to noise reduction processing using the noise reduction algorithm corresponding to the first state to obtain a third audio signal output by the electronic device, so that in the first state (that is, the fast large angle state), the electronic device can use the noise reduction algorithm matching the first state to process the current audio signal (first audio signal), thereby improving the correction effect on the first audio signal, thereby improving the voice call quality of the electronic device.

[0013] In combination with the first aspect, in certain implementations of the first aspect, the above-mentioned determining whether the electronic device is in the first state based on the first audio signal and the second audio signal includes: obtaining a first angle based on the first audio signal and the second audio signal, the first angle referring to the angle between the electronic device and the user during a voice call; obtaining a gradient value of the first angle, the gradient value being used to characterize the difference between the first angle at a current moment and the first angle at a moment before the current moment; and determining whether the electronic device is in the first state according to the gradient value of the first angle.

[0014] The voice call method provided in the embodiment of the present application is applied to an electronic device, where the electronic device includes a first microphone and a second microphone, the main microphone is used to collect the user's voice signal, and the secondary microphone is used to collect the noise signal of the environment in which the electronic device is located, by obtaining the first audio signal and the second audio signal, and then based on the first audio signal and the second audio signal, obtaining the first angle, and then obtaining the gradient value of the first angle, and determining whether the electronic device is in a first state according to the gradient value of the first angle, if the electronic device is in the first state, using a first algorithm to perform noise reduction processing on the first audio signal to obtain a third audio signal, and outputting the third audio signal, wherein the first state refers to a state in which the duration of the electronic device moving from a first posture to a second posture is less than a first threshold value, the first posture refers to a posture in which the distance between the main microphone and the user is less than a second threshold value, and the second posture refers to a posture in which the distance between the main microphone and the user is less than a second threshold value, and the second posture refers to a posture in which the distance between the main microphone and the user is less than a second threshold value. The distance between the microphone and the user is greater than the third threshold, and in the process of moving from the first posture to the second posture, the distance between the secondary microphone and the user is less than the fourth threshold, that is, the first state refers to the fast and large-angle state, and the first algorithm refers to the noise reduction algorithm corresponding to the fast and large-angle state. That is to say, using the voice call method provided in the embodiment of the present application, when it is determined that the electronic device is in the first state through the first audio signal and the second audio signal, the first audio signal is subjected to noise reduction processing using the noise reduction algorithm corresponding to the first state to obtain the third audio signal output by the electronic device, so that in the first state (that is, the fast and large-angle state), the electronic device can use the noise reduction algorithm matching the first state to process the current audio signal (first audio signal), thereby improving the correction effect on the first audio signal, thereby improving the voice call quality of the electronic device. Furthermore, in the process of determining whether the electronic device is in the first state, the first angle is first determined based on the first audio signal and the second audio signal, and then the gradient value of the first angle is obtained, and finally, whether the electronic device is in the first state is determined based on the gradient value of the first angle. This can improve the accuracy of determining whether the electronic device is in the first state, thereby improving the accuracy of correcting the first audio signal according to the first algorithm, and further improving the effect of the third audio signal output by the electronic device, that is, improving the voice call quality of the electronic device.

[0015] In combination with the first aspect, in certain implementations of the first aspect, obtaining the first angle based on the first audio signal and the second audio signal includes: determining a first delay value based on the first audio signal and the second audio signal, where the first delay value refers to the delay value between the first audio signal and the second audio signal; and determining the first angle based on the first delay value.

[0016] The voice call method provided in the embodiment of the present application is applied to an electronic device, where the electronic device includes a first microphone and a second microphone, the main microphone is used to collect the user's voice signal, and the auxiliary microphone is used to collect the environmental noise signal, by obtaining the first audio signal and the second audio signal, and then based on the first audio signal and the second audio signal, determining the first delay value between the first audio signal and the second audio signal, and then obtaining the first angle according to the first delay value, and then obtaining the gradient value of the first angle, and determining whether the electronic device is in a first state according to the gradient value of the first angle, if the electronic device is in the first state, using a first algorithm to perform noise reduction processing on the first audio signal to obtain a third audio signal, and outputting the third audio signal, wherein the first state refers to the electronic device converting from a first posture to a second posture, and the duration of converting from the first posture to the second posture is less than a first threshold, and the first posture refers to the distance between the main microphone and the user is less than a second threshold The first state refers to a fast and wide-angle state, and the first algorithm refers to a noise reduction algorithm corresponding to the fast and wide-angle state. In other words, the method for voice call provided in an embodiment of the present application is used to determine whether the electronic device is in the first state by the delay value between the first audio signal and the second audio signal. When the electronic device is in the first state, the noise reduction algorithm corresponding to the first state is used to perform noise reduction processing on the first audio signal to obtain a third audio signal output by the electronic device, so that in the first state (i.e., the fast and wide-angle state), the electronic device can use the noise reduction algorithm matching the first state to process the first audio signal, thereby improving the correction effect on the first audio signal, thereby improving the voice call quality of the electronic device.

[0017] In combination with the first aspect, in some implementations of the first aspect, obtaining the first angle based on the first audio signal and the second audio signal includes: obtaining a first power of the first audio signal; obtaining a second power of the second audio signal; and determining the first angle based on the first power and the second power.

[0018] The voice call method provided in the embodiment of the present application is applied to an electronic device, where the electronic device includes a main microphone and a secondary microphone, the main microphone is used to collect the user's voice signal, and the secondary microphone is used to collect the noise signal of the current environment of the electronic device, by obtaining a first audio signal and a second audio signal, and then determining a first angle based on a first power of the first audio signal and a second power of the second audio signal, and then obtaining a gradient value of the first angle, and determining whether the electronic device is in a first state according to the gradient value of the first angle, if the electronic device is in the first state, using a first algorithm to perform noise reduction processing on the first audio signal to obtain a third audio signal, and outputting the third audio signal, wherein the first state refers to a state in which the duration of the electronic device moving from a first posture to a second posture is less than a first threshold value, the first posture refers to a posture in which the distance between the main microphone and the user is less than a second threshold value, and the second posture refers to a posture in which the distance between the main microphone and the user is less than a second threshold value, and the second posture refers to a posture in which the distance between the main microphone and the user is less than a second threshold value. The distance between the two is greater than the third threshold, and in the process of moving from the first posture to the second posture, the distance between the secondary microphone and the user is less than the fourth threshold, that is, the first state refers to the fast large angle state, and the first algorithm refers to the noise reduction algorithm corresponding to the fast large angle state. That is to say, using the voice call method provided in the embodiment of the present application, when determining whether the electronic device is in the first state through the delay value between the first audio signal and the second audio signal, when the electronic device is in the first state, the first audio signal is subjected to noise reduction processing using the noise reduction algorithm corresponding to the first state to obtain the third audio signal output by the electronic device, so that in the first state (that is, the fast large angle state), the electronic device can use the noise reduction algorithm matching the first state to process the first audio signal, thereby improving the correction effect on the first audio signal, thereby improving the voice call quality of the electronic device.

[0019] In combination with the first aspect, in certain implementations of the first aspect, determining whether the electronic device is in the first state based on the gradient value of the first angle includes: if the number of times the gradient value of the first angle is greater than the fifth threshold is greater than the sixth threshold, determining that the electronic device is in the first state.

[0020] The voice call method provided in the embodiment of the present application determines whether the electronic device is in the first state by determining whether the number of times the gradient value of the first angle is greater than the fifth threshold is greater than the sixth threshold. Compared with the sampling process in which the gradient value of the first angle is greater than the fifth threshold each time, the electronic device is determined to be in the first state when the number of times the gradient value of the first angle is greater than the fifth threshold is greater than the sixth threshold. This can avoid inaccurate judgment due to user jitter in a fast and large angle state, improve the accuracy of determining whether the electronic device is in the first state based on the gradient value of the first angle, thereby improving the accuracy of noise reduction processing of the first audio signal by the first algorithm in the first state, and improving the voice call quality of the electronic device.

[0021] In combination with the first aspect, in certain implementations of the first aspect, after the first audio signal is subjected to noise reduction processing using the first algorithm to obtain the third audio signal, the method further includes: after a preset time length, the first audio signal is subjected to noise reduction processing using the second algorithm to obtain a fourth audio signal, the second algorithm being a noise reduction algorithm corresponding to the second posture of the electronic device; and outputting the fourth audio signal.

[0022] The voice call method provided in the embodiments of the present application is applied to an electronic device, where the electronic device includes a main microphone and a secondary microphone, the main microphone is used to collect the user's voice signal, and the secondary microphone is used to collect the noise signal of the current environment of the electronic device. The first audio signal and the second audio signal are obtained, and then based on the first power of the first audio signal and the second power of the second audio signal, a first angle is determined, and then a gradient value of the first angle is obtained, and it is determined whether the electronic device is in a first state according to the gradient value of the first angle. If the electronic device is in the first state, a first algorithm is used to perform noise reduction processing on the first audio signal to obtain a third audio signal, and the third audio signal is output. Then, after a preset time, a second algorithm is used to perform noise reduction processing on the first audio signal to obtain a fourth audio signal, and the fourth audio signal is output. Typically, the fast large angle state is a short dynamic process, and after the fast large angle state the electronic device is usually in the large angle state, that is, the posture of the electronic device is the second posture. In an embodiment of the present application, after using the first algorithm to perform noise reduction processing on the first audio signal to obtain a third audio signal and output the third audio signal, a preset time interval is used to directly use the noise reduction algorithm corresponding to the large angle state (second state) to perform noise reduction processing on the first audio signal to obtain a fourth audio signal, thereby avoiding the process of using a complex algorithm to judge the state of the electronic device, and improving the efficiency of the electronic device in performing noise reduction processing on the first audio signal on the basis of using a matching noise reduction algorithm to perform noise reduction processing on the first audio signal.

[0023] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: if the electronic device is in a second state, using a second algorithm to perform noise reduction processing on the first audio signal to obtain a fourth audio signal, and the second state refers to a state in which the posture of the electronic device is a second posture.

[0024] In combination with the first aspect, in certain implementations of the first aspect, it also includes: if the number of times the gradient value of the first angle is greater than the fifth threshold is less than or equal to the sixth threshold, determining whether the first angle at the current moment is greater than the seventh threshold, the first angle refers to the angle between the electronic device and the user during a voice call, and the gradient value of the first angle is used to characterize the difference between the first angle at the current moment and the first angle at the previous moment; if the first angle at the current moment is greater than the seventh threshold, the electronic device is in the second state.

[0025] The method for voice call provided in the embodiments of the present application is applied to an electronic device, where the electronic device includes a first microphone and a second microphone, the main microphone is used to collect the user's voice signal, and the secondary microphone is used to collect the noise signal of the environment in which the electronic device is located. The first audio signal and the second audio signal are obtained, and then the state of the electronic device is determined based on the first audio signal and the second audio signal. If the electronic device is in the first state, the first audio signal is subjected to noise reduction processing using a first algorithm to obtain a third audio signal, and the third audio signal is output. If the electronic device is in the second state, the first audio signal is subjected to noise reduction processing using a second algorithm to obtain a fourth audio signal, and the fourth audio signal is output. Among them, the first state refers to a state in which the time duration for the electronic device to move from a first posture to a second posture is less than a first threshold value, the first posture refers to a posture in which the distance between the main microphone and the user is less than a second threshold value, the second posture refers to a posture in which the distance between the main microphone and the user is greater than a third threshold value, and in the process of moving from the first posture to the second posture, the distance between the secondary microphone and the user is less than a fourth threshold value, that is, the first state refers to a fast large angle state, and the second state refers to a state in which the posture of the electronic device is the second posture, that is, a large angle state. In an embodiment of the present application, when the electronic device is in different states, the first audio signal is processed by a noise reduction algorithm that matches the current state of the electronic device, thereby improving the accuracy of correcting the first audio signal, thereby making the accuracy of the corrected audio signal higher, and improving the quality of the voice call.

[0026] In combination with the first aspect, in some implementations of the first aspect, it also includes: if the electronic device is in a third state, using a third algorithm to perform noise reduction processing on the first audio signal to obtain a fifth audio signal, and the third state refers to a state in which the posture of the electronic device is the first posture; outputting the fifth audio signal.

[0027] In combination with the first aspect, in some implementations of the first aspect, it also includes: if the first angle at the current moment is less than or equal to a seventh threshold, the electronic device is in a third state.

[0028] The method for voice call provided in an embodiment of the present application is applied to an electronic device, where the electronic device includes a first microphone (equivalent to a main microphone) and a second microphone (equivalent to a secondary microphone), the main microphone is used to collect a user's voice signal, and the secondary microphone is used to collect a noise signal of an environment in which the electronic device is located, and the state of the electronic device is determined based on the first audio signal and the second audio signal by acquiring a first audio signal and a second audio signal; if the electronic device is in the first state, a first algorithm is used to perform noise reduction processing on the first audio signal to obtain a third audio signal, and the third audio signal is output; if the electronic device is in the third state, a third algorithm is used to perform noise reduction processing on the first audio signal to obtain a fifth audio signal, and the fifth audio signal is output. Among them, the first state refers to a state in which the time duration for the electronic device to move from a first posture to a second posture is less than a first threshold value, the first posture refers to a posture in which the distance between the main microphone and the user is less than a second threshold value, the second posture refers to a posture in which the distance between the main microphone and the user is greater than a third threshold value, and in the process of moving from the first posture to the second posture, the distance between the secondary microphone and the user is less than a fourth threshold value, that is, the first state refers to a fast large angle state, and the third state refers to a state in which the posture of the electronic device is the first posture, that is, a normal voice call state. In an embodiment of the present application, when the electronic device is in different states, the first audio signal is processed by a noise reduction algorithm that matches the current state of the electronic device, thereby improving the accuracy of correcting the first audio signal, thereby making the accuracy of the corrected audio signal higher, and improving the quality of the voice call.

[0029] In a second aspect, a device for voice communication is provided, comprising a unit for executing any one of the methods in the first aspect. The device may be a server, a terminal device, or a chip in a terminal device. The device may include an input unit and a processing unit.

[0030] When the device is a terminal device, the processing unit may be a processor, and the input unit may be a communication interface; the terminal device may also include a memory, which is used to store computer program code. When the processor executes the computer program code stored in the memory, the terminal device executes any one of the methods in the first aspect.

[0031] When the device is a chip in a terminal device, the processing unit may be a processing unit inside the chip, and the input unit may be an output interface, a pin or a circuit, etc.; the chip may also include a memory, which may be a memory inside the chip (for example, a register, a cache, etc.) or a memory located outside the chip (for example, a read-only memory, a random access memory, etc.); the memory is used to store computer program code, and when the processor executes the computer program code stored in the memory, the chip executes any one of the methods in the first aspect.

[0032] In one possible implementation, a memory is used to store computer program codes; a processor executes the computer program codes stored in the memory, and when the computer program codes stored in the memory are executed, the processor is used to execute: obtaining a first audio signal and a second audio signal, the first audio signal being an audio signal collected by a first microphone, and the second audio signal being an audio signal collected by a second microphone; determining whether the electronic device is in a first state based on the first audio signal and the second audio signal, the first state refers to a state in which the duration of the electronic device moving from a first posture to a second posture is less than a first threshold, wherein the first posture refers to a posture in which the distance between the first microphone and the user's mouth is less than a second threshold, the second posture refers to a posture in which the distance between the first microphone and the user's mouth is greater than a third threshold, and in the process of moving from the first posture to the second posture, the distance between the second microphone and the user's mouth is less than a fourth threshold; if the electronic device is in the first state, using a first algorithm to perform noise reduction processing on the first audio signal to obtain a third audio signal; and outputting the third audio signal.

[0033] According to a third aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program code. When the computer program code is executed by a voice call device, the voice call device executes any one of the voice call methods according to the first aspect.

[0034] In a fourth aspect, a computer program product is provided, the computer program product comprising: a computer program code, when the computer program code is executed by a voice call device, the voice call device executes any one of the device methods in the first aspect.

[0035] The embodiments of the present application provide a method and electronic device for voice calls, wherein the electronic device includes a first microphone and a second microphone, the first microphone is used to collect a user's voice signal, and the second microphone is used to collect a noise signal of an environment in which the electronic device is located, by obtaining a first audio signal and a second audio signal, and then determining whether the electronic device is in a first state based on the first audio signal and the second audio signal, if the electronic device is in the first state, using a first algorithm to perform noise reduction processing on the first audio signal to obtain a third audio signal, and outputting the third audio signal, wherein the first state refers to a state in which the duration of the electronic device moving from a first posture to a second posture is less than a first threshold, the first posture refers to a posture in which the distance between the main microphone and the user is less than a second threshold, and the second posture refers to a posture in which the distance between the first microphone and the user is greater than a third threshold. Threshold position, and in the process of moving from the first position to the second position, the distance between the second microphone and the user is less than the fourth threshold, that is, the first state refers to the fast large angle state, and the first algorithm refers to the noise reduction algorithm corresponding to the fast large angle state. That is to say, using the voice call method provided in the embodiment of the present application, when it is determined that the electronic device is in the first state through the first audio signal and the second audio signal, the first audio signal is subjected to noise reduction processing using the noise reduction algorithm corresponding to the first state to obtain a third audio signal output by the electronic device, so that in the first state (that is, the fast large angle state), the electronic device can use the noise reduction algorithm matching the first state to process the current audio signal (first audio signal), thereby improving the correction effect on the first audio signal, thereby improving the voice call quality of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a schematic diagram of the posture of a mobile phone;

[0037] Figure 2 It is a schematic diagram of speech signal damage in a fast and large angle state;

[0038] Figure 3 is a schematic diagram of a hardware system of an electronic device applicable to the present application;

[0039] Figure 4 is a schematic diagram of a software system for an electronic device applicable to the present application;

[0040] Figure 5 It is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0041] Figure 6 It is a flowchart of a method for voice communication provided by an embodiment of the present application;

[0042] Figure 7 It is a schematic diagram from a first angle;

[0043] Figure 8 It is a flowchart of another voice call method provided by an embodiment of the present application;

[0044] Fig. 9 is a schematic diagram of calculating a first angle based on a first delay value;

[0045] Fig.10 It is a flowchart of another voice call method provided by an embodiment of the present application;

[0046] Fig.11 It is a flowchart of another voice call method provided by an embodiment of the present application;

[0047] Fig.12 It is a flowchart of another voice call method provided by an embodiment of the present application;

[0048] Fig.13 It is a flowchart of another voice call method provided by an embodiment of the present application;

[0049] Fig.14 It is a schematic diagram of a voice call device provided by the present application;

[0050] Fig.15 It is a schematic diagram of an electronic device for voice calls provided by the present application. DETAILED DESCRIPTION

[0051] 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. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0052] In the following, the terms "first", "second", and "third" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", and "third" may explicitly or implicitly include one or more of the features.

[0053] At present, electronic devices (such as mobile phones) are usually equipped with multiple microphones. Among them, the microphone installed at the bottom of the electronic device and close to the user's mouth is called the main microphone, which is used to collect the user's voice signal; the microphone installed in other areas of the electronic device is called the secondary microphone, which is used to collect environmental noise.

[0054] For example, when a user makes a voice call through a mobile phone, when the mobile phone is in the first posture state, the distance between the main microphone and the user's mouth is X cm, and X is less than the first threshold, and the distance between the secondary microphone and the user is Y cm. Figure 1 As shown in (a) in the figure. When the electronic device changes from the first posture state to the second posture state, the distance between the main microphone and the user's mouth increases, and the distance between the auxiliary microphone and the user's mouth remains unchanged. That is, the second posture state means that the distance between the main microphone and the user's mouth increases to (X+D) cm, and D is greater than the second threshold, and the distance between the auxiliary microphone and the user remains basically unchanged, still Y cm, as shown in Figure 1 As shown in (b) in the figure. In this case, since the distance between the main microphone and the user's mouth increases, the distance between the secondary microphone and the user remains unchanged, which will cause the sound data collected by the main microphone to become weaker, while the environmental noise collected by the secondary microphone remains unchanged, resulting in a smaller difference in the signal-to-noise ratio of the main microphone and the signal-to-noise ratio of the secondary microphone. In this case, the electronic device usually uses a preset noise reduction algorithm to process the sound signal collected by the main microphone to obtain an audio signal with higher call quality. However, when the posture of the electronic device quickly changes from the first posture state to the second posture state, since the sound data collected by the main microphone quickly weakens, while the environmental noise collected by the secondary microphone remains unchanged, this will cause the signal-to-noise ratio of the main microphone of the electronic device and the signal-to-noise ratio of the secondary microphone to quickly become smaller, thereby reducing the noise reduction effect of the dual-microphone noise reduction algorithm based on the difference in the signal-to-noise ratio of the main microphone and the signal-to-noise ratio of the secondary microphone, affecting the voice call quality of the electronic device.

[0055] For example, Figure 2 As shown, between 18.5 seconds and 19 seconds, and between 21 seconds and 22 seconds, the user adjusted the mobile phone from the first position to the second position. During these two time periods, the voice signal was damaged, resulting in no voice signal output from the mobile phone during these two time periods.

[0056] In view of this, an embodiment of the present application provides a method for voice call, which is applied to an electronic device, where the electronic device includes a first microphone and a second microphone, the first microphone is used to collect a user's voice signal, and the second microphone is used to collect a noise signal of an environment in which the electronic device is located, and by acquiring a first audio signal and a second audio signal, it is determined whether the electronic device is in a first state based on the first audio signal and the second audio signal; if the electronic device is in the first state, a first algorithm is used to perform noise reduction processing on the first audio signal to obtain a third audio signal, and the third audio signal is output, wherein the first state refers to a state in which the time duration for the electronic device to move from a first posture to a second posture is less than a first threshold value, the first posture refers to a posture in which the distance between the main microphone and the user is less than a second threshold value, and the second posture refers to a posture in which the distance between the first microphone and the user is less than a second threshold value. In the embodiment of the present invention, when the distance between the first microphone and the user is greater than the third threshold value, and in the process of moving from the first posture to the second posture, the distance between the second microphone and the user is less than the fourth threshold value, that is, the first state refers to the fast large angle state, and the first algorithm refers to the noise reduction algorithm corresponding to the fast large angle state. In other words, using the voice call method provided in the embodiment of the present application, when it is determined that the electronic device is in the first state through the first audio signal and the second audio signal, the first audio signal is subjected to noise reduction processing using the noise reduction algorithm corresponding to the first state to obtain the third audio signal output by the electronic device, so that in the first state (that is, the fast large angle state), the electronic device can use the noise reduction algorithm matching the first state to process the current audio signal (first audio signal), thereby improving the correction effect on the first audio signal, thereby improving the voice call quality of the electronic device.

[0057] To facilitate understanding, some of the examples given are provided for reference to the description of concepts related to the embodiments of the present application.

[0058] 1. Large opening angle state

[0059] When the angle between the phone and the user's face is greater than the preset angle threshold, the distance between the main microphone and the user's mouth is larger, while the distance between the secondary microphone and the user is smaller, that is, the angle between the phone and the face is larger. This state is called a wide angle state. When the phone is in a wide angle state, the sound signal collected by the main microphone is usually small, and the noise signal collected by the secondary microphone remains unchanged, so the signal-to-noise ratio of the electronic device is low.

[0060] 2. Fast and wide angle state

[0061] In one possible case, the mobile phone switches from the normal state (i.e., the state where the distance between the main microphone and the user's mouth is small) to the wide-angle state in a short time, and this state is called the fast wide-angle state. It should be understood that, unlike the wide-angle state, the fast wide-angle state usually refers to a dynamic state, that is, the dynamic process of the mobile phone switching from the normal state to the wide-angle state.

[0062] The method for voice call provided in the embodiment of the present application can be applied to electronic devices. Optionally, the electronic device includes a terminal device, which can also be called a terminal, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The terminal device can be a mobile phone, a smart TV, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. The embodiment of the present application does not limit the specific technology and specific device form adopted by the terminal device.

[0063] For example, Figure 3 1 shows a schematic diagram of the structure of the electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0064] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0065] 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 processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0066] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0067] 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.

[0068] 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.

[0069] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.

[0070] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0071] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

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

[0073] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device 100 through the power management module 141.

[0074] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0075] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0076] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0077] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0078] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 may also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc. The microphone usually used to collect sound signals is called the main microphone, and the microphone used to collect noise signals so that the electronic device can perform noise reduction processing based on the noise signal is called the secondary microphone.

[0079] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0080] It should be noted that any electronic device mentioned in the embodiments of the present application may include more or fewer modules in the electronic device 100.

[0081] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.

[0082] Figure 4 It is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.

[0083] The layered architecture of the electronic device 100 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, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer.

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

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

[0086] 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.

[0087] like Figure 4 As 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.

[0088] 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.

[0089] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0090] 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.

[0091] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).

[0092] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0093] 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.

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

[0095] 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.

[0096] 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.

[0097] 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.

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

[0099] 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 and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0100] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

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

[0102] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, sensor driver, Wi-Fi driver, etc.

[0103] It should be noted that the electronic device mentioned in the embodiments of the present application may include more or fewer modules in the above-mentioned electronic device.

[0104] The application scenarios provided by the embodiments of the present application are described below with reference to the accompanying drawings.

[0105] Figure 5 Schematic diagram of an application scenario of the method for voice calling provided in an embodiment of the present application. When a user holds a mobile phone 100 to make a voice call, the distance between the main microphone 110A arranged at the bottom of the mobile phone 100 and the user's mouth is small. For example, at time T0, the distance between the main microphone 110A and the user's mouth is Xcm, and the distance between the secondary microphone 120A arranged at the top of the mobile phone 100 and the user's mouth is Ycm. Figure 5As shown in (a) of FIG. 1 , the mobile phone 100 is in a normal state. When the user adjusts the holding posture, the distance between the main microphone 110A and the user's mouth increases rapidly, for example, Figure 5 As shown in (b), at time T1, that is, starting from time T0 and after a duration of Δt, the distance between the main microphone 110A and the user's mouth is (X+D) cm, while the distance between the secondary microphone 120A and the user's mouth is still Y cm. Among them, Δt is a value less than the duration threshold, that is, the mobile phone 100 is in a fast and wide-angle state. The voice call method provided in an embodiment of the present application performs noise reduction processing on the audio signal collected by the main microphone 110A within the above-mentioned Δt time period, which can improve the voice call quality of the mobile phone 100 in a fast and wide-angle state.

[0106] It should be understood that the above is an example of an application scenario and does not limit the application scenario of the present application.

[0107] Combine the following Figures 6 to 13 The method for voice communication provided in the embodiment of the present application is described in detail.

[0108] Figure 6 A flow chart of a method for voice communication provided in an embodiment of the present application is provided. The method is applied to an electronic device, wherein the electronic device includes a first microphone (equivalent to a main microphone) and a second microphone (equivalent to a secondary microphone). The main microphone is used to collect a user's voice signal, and the secondary microphone is used to collect a noise signal in the environment in which the electronic device is located. Figure 6 As shown, the method includes:

[0109] S101: Acquire a first audio signal and a second audio signal.

[0110] The first audio signal is an audio signal collected by the main microphone, and the second audio signal is an audio signal collected by the auxiliary microphone.

[0111] Since the main microphone is usually used to collect the user's voice signal, the first audio signal usually refers to the user's voice signal. In particular, during a voice call, the first audio signal usually refers to the voice signal emitted by the user during the voice call.

[0112] Since the secondary microphone is usually used to collect environmental noise signals, the second audio signal usually refers to the environmental noise signal. During a voice call, the second audio signal usually refers to the environmental noise during the user's voice call.

[0113] S102: Acquire a first angle based on the first audio signal and the second audio signal.

[0114] The first angle refers to the angle between the electronic device and the user during a voice call. For example, the electronic device may be a mobile phone. For ease of understanding, the following description is made by taking the electronic device as a mobile phone as an example.

[0115] It should be understood that during a voice call, the mobile phone is usually held by the user and placed next to the user's face. The angle between the mobile phone and the user's face is the first angle. For example, Figure 7 As shown, the angle θ between the mobile phone and the user's face is the first angle.

[0116] It should be understood that the first angle will usually change as the user moves the phone. Figure 5 As shown, at time T0 and time T1, the first angle changes as the mobile phone moves.

[0117] In a possible case, the first angle may be determined according to a signal energy difference between the first audio signal and the second audio signal.

[0118] In a possible case, the first angle may be determined according to a signal delay between the first audio signal and the second audio signal.

[0119] S103: Obtain a gradient value of a first angle.

[0120] The gradient value of the first angle is used to represent the difference between the first angle at the current moment and the first angle at the previous moment.

[0121] It should be understood that the first angle usually changes as the user moves the mobile phone. When the user moves the mobile phone from a position close to the face to a position far from the face, the first angle changes accordingly.

[0122] The mobile phone may obtain the first angle according to a preset sampling frequency. For example, after obtaining the first angle at time T0, the mobile phone may obtain the first angle at the next time (for example, time T1) indicated by the preset sampling frequency. Then, the first angle at time T0 is subtracted from the first angle at time T1 to obtain the gradient value of the first angle at time T1.

[0123] S104: Determine whether the electronic device is in a first state according to the gradient value of the first angle.

[0124] Among them, the first state refers to the state in which the time duration for the mobile phone to move from the first posture to the second posture is less than the first threshold, wherein the first posture refers to the posture in which the distance between the main microphone and the user is less than the second threshold, and the second posture refers to the posture in which the distance between the main microphone and the user is greater than the third threshold, and in the process of moving from the first posture to the second posture, the distance between the secondary microphone and the user is less than the fourth threshold.

[0125] For example, the first posture may refer to the posture of the mobile phone when the user places the mobile phone next to the mouth for a call, such as Figure 5 The second posture may refer to the posture of the mobile phone when the user rotates the mobile phone outward and rotates the main microphone of the mobile phone away from the user's mouth, such as Figure 5 As shown in (b) in .

[0126] Among them, the main microphone is used to collect the user's voice signal and is usually set at the bottom of the mobile phone. The secondary microphone is suitable for collecting environmental noise signals and is usually set at the top of the mobile phone. In other words, the first state refers to the state in which the mobile phone is rotated quickly away from the user's mouth with the user's ear as the center of the circle, which is equivalent to the first angle rapidly increasing.

[0127] In this case, determining whether the electronic device is in the first state based on the gradient value of the first angle can be to determine whether the number of gradient values ​​of the first angle greater than the threshold within a preset time length (ie, the first threshold) meets the requirement.

[0128] For example, if the gradient value of the first angle obtained each time within a preset time period is greater than a preset gradient threshold, the electronic device (mobile phone) is in the first state.

[0129] For another example, within a preset duration (the duration indicated by the first threshold), a total of N gradient values ​​of the first angle are obtained, wherein (N-2) gradient values ​​of the first angle are greater than the preset gradient threshold. That is, only 2 gradient values ​​of the first angle do not exceed the threshold. Then the electronic device (mobile phone) is in the first state.

[0130] If the electronic device is in the first state, S105 is executed.

[0131] S105: Use a first algorithm to perform noise reduction processing on the first audio signal to obtain a third audio signal.

[0132] The first algorithm refers to the noise reduction algorithm corresponding to the first state, that is, the noise reduction algorithm corresponding to the fast and large aperture angle state.

[0133] When the mobile phone is in a normal state and a wide-angle state, the mobile phone has a corresponding noise reduction algorithm to process the first audio signal. Among them, for the fast wide-angle state, the mobile phone can adjust the noise reduction parameters to obtain a noise reduction algorithm suitable for the fast wide-angle state, that is, the first algorithm.

[0134] Exemplarily, the noise reduction algorithm corresponding to the large aperture angle state may be weighted using a preset weighting factor to obtain a noise reduction algorithm corresponding to the fast large aperture angle state, that is, the first algorithm.

[0135] S106: Output a third audio signal.

[0136] The voice call method provided in the embodiment of the present application is applied to an electronic device, where the electronic device includes a first microphone (equivalent to a main microphone) and a second microphone (equivalent to a secondary microphone), the main microphone is used to collect a user's voice signal, and the secondary microphone is used to collect a noise signal of an environment in which the electronic device is located, by acquiring a first audio signal and a second audio signal, and then based on the first audio signal and the second audio signal, acquiring a first angle, and then acquiring a gradient value of the first angle, and determining whether the electronic device is in a first state according to the gradient value of the first angle, if the electronic device is in the first state, performing noise reduction processing on the first audio signal using a first algorithm to obtain a third audio signal, and outputting the third audio signal, wherein the first state refers to a state in which the duration of the electronic device moving from a first posture to a second posture is less than a first threshold value, and the first posture refers to a posture in which the distance between the main microphone and the user is less than a second threshold value, The second posture refers to a posture in which the distance between the main microphone and the user is greater than the third threshold, and in the process of moving from the first posture to the second posture, the distance between the secondary microphone and the user is less than the fourth threshold, that is, the first state refers to a fast and large-angle state, and the first algorithm refers to a noise reduction algorithm corresponding to the fast and large-angle state. That is to say, using the voice call method provided in an embodiment of the present application, when it is determined that the electronic device is in the first state through the first audio signal and the second audio signal, the first audio signal is subjected to noise reduction processing using the noise reduction algorithm corresponding to the first state to obtain a third audio signal output by the electronic device, so that in the first state (that is, the fast and large-angle state), the electronic device can use the noise reduction algorithm matching the first state to process the current audio signal (first audio signal), thereby improving the correction effect on the first audio signal, and thereby improving the voice call quality of the electronic device. Furthermore, in the process of determining whether the electronic device is in the first state, the first angle is first determined based on the first audio signal and the second audio signal, and then the gradient value of the first angle is obtained, and finally, whether the electronic device is in the first state is determined based on the gradient value of the first angle. This can improve the accuracy of determining whether the electronic device is in the first state, thereby improving the accuracy of correcting the first audio signal according to the first algorithm, and further improving the effect of the third audio signal output by the electronic device, that is, improving the voice call quality of the electronic device.

[0137] In one possible case, the electronic device can determine the angle between the mobile phone and the face according to the signal correlation between the first audio signal and the second audio signal. Exemplarily, the electronic device can use the generalized cross-correlation phase transformation (GCC-PHAT) method in the direction of arrival (DOA) estimation to determine the angle between the mobile phone and the face, that is, the first angle. Figure 8 and Fig. 9 The illustrated embodiment is described in detail.

[0138] Figure 8 A flow chart of another voice call method provided in an embodiment of the present application, the method is applied to an electronic device, the electronic device includes a first microphone (equivalent to a main microphone) and a second microphone (equivalent to a secondary microphone), the main microphone is used to collect a user's voice signal, and the secondary microphone is used to collect an environmental noise signal, the method includes:

[0139] S201: Acquire a first audio signal and a second audio signal.

[0140] The first audio signal refers to the audio signal collected by the main microphone, and the second audio signal refers to the audio signal collected by the auxiliary microphone.

[0141] The specific implementation method of S201 is similar to that of S101 and will not be repeated here.

[0142] S202: Determine a first delay value according to the first audio signal and the second audio signal.

[0143] The first delay value refers to the delay value between the audio signal collected by the main microphone and the audio signal collected by the auxiliary microphone.

[0144] For example, a generalized cross-correlation phase transformation (GCC-PHAT) method in DOA estimation may be used to determine a delay value between the first audio signal and the second audio signal, and then the first angle may be determined according to the delay value.

[0145] When determining the delay value between the first audio signal and the second audio signal, a cross-correlation function between the first audio signal and the second audio signal may be determined first, and then the delay value between the first audio signal and the second audio signal may be obtained according to the cross-correlation function between the first audio signal and the second audio signal.

[0146] Exemplarily, the cross-correlation function between the first audio signal and the second audio signal is obtained by formula (1): Wherein, formula (1) is:

[0147]

[0148] Among them, IDFT means Fourier transform, X a represents the first audio signal after Fourier transform, X brepresents the second audio signal after Fourier transform, t represents the time used for sampling the first audio signal and the second audio signal, which can usually be represented by the number of frames, f represents the frequency of the first audio signal and the second audio signal, and * represents taking the conjugate.

[0149] It should be understood that the first audio signal and the second audio signal undergo the same Fourier transform, that is, undergo the same number of Fourier transform points, and obtain the same number of Fourier transform results. When the GCC-PHAT algorithm is used to calculate in the frequency domain, the frequency point of the first audio signal after the Fourier transform and the frequency point of the second audio signal after the Fourier transform are the same frequency point, that is, the above-mentioned f.

[0150] Then, according to the cross-correlation function between the first audio signal and the second audio signal The delay value (first delay value) between the first audio signal and the second audio signal is obtained by using formula (2): Wherein formula (2) is:

[0151]

[0152] S203: Determine a first angle based on the first delay value.

[0153] The first angle refers to the angle between the electronic device and the user during a voice call.

[0154] Taking a user making a voice call through a mobile phone as an example, the first angle may indicate the angle between the face and the mobile phone. The first angle θ between the face and the mobile phone may be determined based on the first delay value and the distance between the main microphone and the secondary microphone. For example, Fig. 9 As shown, the first angle θ can be The straight-line distance d between the main wheat and the auxiliary wheat is obtained by formula (3). Wherein, formula (3) is:

[0155]

[0156] Where θ represents the first angle, represents the first delay value, and d represents the straight-line distance between the main microphone and the auxiliary microphone.

[0157] Since the sound source received by the main microphone and the auxiliary microphone is the same, the angle between the main microphone and the face is the same as the angle between the auxiliary microphone and the face, which is θ. Therefore, if the lengths of the two sides of the triangle are known, the first angle θ can be obtained by the trigonometric formula.

[0158] S204: Obtain a gradient value of a first angle.

[0159] The gradient value of the first angle refers to the difference between the first angle at the current moment and the first angle at the previous moment before the current moment.

[0160] S205: Determine whether the electronic device is in the first state according to the gradient value of the first angle.

[0161] Among them, the first state refers to the mobile phone converting from the first posture to the second posture, and the time duration from the first posture to the second posture is less than the first threshold, wherein the first posture refers to the posture in which the distance between the main microphone and the user is less than the second threshold, and the second posture refers to the posture in which the distance between the main microphone and the user is greater than the third threshold, and when converting from the first posture to the second posture, the change value of the distance between the secondary microphone and the user is less than the fourth threshold.

[0162] For example, the first posture may refer to the posture of the mobile phone when the user places the mobile phone next to the mouth for a call, such as Figure 5 The second posture may refer to the posture of the mobile phone when the user rotates the mobile phone outward and rotates the main microphone of the mobile phone away from the user's mouth, such as Figure 5 The first state may refer to a state where the mobile phone is rapidly rotated with the user's ear as the center to a state away from the user's mouth, which is equivalent to the first angle rapidly increasing.

[0163] Exemplarily, the gradient value of the first angle can be expressed by formula (4), wherein Δθ represents the increasing gradient of the first angle, θ represents the first angle at the current moment, and θpre represents the first angle at the previous moment.

[0164] Δθ=θ-θ pre Formula (4);

[0165] If the mobile phone is in a fast wide angle state, the first angle will increase significantly, that is, the gradient value of the first angle will be continuously greater than the preset threshold. Therefore, for example, the following code can be used to determine whether the mobile phone is in a fast wide angle state (ie, the first state).

[0166]

[0167] Among them, thr1 is the preset gradient threshold (ie, the fifth threshold), thr2 is the preset frame number threshold (ie, the first threshold), and state=true indicates that the current mobile phone is in a fast and large angle state (ie, the first state).

[0168] It should be understood that the above code indicates that the state of the mobile phone is determined to be the first state only when the gradient value of the first angle is greater than the preset gradient threshold each time.

[0169] In a possible case, the number of times the gradient value of the first angle is greater than the preset gradient threshold is slightly less than the number of times the first angle is detected to be greater than the preset gradient threshold, and the state of the mobile phone can also be determined as the first state.

[0170] Optionally, if the number of times that the gradient value of the first angle is greater than the fifth threshold is greater than a sixth threshold, it is determined that the electronic device is in the first state.

[0171] For example, replacing the above code "count=count" with "count=count-4" means that when detecting that the first angle is greater than the preset gradient threshold (the fifth threshold), if the number of times the gradient value of the first angle is less than the preset gradient threshold does not exceed 4 times, the state of the mobile phone can also be determined as the first state, where the sixth threshold can refer to (count-4).

[0172] If the electronic device is in the first state, execute S206.

[0173] The voice call method provided in the embodiment of the present application determines whether the electronic device is in the first state by determining whether the number of times the gradient value of the first angle is greater than the fifth threshold is greater than the sixth threshold. Compared with the sampling process in which the gradient value of the first angle is greater than the fifth threshold each time, the electronic device is determined to be in the first state when the number of times the gradient value of the first angle is greater than the fifth threshold is greater than the sixth threshold. This can avoid inaccurate judgment due to user jitter in a fast and large angle state, improve the accuracy of determining whether the electronic device is in the first state based on the gradient value of the first angle, thereby improving the accuracy of noise reduction processing of the first audio signal by the first algorithm in the first state, and improving the voice call quality of the electronic device.

[0174] S206: Use the first algorithm to perform noise reduction processing on the first audio signal to obtain a third audio signal.

[0175] The first algorithm refers to the noise reduction algorithm corresponding to the first state.

[0176] It should be understood that when the mobile phone is in a normal state and a wide-angle state, the mobile phone has a corresponding noise reduction algorithm to process the first audio signal.

[0177] Exemplarily, when the mobile phone is held normally, that is, in a normal state, there is an energy difference between the first audio signal collected by the main microphone and the second audio signal collected by the auxiliary microphone. Voice activity detection (VAD) can be performed on the main microphone and the auxiliary microphone by using the interaural level difference (ILD) between the first audio signal and the second audio signal and formula (5). Formula (5) includes:

[0178]

[0179] Wherein, t represents the number of frames sampled by the electronic device, f represents the frequency of the first audio signal, and ILDthr represents a preset energy difference threshold.

[0180] After performing voice activity detection on the main microphone and the auxiliary microphone to obtain the detection results, the mobile phone can first perform single-microphone noise estimation on the first audio signal collected by the main microphone to obtain a single-microphone noise reduction energy spectrum. For example, the minimum value update method can be used to track the noise currently collected by the mobile phone to obtain a single-microphone noise reduction energy spectrum.

[0181] For example, the following code may be used to estimate the single microphone noise of the main microphone:

[0182] If mod(t, D)==0

[0183] Pmin(t,f)=min{Ptmp(t-1,f),P(t,f)}

[0184] Ptmp(t,f)=P(t,f)

[0185] Else

[0186] Pmin(t,f)=min{Pmin(t-1,f),P(t,f)}

[0187] Ptmp(t,f)=min{Ptmp(t-1,f),P(t,f)}

[0188] End

[0189] Wherein, P(t,f) is the energy spectrum vector of the first audio signal, Pmin(t,f) is the minimum value obtained by performing minimum value tracking on the energy spectrum P(t,f) of the first audio signal, and Ptmp(t,f) is an intermediate variable. D is the preset tracking window length, and mod represents the remainder operation. The obtained Pmin(t,f) refers to the noise energy at the frequency point f, that is, the single-microphone noise reduction energy spectrum.

[0190] Then, the mobile phone performs dual-microphone noise estimation and obtains the dual-microphone noise reduction energy spectrum.

[0191] For example, the mobile phone first obtains the vector of the first audio signal, and the vector of the first audio signal is X=[X t ,…,X t-L+1 ], where X represents the vector of the first audio signal, X t represents the energy spectrum of the first audio signal at the t frame, X t-L+1 represents the energy spectrum of the first audio signal at the t-L+1th frame. The preset filter coefficient is Wt-1 =[W1,…,W L ], where W t-1 Represents the vector of preset filters, W1,…,W L The energy spectrum of the second audio signal can be expressed as D t The energy spectrum of the noise signal obtained after filtering is E t =D t -X*W t-1 Among them, E t This is the dual-microphone noise reduction energy spectrum.

[0192] When the phone is in normal state, Figure 5 As shown in (a), the single-microphone noise reduction energy Pmin(t,f) and the dual-microphone noise reduction energy spectrum E t The maximum value of is used as the noise spectrum of the first audio signal, and noise reduction processing is performed on the first audio signal according to the noise spectrum.

[0193] However, in the fast and wide angle state (i.e., the first state), voice activity detection by ILD is inaccurate, so the correlation between the main microphone and the auxiliary microphone can be used to detect voice activity, including:

[0194] First, the correlation between the first audio signal collected by the main microphone and the second audio signal collected by the auxiliary microphone is determined by formula (6). Wherein, formula (6) is:

[0195]

[0196] Wherein, Coh(t,f) represents the correlation between the first audio signal and the second audio signal, X a represents the first audio signal after Fourier transform, X b represents the second audio signal after Fourier transform, t represents the time used for sampling the first audio signal and the second audio signal, which can usually be represented by the number of frames, f represents the frequency of the first audio signal and the second audio signal, and * represents taking the conjugate.

[0197] Then, voice activity detection is performed based on the correlation between the first audio signal and the second audio signal, and, formula (7). Wherein, formula (7) is:

[0198]

[0199] Wherein, t represents the number of frames sampled by the electronic device, f represents the frequency of the first audio signal, and ILDthr represents a preset ILD threshold.

[0200] Since voice activity detection through ILD is inaccurate in the fast and large angle state (i.e., the first state), voice activity detection is performed using the correlation between the main microphone and the auxiliary microphone. Therefore, when performing dual-microphone noise estimation and obtaining the dual-microphone noise reduction energy spectrum, the obtained dual-microphone noise reduction energy spectrum needs to be corrected.

[0201] For example, a weighting factor may be used to correct the dual-microphone noise reduction energy spectrum. t1 =alpha*E t The corrected dual-microphone noise reduction energy spectrum is obtained. t1 represents the corrected dual-microphone noise reduction energy spectrum, E t It represents the initial dual-microphone noise reduction energy spectrum, that is, the dual-microphone noise reduction energy spectrum obtained after filtering by the filter. Alpha represents the weighting factor, which is usually a constant between 0 and 1.

[0202] When the mobile phone is in a fast and wide angle state (i.e., the first state), the single-microphone noise reduction energy Pmin(t,f) and the corrected dual-microphone noise reduction energy spectrum E t1 The maximum value of is used as the noise spectrum of the first audio signal, and noise reduction processing is performed on the first audio signal according to the noise spectrum.

[0203] S207: Output a third audio signal.

[0204] The voice call method provided in the embodiment of the present application is applied to an electronic device, where the electronic device includes a first microphone (equivalent to a main microphone) and a second microphone (equivalent to a secondary microphone), the main microphone is used to collect the user's voice signal, and the secondary microphone is used to collect the environmental noise signal, by obtaining the first audio signal and the second audio signal, and then based on the first audio signal and the second audio signal, determining the first delay value between the first audio signal and the second audio signal, and then obtaining the first angle according to the first delay value, and then obtaining the gradient value of the first angle, and determining whether the electronic device is in a first state according to the gradient value of the first angle, if the electronic device is in the first state, using a first algorithm to perform noise reduction processing on the first audio signal to obtain a third audio signal, and outputting the third audio signal, wherein the first state refers to the electronic device converting from a first posture to a second posture, and the duration of converting from the first posture to the second posture is less than a first threshold, and the first posture refers to the distance between the main microphone and the user. The distance is less than the second threshold, the second posture refers to the posture in which the distance between the main microphone and the user is greater than the third threshold, and when converting from the first posture to the second posture, the change value of the distance between the secondary microphone and the user is less than the fourth threshold, that is, the first state refers to the fast large angle state, and the first algorithm refers to the noise reduction algorithm corresponding to the fast large angle state. That is to say, using the voice call method provided in the embodiment of the present application, when determining whether the electronic device is in the first state through the delay value between the first audio signal and the second audio signal, when the electronic device is in the first state, the first audio signal is subjected to noise reduction processing using the noise reduction algorithm corresponding to the first state to obtain the third audio signal output by the electronic device, so that in the first state (that is, the fast large angle state), the electronic device can use the noise reduction algorithm matching the first state to process the first audio signal, thereby improving the correction effect on the first audio signal, thereby improving the voice call quality of the electronic device.

[0205] In one possible case, the electronic device can determine the angle between the mobile phone and the face, that is, the first angle, according to the signal energy difference between the first audio signal and the second audio signal. Fig.10 The illustrated embodiment is described in detail.

[0206] Fig.10 A flow chart of another voice call method provided in an embodiment of the present application is provided. The method is applied to an electronic device, the electronic device includes a main microphone and a secondary microphone, the main microphone is used to collect a user's voice signal, and the secondary microphone is used to collect an environmental noise signal. The method includes:

[0207] S301: Acquire a first audio signal and a second audio signal.

[0208] The first audio signal refers to the audio signal collected by the main microphone, and the second audio signal refers to the audio signal collected by the auxiliary microphone.

[0209] The specific implementation method of the above S301 is similar to that of S101 and will not be repeated here.

[0210] S302: Obtain a first power of a first audio signal.

[0211] S303: Obtain a second power of a second audio signal.

[0212] S304: Determine a first angle according to the first power and the second power.

[0213] The first angle refers to the angle between the electronic device and the user during a voice call.

[0214] Since the distance between the user's mouth and the main microphone is closer, and the distance between the user's mouth and the auxiliary microphone is farther, the signal power (first power) of the first audio signal is greater than the signal power (second power) of the second audio signal. When the angle between the electronic device and the user's face becomes larger, that is, the distance between the main microphone and the user becomes larger, and the auxiliary microphone remains unchanged, the energy difference between the first audio signal collected by the main microphone and the second audio signal collected by the auxiliary microphone will become smaller. Exemplarily, the first power of the first audio signal is P main , the second power of the second audio signal is P ref The energy difference ILD between the first audio signal and the second audio signal can be obtained by formula (8). Wherein, formula (8) is:

[0215]

[0216] The electronic device can obtain a first delay value between the first audio signal and the second audio signal according to the energy difference ILD between the first audio signal and the second audio signal. Then according to the first delay value The first angle θ is obtained by using the straight-line distance d between the main microphone and the auxiliary microphone and formula (3).

[0217] S305: Obtain a gradient value of a first angle.

[0218] The gradient value refers to the difference between the first angle at the current moment and the first angle at the previous moment.

[0219] S306: Determine whether the electronic device is in the first state according to the gradient value of the first angle.

[0220] Among them, the first state refers to the mobile phone converting from the first posture to the second posture, and the time duration from the first posture to the second posture is less than the first threshold, wherein the first posture refers to the posture in which the distance between the main microphone and the user is less than the second threshold, and the second posture refers to the posture in which the distance between the main microphone and the user is greater than the third threshold, and when converting from the first posture to the second posture, the change value of the distance between the secondary microphone and the user is less than the fourth threshold.

[0221] If the electronic device is in the first state, execute S307.

[0222] S307: Use the first algorithm to perform noise reduction processing on the first audio signal to obtain a third audio signal.

[0223] The first algorithm refers to the noise reduction algorithm corresponding to the first state.

[0224] The specific implementation method of the above S307 is similar to that of the above S206, and will not be repeated here.

[0225] S308: Output a third audio signal.

[0226] The voice call method provided in the embodiment of the present application is applied to an electronic device, where the electronic device includes a main microphone and a secondary microphone, the main microphone is used to collect the user's voice signal, and the secondary microphone is used to collect the noise signal of the current environment of the electronic device, by obtaining a first audio signal and a second audio signal, and then determining a first angle based on a first power of the first audio signal and a second power of the second audio signal, and then obtaining a gradient value of the first angle, and determining whether the electronic device is in a first state according to the gradient value of the first angle, if the electronic device is in the first state, using a first algorithm to perform noise reduction processing on the first audio signal to obtain a third audio signal, and outputting the third audio signal, wherein the first state refers to a state in which the duration of the electronic device moving from a first posture to a second posture is less than a first threshold value, the first posture refers to a posture in which the distance between the main microphone and the user is less than a second threshold value, and the second posture refers to a posture in which the distance between the main microphone and the user is less than a second threshold value, and the second posture refers to a posture in which the distance between the main microphone and the user is less than a second threshold value. The distance between the two is greater than the third threshold, and in the process of moving from the first posture to the second posture, the distance between the secondary microphone and the user is less than the fourth threshold, that is, the first state refers to the fast large angle state, and the first algorithm refers to the noise reduction algorithm corresponding to the fast large angle state. That is to say, using the voice call method provided in the embodiment of the present application, when determining whether the electronic device is in the first state through the delay value between the first audio signal and the second audio signal, when the electronic device is in the first state, the first audio signal is subjected to noise reduction processing using the noise reduction algorithm corresponding to the first state to obtain the third audio signal output by the electronic device, so that in the first state (that is, the fast large angle state), the electronic device can use the noise reduction algorithm matching the first state to process the first audio signal, thereby improving the correction effect on the first audio signal, thereby improving the voice call quality of the electronic device.

[0227] In one possible case, the state in which the user rotates the mobile phone is not a fast and wide angle state. In this case, the electronic device can determine the current state of the electronic device according to the gradient value of the first angle, and select an algorithm corresponding to the current state to process the first audio signal. Fig.11 The illustrated embodiment is described in detail.

[0228] Fig.11 A flow chart of another voice call method provided in an embodiment of the present application is provided. The method is applied to an electronic device, the electronic device includes a main microphone and a secondary microphone, the main microphone is used to collect a user's voice signal, and the secondary microphone is used to collect a noise signal of an environment in which the electronic device is located. The method includes:

[0229] S401: Acquire a first audio signal and a second audio signal.

[0230] The first audio signal refers to the audio signal collected by the main microphone, and the second audio signal refers to the audio signal collected by the auxiliary microphone.

[0231] S402: Acquire a first angle based on the first audio signal and the second audio signal.

[0232] The first angle refers to the angle between the electronic device and the user during a voice call.

[0233] S403: Obtain a gradient value of a first angle.

[0234] The gradient value of the first angle refers to the difference between the first angle at the current moment and the first angle at the previous moment.

[0235] S404: Determine a state of the electronic device according to the gradient value of the first angle.

[0236] If the number of times that the gradient value of the first angle is greater than the fifth threshold is greater than the sixth threshold, it is determined that the electronic device is in the first state.

[0237] If the electronic device is in the first state, execute S405.

[0238] Among them, the first state refers to a state in which the time duration for the electronic device to move from a first posture to a second posture is less than a first threshold, wherein the first posture refers to a posture in which the distance between the main microphone and the user is less than a second threshold, and the second posture refers to a posture in which the distance between the main microphone and the user is greater than a third threshold, and in the process of moving from the first posture to the second posture, the distance between the secondary microphone and the user is less than a fourth threshold.

[0239] If the electronic device is in the second state, execute S407.

[0240] The second state refers to a state in which the posture of the electronic device is the second posture, that is, the electronic device is in a large opening angle state, such as Figure 5 As shown in (b) in .

[0241] If the number of times the gradient value of the first angle is greater than the fifth threshold is less than or equal to the sixth threshold, determine whether the first angle at the current moment is greater than the seventh threshold. If the first angle at the current moment is greater than the seventh threshold, the electronic device is in the second state.

[0242] If the electronic device is in the third state, execute S409.

[0243] The third state refers to the state where the electronic device is in the first state, that is, the electronic device is in a normal voice call state, such as Figure 5 As shown in (a) in .

[0244] If the first angle at the current moment is less than or equal to the seventh threshold, the electronic device is in the third state.

[0245] S405: Use the first algorithm to perform noise reduction processing on the first audio signal to obtain a third audio signal.

[0246] The first algorithm refers to the noise reduction algorithm corresponding to the first state.

[0247] S406: Output a third audio signal.

[0248] S407: Use the second algorithm to perform noise reduction processing on the first audio signal to obtain a fourth audio signal.

[0249] The second algorithm is a noise reduction algorithm corresponding to the second state.

[0250] S408: Output a fourth audio signal.

[0251] S409: Use a third algorithm to perform noise reduction processing on the first audio signal to obtain a fifth audio signal.

[0252] Among them, the third algorithm is a noise reduction algorithm corresponding to the first posture of the electronic device.

[0253] S410: output a fifth audio signal.

[0254] The method for voice call provided in an embodiment of the present application is applied to an electronic device, where the electronic device includes a first microphone (equivalent to a main microphone) and a second microphone (equivalent to a secondary microphone), the main microphone is used to collect a user's voice signal, and the secondary microphone is used to collect a noise signal of an environment in which the electronic device is located, and the state of the electronic device is determined based on the first audio signal and the second audio signal by acquiring a first audio signal and a second audio signal; if the electronic device is in the first state, a first algorithm is used to perform noise reduction processing on the first audio signal to obtain a third audio signal, and the third audio signal is output; if the electronic device is in the second state, a second algorithm is used to perform noise reduction processing on the first audio signal to obtain a fourth audio signal, and the fourth audio signal is output; if the electronic device is in the third state, a third algorithm is used to perform noise reduction processing on the first audio signal to obtain a fifth audio signal, and the fifth audio signal is output. Among them, the first state refers to a state in which the time duration for the electronic device to move from a first posture to a second posture is less than a first threshold value, the first posture refers to a posture in which the distance between the main microphone and the user is less than a second threshold value, the second posture refers to a posture in which the distance between the main microphone and the user is greater than a third threshold value, and in the process of moving from the first posture to the second posture, the distance between the secondary microphone and the user is less than a fourth threshold value, that is, the first state refers to a fast large angle state, the second state refers to a state in which the posture of the electronic device is the second posture, that is, a large angle state, and the third state refers to a state in which the posture of the electronic device is the first posture, that is, a normal voice call state. In an embodiment of the present application, when the electronic device is in different states, the first audio signal is processed by a noise reduction algorithm that matches the current state of the electronic device, thereby improving the accuracy of correcting the first audio signal, thereby making the accuracy of the corrected audio signal higher, and improving the quality of the voice call.

[0255] Since the fast wide angle state is usually a short dynamic process, the electronic device can use the method steps shown in the above embodiment to process the audio signal during the fast wide angle state. After the fast wide angle state ends, the electronic device does not need to re-judge the state of the electronic device, and directly selects the algorithm corresponding to the wide angle state to process the audio signal. Fig.12 The illustrated embodiment is described in detail.

[0256] Fig.12 A flow chart of another voice call method provided in an embodiment of the present application is provided. The method is applied to an electronic device, the electronic device includes a main microphone and a secondary microphone, the main microphone is used to collect a user's voice signal, and the secondary microphone is used to collect a noise signal of an environment in which the electronic device is located. The method includes:

[0257] S501: Acquire a first audio signal and a second audio signal.

[0258] The first audio signal refers to the audio signal collected by the main microphone, and the second audio signal refers to the audio signal collected by the auxiliary microphone.

[0259] S502: Acquire a first angle based on the first audio signal and the second audio signal.

[0260] The first angle refers to the angle between the electronic device and the user during a voice call.

[0261] S503: Obtain a gradient value of a first angle.

[0262] The gradient value refers to the difference between the first angle at the current moment and the first angle at the previous moment.

[0263] S504: Determine whether the electronic device is in the first state according to the gradient value of the first angle.

[0264] Optionally, if the number of times that the gradient value of the first angle is greater than the fifth threshold is greater than the sixth threshold, it is determined that the electronic device is in the first state, and the noise reduction algorithm corresponding to the first state can be used to perform noise reduction processing on the first audio signal, that is, executing S505.

[0265] S505: Use the first algorithm to perform noise reduction processing on the first audio signal to obtain a third audio signal.

[0266] The first algorithm refers to the noise reduction algorithm corresponding to the first state.

[0267] S506: Output a third audio signal.

[0268] S507: After a preset time period, use a second algorithm to perform noise reduction processing on the first audio signal to obtain a fourth audio signal.

[0269] Among them, the second algorithm is a noise reduction algorithm corresponding to the second posture of the electronic device, that is, it is a noise reduction algorithm corresponding to when the electronic device is in the second state (large angle state).

[0270] S508: Output a fourth audio signal.

[0271] The voice call method provided in the embodiments of the present application is applied to an electronic device, where the electronic device includes a main microphone and a secondary microphone, the main microphone is used to collect the user's voice signal, and the secondary microphone is used to collect the noise signal of the current environment of the electronic device. The first audio signal and the second audio signal are obtained, and then based on the first power of the first audio signal and the second power of the second audio signal, a first angle is determined, and then a gradient value of the first angle is obtained, and it is determined whether the electronic device is in a first state according to the gradient value of the first angle. If the electronic device is in the first state, a first algorithm is used to perform noise reduction processing on the first audio signal to obtain a third audio signal, and the third audio signal is output. Then, after a preset time, a second algorithm is used to perform noise reduction processing on the first audio signal to obtain a fourth audio signal, and the fourth audio signal is output. Typically, the fast large angle state is a short dynamic process, and after the fast large angle state the electronic device is usually in the large angle state, that is, the posture of the electronic device is the second posture. In an embodiment of the present application, after using the first algorithm to perform noise reduction processing on the first audio signal to obtain a third audio signal and output the third audio signal, a preset time interval is used to directly use the noise reduction algorithm corresponding to the large angle state (second state) to perform noise reduction processing on the first audio signal to obtain a fourth audio signal, thereby avoiding the process of using a complex algorithm to judge the state of the electronic device, and improving the efficiency of the electronic device in performing noise reduction processing on the first audio signal on the basis of using a matching noise reduction algorithm to perform noise reduction processing on the first audio signal.

[0272] Fig.13 A flow chart of another voice call method provided in an embodiment of the present application is provided, wherein the method is applied to an electronic device, wherein the electronic device includes a plurality of microphones, wherein the plurality of microphones include a first microphone and a second microphone, wherein the first microphone is used to collect a user's voice signal, and the second microphone is used to collect a noise signal in an environment where the electronic device is located, such as Fig.13 As shown, the method includes:

[0273] S601: Acquire a first audio signal and a second audio signal.

[0274] The first audio signal refers to an audio signal collected by a first microphone, and the second audio signal refers to an audio signal collected by a second microphone.

[0275] S602: Determine whether the electronic device is in a first state based on the first audio signal and the second audio signal.

[0276] Among them, the first state refers to a state in which the time length for the electronic device to convert from a first posture to a second posture is less than a first threshold, wherein the first posture refers to a posture in which the distance between the first microphone and the user is less than a second threshold, and the second posture refers to a posture in which the distance between the first microphone and the user is greater than a third threshold, and when moving from the first posture to the second posture, the distance between the second microphone and the user is less than a fourth threshold.

[0277] If the electronic device is in the first state, S603 is executed.

[0278] S603: Use a first algorithm to perform noise reduction processing on the first audio signal to obtain a third audio signal.

[0279] The first algorithm refers to the noise reduction algorithm corresponding to the first state.

[0280] S604: Output a third audio signal.

[0281] The voice call method provided in the embodiment of the present application is applied to an electronic device, where the electronic device includes a first microphone and a second microphone, the first microphone is used to collect the user's voice signal, and the second microphone is used to collect the noise signal of the environment in which the electronic device is located, by obtaining the first audio signal and the second audio signal, and then determining whether the electronic device is in a first state based on the first audio signal and the second audio signal, if the electronic device is in the first state, using a first algorithm to perform noise reduction processing on the first audio signal to obtain a third audio signal, and outputting the third audio signal, wherein the first state refers to a state in which the duration of the electronic device moving from a first posture to a second posture is less than a first threshold, the first posture refers to a posture in which the distance between the main microphone and the user is less than a second threshold, and the second posture refers to a posture in which the distance between the first microphone and the user is greater than the third threshold. Threshold position, and in the process of moving from the first position to the second position, the distance between the second microphone and the user is less than the fourth threshold, that is, the first state refers to the fast large angle state, and the first algorithm refers to the noise reduction algorithm corresponding to the fast large angle state. That is to say, using the voice call method provided in the embodiment of the present application, when it is determined that the electronic device is in the first state through the first audio signal and the second audio signal, the first audio signal is subjected to noise reduction processing using the noise reduction algorithm corresponding to the first state to obtain a third audio signal output by the electronic device, so that in the first state (that is, the fast large angle state), the electronic device can use the noise reduction algorithm matching the first state to process the current audio signal (first audio signal), thereby improving the correction effect on the first audio signal, thereby improving the voice call quality of the electronic device.

[0282] It should be understood that, although each step in the flow chart in the above-described embodiment is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is clear explanation in this article, the execution of these steps does not have strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flow chart may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.

[0283] It is understandable that in order to implement the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.

[0284] The embodiment of the present application can divide the functional modules of the electronic device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one module. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. It should be noted that the names of the modules in the embodiment of the present application are schematic and are not limited to the names of the modules in actual implementation.

[0285] Fig.14 A schematic diagram of the structure of a voice call device provided in an embodiment of the present application.

[0286] It should be understood that the voice call apparatus 600 may perform Figures 6 to 13 The method for voice call shown; the device 600 for voice call includes: an acquisition unit 610 and a processing unit 620.

[0287] The acquisition unit 610 is used to acquire a first audio signal and a second audio signal, the first audio signal is an audio signal collected by a first microphone, and the second audio signal is an audio signal collected by a second microphone; the processing unit 620 is used to determine whether the electronic device is in a first state based on the first audio signal and the second audio signal, the first state refers to a state in which the duration of the electronic device moving from a first posture to a second posture is less than a first threshold, wherein the first posture refers to a posture in which the distance between the first microphone and the user's mouth is less than a second threshold, the second posture refers to a posture in which the distance between the first microphone and the user's mouth is greater than a third threshold, and in the process of moving from the first posture to the second posture, the distance between the second microphone and the user's mouth is less than a fourth threshold; if the electronic device is in the first state, the first algorithm is used to perform noise reduction processing on the first audio signal to obtain a third audio signal; and the third audio signal is output.

[0288] In one embodiment, the processing unit 620 is used to obtain a first angle based on a first audio signal and a second audio signal, where the first angle refers to the angle between the electronic device and the user during a voice call; obtain a gradient value of the first angle, where the gradient value is used to represent the difference between the first angle at a current moment and the first angle at a moment before the current moment; and determine whether the electronic device is in a first state based on the gradient value of the first angle.

[0289] In one embodiment, the processing unit 620 is configured to determine a first delay value according to the first audio signal and the second audio signal, where the first delay value refers to a delay value between the first audio signal and the second audio signal; and determine a first angle based on the first delay value.

[0290] In one embodiment, the processing unit 620 is configured to obtain a first power of the first audio signal; obtain a second power of the second audio signal; and determine a first angle according to the first power and the second power.

[0291] In one embodiment, the processing unit 620 is configured to determine that the electronic device is in the first state if the number of times that the gradient value of the first angle is greater than the fifth threshold is greater than a sixth threshold.

[0292] In one embodiment, the processing unit 620 is also used to use a second algorithm to perform noise reduction processing on the first audio signal after a preset time length to obtain a fourth audio signal, where the second algorithm is a noise reduction algorithm corresponding to the second posture of the electronic device; and output the fourth audio signal.

[0293] In one embodiment, the processing unit 620 is further used to perform noise reduction processing on the first audio signal using a second algorithm to obtain a fourth audio signal when the electronic device is in a second state, and the second state refers to a state in which the posture of the electronic device is a second posture.

[0294] In one embodiment, the processing unit 620 is also used to determine whether the first angle at the current moment is greater than the seventh threshold when the number of times the gradient value of the first angle is greater than the fifth threshold is less than or equal to the sixth threshold, where the first angle refers to the angle between the electronic device and the user during a voice call, and the gradient value of the first angle is used to represent the difference between the first angle at the current moment and the first angle at the moment before the current moment; if the first angle at the current moment is greater than the seventh threshold, the electronic device is in the second state.

[0295] In one embodiment, the processing unit 620 is also used to use a third algorithm to perform noise reduction processing on the first audio signal when the electronic device is in a third state to obtain a fifth audio signal, and the third state refers to a state where the posture of the electronic device is the first posture; and output the fifth audio signal.

[0296] In one embodiment, the processing unit 620 is further configured to determine that the electronic device is in the third state when the first angle at the current moment is less than or equal to a seventh threshold.

[0297] The device for voice call provided in this embodiment is used to execute the method for voice call in the above-mentioned embodiment, and its technical principle and technical effect are similar, which will not be described in detail here.

[0298] It should be noted that the above-mentioned voice call device 600 is embodied in the form of a functional unit. The term "unit" here can be implemented in the form of software and / or hardware, and is not specifically limited to this.

[0299] For example, a "unit" may be a software program, a hardware circuit, or a combination of the two that implements the above functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (e.g., a shared processor, a dedicated processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a combined logic circuit, and / or other suitable components that support the described functions.

[0300] Therefore, the units of each example described in the embodiments of the present application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

[0301] Fig.15 A structural schematic diagram of an electronic device provided by the present application is shown. Fig.15The dotted line in the figure indicates that the unit or the module is optional. The electronic device 700 can be used to implement the voice call method described in the above method embodiment.

[0302] The electronic device 700 includes one or more processors 701, which can support the electronic device 700 to implement the method of voice call in the method embodiment. The processor 701 can be a general-purpose processor or a special-purpose processor. For example, the processor 701 can be a central processing unit (CPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, such as discrete gates, transistor logic devices, or discrete hardware components.

[0303] The processor 701 may be used to control the electronic device 700, execute software programs, and process data of the software programs. The electronic device 700 may also include a communication unit 705 to implement input (reception) and output (transmission) of signals.

[0304] For example, the electronic device 700 may be a chip, the communication unit 705 may be an input and / or output circuit of the chip, or the communication unit 705 may be a communication interface of the chip, and the chip may be a component of a terminal device or other electronic devices.

[0305] For another example, the electronic device 700 may be a terminal device, and the communication unit 705 may be a transceiver of the terminal device, or the communication unit 705 may be a transceiver circuit of the terminal device.

[0306] The electronic device 700 may include one or more memories 702 on which a program 704 is stored. The program 704 can be executed by the processor 701 to generate instructions 703, so that the processor 701 executes the impedance matching method described in the above method embodiment according to the instructions 703.

[0307] Optionally, data may be stored in the memory 702. Optionally, the processor 701 may read data stored in the memory 702. The data may be stored at the same storage address as the program 704, or may be stored at a different storage address than the program 704.

[0308] The processor 701 and the memory 702 may be provided separately or integrated together; for example, integrated on a system on chip (SOC) of a terminal device.

[0309] Exemplarily, the memory 702 can be used to store a related program 704 of the voice call method provided in the embodiment of the present application, and the processor 701 can be used to call the related program 704 of the voice call method stored in the memory 702 when making a voice call, and execute the voice call method of the embodiment of the present application; including: obtaining a first audio signal and a second audio signal, the first audio signal is an audio signal collected by a first microphone, and the second audio signal is an audio signal collected by a second microphone; determining whether the electronic device is in a first state based on the first audio signal and the second audio signal, the first state refers to a state in which the duration of the electronic device moving from a first posture to a second posture is less than a first threshold, wherein the first posture refers to a posture in which the distance between the first microphone and the user's mouth is less than the second threshold, and the second posture refers to a posture in which the distance between the first microphone and the user's mouth is greater than the third threshold, and in the process of moving from the first posture to the second posture, the distance between the second microphone and the user's mouth is less than a fourth threshold; if the electronic device is in the first state, using the first algorithm to perform noise reduction processing on the first audio signal to obtain a third audio signal; outputting the third audio signal.

[0310] The present application also provides a computer program product, which, when executed by the processor 701, implements the voice call method described in any method embodiment of the present application.

[0311] The computer program product may be stored in the memory 702 , for example, a program 704 , which is converted into an executable target file that can be executed by the processor 701 after preprocessing, compiling, assembling, and linking.

[0312] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the method for voice communication described in any method embodiment of the present application is implemented. The computer program can be a high-level language program or an executable target program.

[0313] The computer-readable storage medium is, for example, a memory 702. The memory 702 may be a volatile memory or a nonvolatile memory, or the memory 702 may include both a volatile memory and a nonvolatile memory. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0314] In this application, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0315] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0316] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0317] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0318] 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 merely schematic; for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components can be combined or integrated into another system, 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.

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

[0320] 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.

[0321] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for voice communication, characterized in that: The method is applied to an electronic device, the electronic device includes a plurality of microphones, the plurality of microphones include a first microphone and a second microphone, the first microphone is located at the bottom of the electronic device, and the second microphone is located in an area other than the bottom of the electronic device, the method includes: Acquire a first audio signal and a second audio signal, wherein the first audio signal is an audio signal collected by the first microphone, and the second audio signal is an audio signal collected by the second microphone; determining whether the electronic device is in a first state based on the first audio signal and the second audio signal, the first state being a state in which the duration of the electronic device moving from a first posture to a second posture is less than a first threshold, wherein the first posture is a posture in which the distance between the first microphone and the user's mouth is less than a second threshold, the second posture is a posture in which the distance between the first microphone and the user's mouth is greater than a third threshold, and in the process of moving from the first posture to the second posture, the distance between the second microphone and the user's mouth is less than a fourth threshold; If the electronic device is in the first state, a first algorithm is used to perform noise reduction processing on the first audio signal to obtain a third audio signal; outputting the third audio signal; Wherein, determining whether the electronic device is in the first state based on the first audio signal and the second audio signal includes: Acquire a first angle based on the first audio signal and the second audio signal, where the first angle refers to an angle between the electronic device and a user during a voice call; Acquire a gradient value of the first angle according to a preset sampling frequency, where the gradient value is used to represent a difference between the first angle at a current moment and the first angle at a moment before the current moment; Whether the electronic device is in the first state is determined according to the gradient value of the first angle.

2. The method according to claim 1, characterized in that The acquiring a first angle based on the first audio signal and the second audio signal includes: Determine a first delay value according to the first audio signal and the second audio signal, wherein the first delay value refers to a delay value between the first audio signal and the second audio signal; Based on the first delay value, the first angle is determined.

3. The method according to claim 1, characterized in that The acquiring a first angle based on the first audio signal and the second audio signal includes: Acquire a first power of the first audio signal; Acquire a second power of the second audio signal; The first angle is determined according to the first power and the second power.

4. The method according to claim 1, characterized in that The determining, according to the gradient value of the first angle, whether the electronic device is in the first state comprises: If the number of times that the gradient value of the first angle is greater than the fifth threshold is greater than the sixth threshold, it is determined that the electronic device is in the first state.

5. The method according to any one of claims 1 to 4, characterized in that: After the first algorithm is used to perform noise reduction processing on the first audio signal to obtain a third audio signal, the method further includes: After a preset time, using a second algorithm to perform noise reduction processing on the first audio signal to obtain a fourth audio signal, wherein the second algorithm is a noise reduction algorithm corresponding to the second posture of the electronic device; The fourth audio signal is output.

6. The method according to any one of claims 1 to 4, characterized in that: Also includes: If the electronic device is in a second state, a second algorithm is used to perform noise reduction processing on the first audio signal to obtain a fourth audio signal, and the second state refers to a state in which the posture of the electronic device is the second posture.

7. The method according to claim 6, characterized in that Also includes: If the number of times that the gradient value of the first angle is greater than the fifth threshold is less than or equal to the sixth threshold, determining whether the first angle at the current moment is greater than the seventh threshold, the first angle refers to the angle between the electronic device and the user during a voice call, and the gradient value of the first angle is used to characterize the difference between the first angle at the current moment and the first angle at the previous moment of the current moment, and the first angle refers to the angle between the electronic device and the user during a voice call; If the first angle at the current moment is greater than the seventh threshold, the electronic device is in the second state.

8. The method according to any one of claims 1 to 4, characterized in that: Also includes: If the electronic device is in a third state, a third algorithm is used to perform noise reduction processing on the first audio signal to obtain a fifth audio signal, wherein the third state refers to a state in which the posture of the electronic device is the first posture; The fifth audio signal is output.

9. The method according to claim 8, characterized in that Also includes: If the first angle at the current moment is less than or equal to the seventh threshold, the electronic device is in the third state, and the first angle refers to the angle between the electronic device and the user during a voice call.

10. An electronic device, characterized in that: The method comprises a module for executing the method as claimed in any one of claims 1 to 9.

11. An electronic device, characterized in that: include: one or more processors and memory; The memory is coupled to the one or more processors, and the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and the one or more processors call the computer instructions to enable the electronic device to perform the method as claimed in any one of claims 1 to 9.

12. A chip system, characterized in that: The chip system is applied to an electronic device, and the chip system includes one or more processors, and the processor is used to call computer instructions so that the electronic device executes the method as described in any one of claims 1 to 9.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Voice call method and electronic device

    CN117135280B