Method for eliminating sound and electronic device for executing method

文档序号:156448 发布日期:2021-10-26 浏览:42次 中文

阅读说明:本技术 消除声音的方法及执行该方法的电子装置 (Method for eliminating sound and electronic device for executing method ) 是由 高国维 王诚德 吴柏叡 李建颖 杨国屏 于 2018-09-28 设计创作,主要内容包括:一种消除声音的方法,适用于一电子装置,其中电子装置可和一声音播放装置通过无线网络连接,且包括一麦克风。本发明的消除声音的方法包括下列步骤:通过麦克风接收第一输入声音,以取得第一输入声音信号;记录第一输入声音信号,并发送第一输入声音信号至声音播放装置;通过麦克风接收由声音播放装置根据第一输入声音信号而发出的第二输入声音,以取得第二输入声音信号;计算第一输入声音信号与第二输入声音信号产生的时间差;以及,根据该时间差及第一输入声音信号以滤除第二输入声音信号。(A method for eliminating sound is suitable for an electronic device, wherein the electronic device can be connected with a sound playing device through a wireless network and comprises a microphone. The method of eliminating sound of the present invention comprises the steps of: receiving a first input sound through a microphone to obtain a first input sound signal; recording a first input sound signal and sending the first input sound signal to a sound playing device; receiving a second input sound emitted by the sound playing device according to the first input sound signal through a microphone to obtain a second input sound signal; calculating the time difference generated by the first input sound signal and the second input sound signal; and filtering out a second input sound signal according to the time difference and the first input sound signal.)

1. A method for eliminating sound is suitable for an electronic device, and is characterized in that the electronic device can be connected with a sound playing device through a wireless network, and the method comprises the following steps:

receiving a first input sound through the microphone to obtain a first input sound signal;

recording the first input sound signal and sending the first input sound signal to the sound playing device;

receiving a second input sound played by the sound playing device through the loudspeaker according to the first input sound signal through the microphone to obtain a second input sound signal;

calculating a time difference generated by the first input sound signal and the second input sound signal; and

and filtering the second input sound signal according to the time difference and the first input sound signal.

2. The method of claim 1, wherein the electronic device is spaced from the audio playback device by less than a specific distance, such that the first input audio signal is transmitted to the audio playback device via a wireless network.

3. The method of claim 2, wherein the specified distance is 2 meters.

4. An electronic device capable of connecting with a sound playing device through a wireless network is characterized in that the sound playing device comprises a loudspeaker, and the electronic device comprises:

a microphone for receiving a first input voice to obtain a first input voice signal;

a microcontroller electrically connected to the microphone, comprising:

a control module, which records the first input sound signal and controls the first input sound signal to be sent to the sound playing device, wherein the microphone further receives a second input sound played by the sound playing device through the loudspeaker according to the first input sound signal after the first input sound signal is sent, so as to obtain a second input sound signal;

the calculation module is used for calculating a time difference generated by the first input sound signal and the second input sound signal; and

and the filtering module is used for filtering the second input sound signal according to the time difference and the first input sound signal.

5. The electronic device of claim 4, wherein the electronic device is spaced from the audio playback device by less than a specific distance, such that the first input audio signal is transmitted to the audio playback device via a wireless network.

6. The electronic device of claim 5, wherein the specific distance is 2 meters.

Technical Field

The present invention relates to a method for canceling sound and an electronic device for performing the method, and more particularly, to a method for canceling sound emitted from other devices and an electronic device for performing the method.

Background

With the gradual upgrade of the handheld devices, many video games can be executed in mobile phones or tablet computers, and due to the rapid development of network communication, many players can synchronously communicate with other players participating in the games through the network during the game. However, some players participating in the game are actually in the next place, and once one of the players wants to speak to a player located at a far distance, the voice is sent back through the handheld device of the player because the player is close to the other player, so that the same voice content is repeatedly sent and played, and the expected external sound is generated.

Therefore, there is a need for a method to solve the problems described in the previous disclosure.

Disclosure of Invention

The invention mainly aims to provide a method for eliminating sound and an electronic device for executing the method.

To achieve the above object, the method for eliminating sound disclosed by the present invention is suitable for an electronic device, wherein the electronic device can be connected to a sound playing device via a wireless network and comprises a microphone. The method for eliminating the sound comprises the following steps: receiving a first input sound through a microphone to obtain a first input sound signal; recording a first input sound signal and sending the first input sound signal to a sound playing device; receiving a second input sound emitted by the sound playing device according to the first input sound signal through a microphone to obtain a second input sound signal; calculating the time difference generated by the first input sound signal and the second input sound signal; and filtering out a second input sound signal according to the time difference and the first input sound signal.

The electronic device disclosed by the invention can be connected with a sound playing device through a wireless network, and comprises a microphone and a microcontroller. The microphone is used for receiving a first input sound to obtain a first input sound signal. The microcontroller is electrically connected with the microphone and comprises a control module, a calculation module and a filtering module. The control module is used for recording a first input sound signal and controlling the first input sound signal to be sent to the sound playing device, wherein the microphone further receives a second input sound sent by the sound playing device according to the first input sound signal after the first input sound signal is sent so as to obtain a second input sound signal. The calculation module is used for calculating the time difference generated by the first input sound signal and the second input sound signal. The filtering module is used for filtering the second input sound signal according to the time difference and the first input sound signal.

Drawings

Fig. 1 is a device architecture diagram of an electronic device according to the present invention.

FIG. 2 is a flowchart illustrating steps of a method for canceling sound according to the present invention.

Wherein the reference numerals are:

microphone 10 of electronic device 1

First communication module 20 microcontroller 30

Control module 31 calculation module 33

Filter module 35 speaker 40

Network 60 second input sound 70

Second input sound signal 71 first input sound 80

First input sound signal 81 sound playing device 90

Second communication module 91 processor 92

Horn 93

Detailed Description

In order to make the technical content of the present invention more comprehensible, preferred embodiments are described below.

Referring to fig. 1, an apparatus architecture diagram of an electronic apparatus according to the present invention is shown.

As shown in fig. 1, in an embodiment of the present invention, the electronic device 1 of the present invention can be connected to the audio playing device 90 through the network 60 via a wireless network, wherein the audio playing device 90 includes a second communication module 91, a processor 92 and a speaker 93, and the processor 92 is electrically connected to the second communication module 91 and the speaker 93. The electronic device 1 includes a microphone 10, a first communication module 20, a microcontroller 30 and a speaker 40. In the embodiment of the present invention, the electronic device 1 and the audio playing device 90 are smart phones, but the present invention is not limited thereto.

As shown in fig. 1, in an embodiment of the present invention, the microphone 10 is configured to receive sounds from the outside, including a first input sound 80 emitted by a user and a second input sound 70 generated by a sound playing device 90. After the microphone 10 receives the first input sound 80, it generates a first input sound signal 81 according to the first input sound 80, and the first input sound signal 81 is received by the microcontroller 30. Similarly, after receiving the second input sound 70, the microphone 10 generates a second input sound signal 71 according to the second input sound 70, and the second input sound signal 71 is received by the controller 30.

In an embodiment of the present invention, the first communication module 20 is used for signal connection with the second communication module 91 of the audio playing device 90, so that the electronic device 1 and the audio playing device 90 are connected through a wireless network. In the embodiment of the present invention, the first communication module 20 and the second communication module 93 are network adapters, so that the electronic device 1 and the audio playing device 90 can be connected through the network 60 and the wireless network, but the present invention is not limited thereto, and the connection between the electronic device 1 and the audio playing device 90 through the wireless network can be any conventional communication method, such as bluetooth.

In an embodiment of the present invention, the microcontroller 30 is electrically connected to the microphone 10 and the communication module 20. The microcontroller 30 includes a control module 31, a calculation module 33, and a filtering module 35. It should be noted that the modules may be configured as hardware devices, software programs, firmware, or a combination thereof, and may also be configured by circuit loops or other suitable types; moreover, the modules may be arranged in a combined manner, as well as in a single manner. In a preferred embodiment, each module is a software program stored in a memory (not shown) of the microcontroller, and the central processing unit (not shown) of the microcontroller executes each module to achieve the functions of the present invention. In addition, the present embodiment only illustrates the preferred embodiments of the present invention, and all possible combinations and modifications are not described in detail to avoid redundancy. However, one of ordinary skill in the art should appreciate that each of the above modules or elements is not necessarily required. And may include other existing modules or components in greater detail for practicing the invention. Each module or component may be omitted or modified as desired, and no other module or component may necessarily exist between any two modules.

In an embodiment of the invention, the control module 31 is used for recording the first input audio signal 81 and controlling the first input audio signal 81 to be transmitted to the audio playing device 90 through the first communication module 20. After receiving the first input audio signal 81, the audio playing apparatus 90 transmits the first input audio signal 81 to the speaker 93, and the speaker 91 generates the playing second input audio signal 70 according to the first input audio signal 81.

In an embodiment of the present invention, the calculating module 33 is used for calculating a time difference between the first input audio signal 81 and the second input audio signal 71. Since the calculating module 33 starts timing after receiving the first input audio signal 81, the calculating module 33 can calculate the time difference between the second input audio signal 71 and the first input audio signal after the microcontroller 30 obtains the time difference.

In an embodiment of the present invention, the filtering module 35 is configured to filter the second input audio signal 71 according to the time difference and the first input audio signal 81; it should be noted that the term "filtering" herein does not mean that the second input audio signal 71 is completely eliminated, and those skilled in the art should understand that the situation that a residual signal may remain due to the filtering technology limit is also included. In the embodiment, the filtering module 35 is an Adaptive Filter (Adaptive Filter), but the invention is not limited thereto. The technique of filtering the second input audio signal 71 by using the time difference and the first input audio signal 81 will be described in more detail below, and will not be described in detail herein.

In an embodiment of the present invention, the speaker 40 is electrically connected to the microcontroller 30, and the speaker 40 is used for playing a sound according to an output sound signal generated by the microcontroller 30.

Referring to fig. 1 to fig. 2, fig. 2 is a flowchart illustrating steps of a method for canceling sound according to the present invention, and the steps shown in fig. 2 will be described in sequence with reference to fig. 1. It should be noted that, although the electronic device 1 is taken as an example to describe the method for canceling sound disclosed in the present invention, the method for canceling sound of the present invention is not limited to be applied to the electronic device 1.

First, step S1 is executed: a first input sound 80 is received by the microphone 10 to obtain a first input sound signal 81.

Suppose that the user of the electronic device 1 and the user of the sound playing device 90 are using the electronic device 1 and the sound playing device 90 respectively, and connect the game with other people located at a distance through the network 60 through a wireless network, but the distance between the electronic device 1 and the sound playing device 90 is less than 2 meters. When a user of the electronic device 1 speaks into the microphone 10 to communicate with another person located at a remote location, the microphone 10 receives a first input sound 80 emitted by the user, and generates a first input sound signal 81 according to the first input sound 80, and the first input sound signal 81 is transmitted to the microcontroller 30 and received by the microcontroller 30.

Step S2 is executed: the first input sound signal 81 is recorded and the first input sound signal 81 is sent to the sound playing device 90.

In an embodiment of the present invention, the control module 31 of the microcontroller 30 records the first input audio signal 81 and controls the first input audio signal 81 to be transmitted to other devices connected to the electronic apparatus 1 through a wireless network via the first communication module 20, including the audio playing device 90.

Step S3 is executed: the second input sound 70 emitted by the sound playing device 90 according to the first input sound signal 81 is received by the microphone 10 to obtain a second input sound signal 71.

Once the audio playback device 90 receives the first input audio signal 81, the speaker 93 generates the second input audio 70 according to the first input audio signal 81 (assuming that the electronic device 1 is not using the earphone and the public address mode is turned on). Since the distance between the electronic device 1 and the audio playback device 90 is very close (less than 2 meters), the microphone 10 of the electronic device 1 receives the second input audio 70 from the speaker 93 of the audio playback device 90, and generates the second input audio signal 71 according to the second input audio 70. Similarly, the second input audio signal 71 is also transmitted to the microcontroller 30.

Step S4 is executed: the time difference between the first input sound signal 81 and the second input sound signal 71 is calculated.

Once the microcontroller 30 receives the second input audio signal 71, the calculating module 33 calculates a time difference between the first input audio signal 81 and the second input audio signal 71.

Step S5 is executed: according to the time difference generated by the first input sound signal 81 and the second input sound signal 71 and the first input sound signal 81, the second input sound signal 71 is filtered.

Since the second input sound 70 has substantially the same speech content as the first input sound 80, the microcontroller 30 of the electronic device 1 of the present invention filters the second input sound signal 71 generated according to the second input sound 70 to avoid repeated transmission and playback. After the step S4 is completed, the filtering module 35 of the microcontroller 30 estimates an estimated signal that is the same as or similar to the second input audio signal 71 according to the obtained time difference and the previously recorded first input audio signal 81, and subtracts the second input audio signal 71 from the estimated signal to filter the second input audio signal 71. In a specific implementation, the filtering module 35 of the microcontroller 30 of the present invention may be an existing adaptive filter, which is widely used for eliminating the feedback sound, and it may generate an estimation signal of the feedback sound by adjusting the weight of the filter in real time, and eliminate the feedback sound signal with the estimation signal. Generally, in order for the adaptive filter to quickly calculate the estimated signal, the adaptive filter needs to use the previous signal as the basis for estimation. In the embodiment, since the first input audio signal 81 is sent to the audio playing device 90 via the network, the time difference between the first input audio signal 81 and the second input audio signal 71 is relatively different, if the time difference between the first input audio signal 81 and the second input audio signal 71 is not calculated, the first input audio signal 81 to be utilized cannot be quickly and accurately found, and the processing unit will become very time-consuming in the calculation process, or even cannot be estimated. Therefore, in the embodiment of the present invention, the microcontroller 30 calculates and obtains the time difference between the first input audio signal 81 and the second input audio signal 71, and then finds the first input audio signal 81 according to the time difference, and then uses the first input audio signal 81 to estimate the estimation signal that is the same as or similar to the second input audio signal 71, and filters the second input audio signal 71 according to the estimation signal. Since the technology of estimating the signal input later by using the previous signal is a conventional sound signal cancellation technology, and is well known to those skilled in the art, and the related technical principle is also dispersed in many documents, it is not repeated herein.

The present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof, and it should be understood that various changes and modifications can be effected therein by one skilled in the art without departing from the spirit and scope of the invention as defined in the appended claims.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:音频数据处理方法和装置、电子设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!