Background technology
Using wired and during wireless telecommunication system, the time regular meeting hear echo, echo causes the communication speech quality to reduce.Echo is actually through after the certain time-delay, the sound after handling by variable filter.Improve voice quality, just must in the voice transfer process, carry out the processing that echo is eliminated.Echo produces principle by it, is divided into electric echo and acoustic echo.At public switch telephone network (PSTN, PublicSwitched Telephone Network) in since " two-four lines " of transducer mix the impedance that causes do not match caused received signal sub-fraction " leakage " to transmit path, far-end has returned a part of signal again in received signal like this, therefore the speaker hears the echo of oneself speaking, cause electric echo, be also referred to as and mix echo.Be derived from the sound wave of receiver, reflect the microphone that enters mobile phone, just form acoustic echo by the solid that is positioned on the voice path.
In line communication system, receiving terminal both can produce electric echo, also can produce acoustic echo, but because the distance between receiver and the microphone is far away slightly, thus acoustic echo relatively a little less than, compare and can ignore with electric echo.
In wireless telecommunication system, owing to do not exist " two-four lines " in the PSTN network to mix, therefore, wireless device can not produce electric echo; But, because the regulation of radio telephone official standard is not deferred to by a lot of radio telephone manufacturers: should have appropriate quarantine measures between mobile phone receiver and microphone, the result makes acoustic echo become wireless service provider to need matters of care badly because the distance between mobile phone receiver and the microphone is very short.
In addition, the voice compression technique of wireless network and the compression algorithm of non-linear voice have been introduced long processing delay time, and round-trip delay is the time that reecho spends, if round-trip delay is above 10 milliseconds, people's ear will be noticed the existence of echo, causes voice quality to descend.And voice compression technique makes round-trip delay greater than 200 milliseconds, and therefore in wireless application, acoustic echo problem is more obvious.
Fig. 1 is the echo schematic diagram that produces in the mobile communication system, has illustrated acoustic echo and electric echo among the figure simultaneously.As shown in Figure 1, the echo that landline telephone is eavesdropped is the acoustic echo that the mobile phone side produces, and the echo that mobile phone is eavesdropped mainly is an electric echo.
Echo Canceller is a kind of at the device that detects and eliminate its echo from the signal of far-end after local side equipment echos.Owing to become simple linear relationship between electric echo and the source voice signal, so the electric echo arrester comprises two major function assemblies usually: sef-adapting filter and subtracter.Concrete processing procedure is as follows: sef-adapting filter monitors RX path and Mathematical Modeling that produces circuit at echo of dynamic construction, voice flow on this circuit model and the RX path carries out convolution, obtain the estimated value of an echo like this, and be transfused to subtracter, this has just deducted the linear segment of echo from the transmit path circuit.
Owing to become non-linear relation between acoustic echo and the source voice signal, therefore the electric echo removing method can not be applied in simply in the acoustic echo elimination, it generally all is with algorithm controls nonlinear processor (NLP that existing acoustic echo is eliminated, Non-Linear Processor) realizes, Fig. 2 is existing acoustic echo cancellation element, Rin among the figure is that the signal of far-end input AEC module is a remote end input signal, Rout is far-end output acoustic echo controller (AEC, Acoustic Echo Controller) signal of module is the far-end output signal, Sin is that the signal of near-end input AEC module is a near end input signal, Sout is that the signal of near-end output AEC module is the near-end output signal, as shown in Figure 2, this device comprises with lower module:
Noise reduction module 201: be used near end input signal is carried out noise reduction process, and the near end input signal behind the noise reduction is outputed to intelligent sound level detection module 202 and near end signal short-time rating computing module 204.
Intelligent sound level detection module 202: the relative level difference of remote end input signal and near end input signal when being used to detect mute state, and this level difference outputed near end signal condition judgment module 205; This module detects remote end input signal and the signal level of near end input signal when non-mute state simultaneously, and far-end and near end input signal level are outputed near end signal condition judgment module 205.
Near-end noise threshold value input module 203: be used to preserve the near end signal noise threshold, and the near end signal noise threshold is outputed near end signal condition judgment module 205.
Near end signal short-time rating computing module 204: be used to calculate the level and smooth short-time rating of near end input signal, the level and smooth short-time rating of near end input signal is outputed near end signal condition judgment module 205.
Near end signal condition judgment module 205: the near end signal noise threshold that is used to receive and preserve 203 outputs of near-end noise threshold value input module, and by comparing the output and the near end input signal noise threshold of near end input signal short-time rating computing module 204, judge whether near end input signal is voice, if the former is greater than the latter, then near end input signal is voice, and out code is outputed to NLP module 210; Otherwise, near end input signal is a non-voice, then according to the quiet level difference correction far-end of intelligent sound level detection module 202 outputs and the quiet level differences of near-end, the remote end input signal of computational intelligence speech level detection module 202 outputs is in the signal level in the pure time delay moment and the difference of current near end input signal level then, pure time delay is the current near end input signal moment of living in to deduct the resulting moment of pure time delay constantly, if this difference is in preset range, judge that then this near end input signal is an echo, enabled instruction is outputed to NLP module 210, simultaneously this near end input signal state is outputed to adaptive echo estimation module in the path delay of time 209; Otherwise the judgement near end input signal is a noise, and out code is outputed to adaptive echo estimation module in the path delay of time 209.
Far-end noise threshold value input module 206: be used to preserve the remote signaling noise threshold, and the remote signaling noise threshold is outputed to remote signaling condition judgment module 208.
Remote signaling short-time rating computing module 207: be used to receive remote end input signal, calculate the level and smooth short-time rating of remote end input signal, and it is outputed to remote signaling condition judgment module 208.
Remote signaling condition judgment module 208: the remote signaling noise threshold that is used to receive and preserve 206 outputs of far-end noise threshold value input module, and by comparing remote end input signal noise threshold and remote end input signal at pure time delay level and smooth short-time rating constantly, obtain remote end input signal at pure time delay state constantly, and the state of remote end input signal is outputed to adaptive echo estimation module in the path delay of time 209.
Adaptive echo estimation module in the path delay of time 209: when receiving remote end input signal when being output as voice, writing down this far-end speech produces constantly, when after this receiving for the first time near end signal condition judgment module 205 when being output as echo, writing down this near end echo produces constantly, calculating and preserving the difference in above-mentioned two moment is echo path delay, when receiving near end signal condition judgment module 205 when being output as noise, echo path delay according to the last time of preserving, voice in conjunction with remote end input signal the last time take place constantly, the echo origination point of estimating current near end input signal is " catapoint ", if should " catapoint " just the noise of near-end constantly near, just judge that this near-end noise is a residual echo, and enabled instruction outputed to NLP module 210, otherwise the judgement near end input signal is a noise.
NLP module 210: when receiving the enabled instruction of near end signal block of state 205 or adaptive echo estimation module in the path delay of time 209, this module starts; When receiving the out code of near end signal condition judgment module 205, this module is closed.
In existing acoustic echo canceller,, make noise reduction algorithm complicated and comparatively time-consuming owing to eliminate relatively difficulty of white noise; Because adaptive echo estimation module in the path delay of time is wanted dynamic surveillance and is handled far-end and near end input signal, and in wireless system, the mobile meeting of mobile telephone position causes the change in reecho path, has increased the complexity and the processing time of algorithm.In existing wireless telecommunication system, AEC handles and often will bundle with coding/decoding module, and the AEC processing time is oversize will reduce systematic function.
Summary of the invention
In view of this, main purpose of the present invention is to provide a kind of algorithm simple, few relatively echo cancelling device and method of processing time, realizes the quick judgement to the near end input signal state, thereby decision is to the startup of NLP with close.
For achieving the above object, technical scheme of the present invention is achieved in that
A kind of echo cancelling device comprises the nonlinear processor NLP module that is used for echo is carried out Nonlinear Processing, further comprises:
Remote signaling calculates search module, is used for according to the current near end input signal moment of living in, searches for the maximum of the energy parameter of remote end input signal in the preset time delay scope, and this maximum is outputed to the near end signal condition judgment module;
The near end signal condition judgment module, be used for that the current near end input signal moment of living in is outputed to remote signaling and calculate search module, preliminary judgement near end input signal is voice or noise, preserve this preliminary judged result, simultaneously, the maximum that is used for the energy parameter in the preset time delay scope according near end input signal energy parameter and remote end input signal judges further whether near end input signal is echo, if, enabled instruction is outputed to the NLP module, otherwise,, then out code is outputed to the NLP module if preliminary judged result is voice, if preliminary judged result is a noise, then keep the state of current NLP module.
Described remote signaling calculates search module and comprises:
Remote signaling energy parameter computing module is used to calculate the energy parameter of remote end input signal, and the energy parameter of remote end input signal is outputed to remote signaling energy parameter search module;
Remote signaling energy parameter search module, be used for receiving and preserving the remote signaling energy parameter, and according to the maximum of current near end input signal moment of living in search remote end input signal, and this maximum outputed to the near end signal condition judgment module in preset time delay scope self-energy parameter.
Described near end signal condition judgment module comprises:
Near-end noise threshold value input module is used to preserve the near end signal noise threshold and it is outputed to the near-end comparison module;
Near end signal energy parameter computing module, be used to receive near end input signal, and the current near end input signal moment of living in is outputed to remote signaling calculate search module, calculate the energy parameter of near end input signal simultaneously, and the near end input signal energy parameter is outputed to the near-end comparison module;
The near-end comparison module, be used for judging tentatively that according near end input signal energy parameter and near end signal noise threshold near end input signal is voice or noise, be used for simultaneously judging further according to the energy parameter maximum and the near end input signal energy parameter of remote end input signal in the preset time delay scope whether near end input signal is echo, if be echo then enabled instruction is outputed to the NLP module, otherwise, if tentatively be judged as voice then out code outputed to the NLP module, if tentatively be judged as noise, keep the state of current NLP module.
Described near end signal condition judgment module further comprises near end signal dynamic change trend judge module, be used to receive and preserve the output of near-end comparison module, and judge the dynamic change trend of near end input signal in conjunction with the state of the preceding near end input signal of having preserved, when the tendency of changes of near end input signal occurs for echo is arranged, just enabled instruction is outputed to the NLP module, when the tendency of changes of near end input signal occurs for voice are arranged, just out code is outputed to the NLP module.
Described echo cancelling device further comprises the comfort noise generation module, is used to produce comfort noise, and this comfort noise is outputed to the NLP module,
Simultaneously, when described NLP module receives the enabled instruction of near end signal condition judgment module, the comfort noise that receives is substituted echo output to far-end.
Described comfort noise generation module comprises:
Clamp down on the amplitude input module, be used to preserve the amplitude of clamping down on of comfort noise, and will clamp down on amplitude and output to comfort noise amplitude update module;
Comfort noise amplitude update module is upgraded the amplitude of current comfort noise according to the output of near end signal condition judgment module and the output of clamping down on the amplitude input module;
The comfort noise determination module according to the noise amplitude generation comfort noise of comfort noise update module output, and outputs to the NLP module;
Simultaneously, described near end signal condition judgment module judges that the near end signal condition judgment module further outputed to comfort noise amplitude update module with this noise amplitude as new comfort noise amplitude and is used to upgrade the comfort noise amplitude when near end input signal was noise.
Described echo cancelling device further comprises the remote signaling condition judgment module, is used to judge that remote end input signal is voice or noise, and the remote end input signal state outputed to the near end signal condition judgment module,
Simultaneously, the near end signal condition judgment module is before further judging whether near end input signal is echo, judge that further the remote end input signal state that receives is voice or noise, if be voice, just directly judge whether near end input signal is echo, if be noise, the preliminary judged result of just resetting current near end input signal is voice, judges further then whether near end input signal is echo.
Described remote signaling condition judgment module comprises:
Far-end noise threshold value input module is used to preserve the remote signaling noise threshold and it is outputed to the far-end comparison module;
The far-end comparison module by more current remote signaling energy parameter and remote signaling noise threshold, is judged that current remote end input signal is voice or noise, and judged result is outputed to the near end signal condition judgment module,
Simultaneously, described remote signaling calculates search module and further current remote end input signal energy parameter is outputed to the far-end comparison module.
A kind of echo cancel method, this method comprises:
A, tentatively judge that near end input signal is voice or noise, preserves this preliminary judged result;
B, with the current near end input signal moment of living in be basis, the maximum of the search energy parameter of remote end input signal in the preset time delay scope;
The energy parameter of C, calculating near end input signal, the maximum of the remote end input signal energy parameter that obtains according to the energy parameter and the step B of near end input signal, further judge whether near end input signal is echo, if, start NLP and handle, otherwise, if preliminary judged result is voice, then close NLP and handle,, then keep current NLP treatment state if preliminary judged result is a noise.
The described preset time delay scope of step B is for deducting half moment that obtains that pure time delay deducts dynamic delay again from the near end input signal moment of living in, only deducts half moment that obtains that pure time delay adds dynamic delay to the near end input signal moment of living in.
Described pure time delay is the arbitrary value between 100 to 150 milliseconds, and described dynamic delay is 80 milliseconds.
Further comprise between described step B and the C, judge that current remote end input signal is voice or noise, if current remote end input signal is voice, just direct execution in step C; Otherwise, after the preliminary judged result of resetting near end input signal is voice, execution in step C.
This echo cancel method further comprises and sets in advance a remote signaling noise threshold, the current remote end input signal of described judgement is that voice still are that noise obtains by more current remote end input signal energy parameter and remote signaling noise threshold, if the former is less than the latter, the judgement remote end input signal is a noise; Otherwise the judgement remote end input signal is voice.
Described step C is starting or is closing NLP and handle to take a step forward and comprise: the state of preserving current near end input signal, and judge the dynamic change trend of near end input signal in conjunction with the state of a preceding near end input signal, when tendency of changes is that echo is when occurring, just starting NLP handles, and NLP variable transit time is decremented to 0 by seamlessly transitting length value, when tendency of changes is voice when occurring, just close NLP and handle, NLP variable transit time is incremented to by 0 seamlessly transits length value.
Described steps A further comprises after the preliminary judgement near end input signal is noise, with this noise amplitude as being used for the new comfort noise amplitude that NLP handles.
This echo cancel method comprises that further setting in advance one clamps down on amplitude, and further comprises after step C is starting the NLP processing: judge that whether the comfort noise amplitude is greater than clamping down on amplitude, if then will clamp down on amplitude as new comfort noise amplitude; Otherwise, keep current comfort noise amplitude.
This echo cancel method further comprises and sets in advance a near end signal noise threshold, described judgement near end input signal be voice still be noise be by relatively the energy parameter and the near end signal noise threshold of near end input signal obtain, if the former is less than the latter, the judgement near end input signal is a noise; Otherwise the judgement near end input signal is voice.
This echo cancel method further comprises and sets in advance a near end signal noise threshold, described judgement near end input signal be voice still be noise be by relatively the maximum and the near end signal noise threshold of the energy parameter of near-end block signal obtain, if the former is less than the latter, the judgement near end input signal is a noise; Otherwise the judgement near end input signal is voice.
The described near end input signal of step C is the near-end block signal.
The described near end input signal of step C is the first section near-end block signal of near end input signal after segmentation in the steps A,
Simultaneously, further comprise after the described step C, judge successively whether second section near-end block signal and subsequent near-end block signal are echo, if, then closing NLP handles, otherwise, if current remote end input signal be voice and the last period the near-end block signal be echo, then starting NLP handles, if current remote end input signal be voice and the last period the near-end block signal be if that voice or current remote end input signal are noise, then close NLP and handle, if current remote end input signal be voice and the last period the near-end block signal be noise, then keep current NLP treatment state.
The maximum of the described remote end input signal energy parameter that obtains according to the energy parameter and the step B of near end input signal of step C judges further whether near end input signal is echo being: the value of maximum after decaying of the energy parameter of near end input signal and the remote end input signal energy parameter that step B obtains relatively, if the former is less than the latter, the judgement near end input signal is an echo.
Compared with prior art, the present invention judges that at first tentatively near end input signal is voice or noise, then according near end input signal energy parameter and remote end input signal maximum in preset time delay scope self-energy parameter, further judge whether near end input signal is echo, realized the control that NLP is started and closes.Because noise reduction process can curb a part of echo, therefore, the present invention does not do this processing, has saved the time in shortcut calculation yet; Because the present invention relatively judges the near end input signal state by twice, has guaranteed the accuracy of algorithm, and has save detection and correction to quiet level, has saved the time; Simultaneously, the present invention is limited to the hunting zone in the preset time delay, all wants estimated echo time delay definite " catapoint " to compare with prior art at every turn, and the complexity of algorithm reduces and reduced the processing time.By above analysis as can be known, algorithm of the present invention is simple and saved the processing time, makes acoustic echo controller (EC, Echo Controller) module flexible configuration in system.
Embodiment
In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention is described in further detail below in conjunction with drawings and the specific embodiments.
Fig. 3 is the general structure block diagram that the present invention realizes echo cancelling device, and this structured flowchart has comprised apparatus of the present invention and realized the necessary module that echo is eliminated, and as shown in Figure 3, apparatus of the present invention comprise:
Remote signaling calculates search module 31: be used for according to the near end input signal moment of living in, search for the maximum of the energy parameter of remote end input signal in the preset time delay scope, and this maximum is outputed near end signal condition judgment module 32.
Near end signal condition judgment module 32: at first, this module outputs to remote signaling with the current near end input signal moment of living in and calculates search module 31; Then, this module is used for tentatively judging that near end input signal is voice or noise, and preserves this preliminary judged result; At last, the maximum that is used for the energy parameter in the preset time delay scope according near end input signal energy parameter and remote end input signal judges further whether near end input signal is echo, if, then enabled instruction is outputed to NLP module 33, otherwise, judge that the near end input signal state is identical with preliminary judged result, if preliminary judged result is voice, then out code is outputed to NLP module 33,, keep the state of current NLP module 33 if preliminary judged result is a noise.
NLP module 33: when receiving the enabled instruction of near end signal condition judgment module 32, this module starts; When receiving the out code of near end signal condition judgment module 32, this module is closed.
Fig. 4 realizes the structured flowchart of an embodiment of echo cancelling device for the present invention, and as shown in Figure 4, in actual applications, the present invention can also comprise following two modules:
Remote signaling condition judgment module 34: be used to receive the current remote signaling energy parameter that remote signaling calculates search module 31 outputs, and judge that according to this energy parameter current remote end input signal is voice or noise, and current remote end input signal state outputed near end signal condition judgment module 32, near end signal condition judgment module 32 receives remote end input signal when being voice, and beginning further judges whether near end input signal is echo; Near end signal condition judgment module 32 receives remote end input signal when being noise, and the preliminary judged result of just resetting near end input signal is voice, judges further then whether near end input signal is echo.
Comfort noise generation module 35: be used to produce comfort noise, simultaneously when near end signal condition judgment module 32 judges that near end input signal is noise, just this noise amplitude is outputed to comfort noise generation module 35 as new comfort noise amplitude, after comfort noise generation module 35 upgrades the comfort noise amplitude new comfort noise is outputed to NLP module 35, be used for NLP and handle.
Fig. 5 is the detailed block diagram of echo cancelling device shown in Figure 4, and as shown in Figure 5, remote signaling calculates search module 31 and comprises following submodule:
Remote signaling energy parameter computing module 301: be used to receive remote end input signal, calculate the level and smooth short-time rating of remote end input signal, and it is outputed to remote signaling energy parameter search module 302 and far-end comparison module 304.
Remote signaling energy parameter search module 302: be used to receive the output of remote signaling energy parameter computing module 301, and it is saved in the round-robin queue, and with the current near end input signal moment of living in be basis, search for the maximum of the sectionally smooth short-time rating of remote end input signal in the preset time delay scope, and this maximum is outputed to near-end comparison module 307.
Remote signaling condition judgment module 34 comprises following submodule:
Far-end noise threshold value input module 303: be used to preserve the remote signaling noise threshold, and the remote signaling noise threshold is outputed to far-end comparison module 304.
Far-end comparison module 304: be used for judging that according to current remote end input signal energy parameter and remote signaling noise threshold current remote end input signal is voice or noise, and the remote end input signal state is outputed to near-end comparison module 307.
Near end signal condition judgment module 32 comprises following submodule:
Near-end noise threshold value input module 305: be used to preserve the near end signal noise threshold, and the near end signal noise threshold is outputed to near-end comparison module 307.
Near end signal energy parameter computing module 306: be used to receive near end input signal, and the current near end input signal moment of living in outputed to remote signaling energy parameter search module 302, calculate the level and smooth short-time rating of current near end input signal then or calculate the rough segmentation of near end input signal or the level and smooth in short-term power of segmentation after the segmentation in detail, and with the maximum of the rough sectionally smooth short-time rating of the level and smooth short-time rating of near end input signal or in detail the sectionally smooth short-time rating output to near-end comparison module 307.
Near-end comparison module 307: the function of this module has two,
Function one, be used to receive and preserve the near end signal noise threshold of near-end noise threshold value input module 305 outputs, and judge tentatively that according to the output and the near end signal noise threshold of near end signal energy parameter computing module 306 near end input signal is voice or noise, and preserve the preliminary judged result of this near end input signal, if near end input signal is judged to be noise, then this noise amplitude is input to comfort noise amplitude update module 310 as new comfort noise amplitude;
Function two, when the remote end input signal state that receives 304 outputs of far-end comparison module is voice, this module is used for further judging whether near end input signal is echo, when the remote end input signal that receives 304 outputs of far-end comparison module is noise, the preliminary judged result that this module is just reset current near end input signal is voice, judges further then whether near end input signal is echo; When if near end input signal is not echo and not segmentation of near end input signal, determine the near end input signal state according to preliminary judged result, when if near end input signal is not echo and near end input signal segmentation, according to preliminary judged result or take all factors into consideration preliminary judged result and the last period near-end block signal judged result determine near-end block signal state, at last the result of determination of near-end status input signal is outputed near end signal dynamic change trend judge module 308.
Near end signal dynamic change trend judge module 308: this module is used to receive and preserve the output of near-end comparison module 307, and judge the dynamic change trend of near end input signal according to the state of the state of current near end input signal and the preceding near end input signal of having preserved, when the tendency of changes of near end input signal occurs for echo is arranged, just enabled instruction is outputed to NLP module 312; When the tendency of changes of near end input signal occurs for voice are arranged, just out code is outputed to NLP module 312.
In actual applications, near end signal condition judgment module 32 can not comprise near end signal dynamic change trend judge module 308, at this moment, if near-end comparison module 307 judges that the near end input signal of segmentation or not segmentation is an echo, just enabled instruction is outputed to NLP module 312; If be judged to be voice, just out code is outputed to NLP module 312; If be judged to be noise, just keep current NLP module 312 states.
Comfort noise generation module 35 comprises following submodule:
Clamp down on amplitude input module 309: be used to preserve the amplitude of clamping down on of comfort noise, and it is outputed to comfort noise amplitude update module 310.
Comfort noise amplitude update module 310: be used for upgrading current comfort noise amplitude, the comfort noise amplitude after upgrading is outputed to comfort noise determination module 311 according to the output of near-end comparison module 307 and the output of clamping down on amplitude input module 309.
Comfort noise determination module 311: be used to produce initial comfort noise, and upgrade current comfort noise, comfort noise is outputed to NLP module 312 according to the comfort noise amplitude of comfort noise amplitude update module 310 outputs.
NLP module 33 is a NLP module 312: when receiving the enabled instruction of near end signal dynamic change trend module 308 or near-end comparison module 307, this module starts, and replaces outputing to far-end after the echo according to the comfort noise of comfort noise determination module 311 outputs; When receiving the out code of near end signal dynamic change trend module 308 or near-end comparison module 307, this module is closed; Otherwise this module keeps current state.
Fig. 6 realizes the overview flow chart that echo is eliminated for the present invention, and this flow chart has comprised the inventive method and realized the steps necessary that echo is eliminated, and as shown in Figure 6, realizes that the concrete steps of acoustic echo elimination are as follows:
Step 601: near end signal condition judgment module 32 receives near end input signal, and calculates the near end input signal energy parameter.
Step 602: near end signal condition judgment module 32 outputs to remote signaling with the current near end input signal moment of living in and calculates search module 31, judges then whether near end input signal is voice, if, execution in step 603; Otherwise, execution in step 604.
Step 603: near end signal condition judgment module 32 preliminary judgement near end input signal are voice, preserve the state of this near end input signal, and execution in step 605.
Step 604: near end signal condition judgment module 32 preliminary judgement near end input signal are noise, preserve the state of this near end input signal.
Step 605: remote signaling calculates search module 31 and receives current near end input signal after the moment of living in, according to this constantly, search for the maximum of the energy parameter of remote end input signal in the preset time delay scope, and this maximum is outputed near end signal condition judgment module 32.
Step 606: near end signal condition judgment module 32 compares the value of maximum after decay of near end input signal energy parameter and remote end input signal energy parameter, if the former is less than the latter, and execution in step 607; Otherwise, execution in step 608.
Step 607: near end signal condition judgment module 32 judges that the state of current near end input signal is an echo, and NLP module 33 starts NLP and handles.
Step 608: near end signal condition judgment module 32 judges whether preliminary judged result is voice, if, execution in step 609; Otherwise, execution in step 610.
Step 609:NLP module 33 is closed NLP and is handled.
Step 610:NLP module 33 keeps current treatment state.
Specific embodiment one:
When present embodiment realizes that echo is eliminated, when judging whether near end input signal is echo, be to judge at the whole frame signal of input, promptly this frame signal is not carried out segment processing, this frame signal of not segmentation is called near-end incoming frame signal, and Fig. 7 is the specific descriptions of Fig. 6 step for the flow chart that the present invention realizes the specific embodiment that acoustic echo is eliminated, as shown in Figure 7, the concrete steps of realization acoustic echo elimination are as follows:
Step 701: after near end signal energy parameter computing module 306 receives near-end incoming frame signal, the current near-end incoming frame signal moment of living in is outputed to remote signaling energy parameter search module 302, and calculate the level and smooth short-time rating SPower of near-end incoming frame signal, and SPower is outputed to near-end comparison module 307.
Step 702: the noise threshold SNoise of the near end input signal that near-end comparison module 307 comparison SPower and the near-end noise threshold value input module of having preserved 305 are exported, if SPower>SNoise, then execution in step 703; Otherwise, execution in step 704.
Step 703: near-end comparison module 307 preliminary judgement near-end incoming frame signals are voice, preserve the state of this near-end incoming frame signal, and execution in step 705.
Step 704: near-end comparison module 307 preliminary judgement near-end incoming frame signals are noise, preserve the state of this near-end incoming frame signal, and the noise amplitude of this near-end incoming frame signal is outputed to comfort noise amplitude update module 310 as new comfort noise amplitude.
Step 705: after remote signaling energy parameter computing module 301 receives remote end input signal, calculate the level and smooth short-time rating RPower of remote end input signal, and RPower is outputed to remote signaling energy parameter search module 302 and far-end comparison module 304.
Step 706: the noise threshold RNoise of the remote end input signal that far-end comparison module 304 comparison RPower and the far-end noise threshold value input module of having preserved 303 are exported, if RPower<RNoise, execution in step 707~708; Otherwise, execution in step 709.
Step 707: far-end comparison module 304 judges that remote end input signal is a noise, and this remote signaling state is outputed to near-end comparison module 307.
Step 708: near-end comparison module 307 receives after far-end comparison module 304 is output as noise, and the preliminary state of near-end incoming frame signal is re-set as voice, and this preliminary state of preservation, goes to step 710.
Step 709: far-end comparison module 304 judges that remote end input signal is voice, and this state is outputed to near-end comparison module 307.
Step 710: remote signaling energy parameter search module 302 receives and preserves the remote signaling energy parameter, and according to the current near-end incoming frame signal moment of living in, search for the maximum RMPower of the level and smooth short-time rating RPower of remote end input signal in the preset time delay scope, and RMPower is outputed to near-end comparison module 307.The preset time delay scope is for deducting half resulting moment that pure time delay deducts dynamic delay again from the current near end input signal moment of living in, deducting pure time delay to the near end input signal moment of living in adds half moment that obtains of dynamic delay and ends, usually, the pure time delay value is the arbitrary value between 100~150 milliseconds, and the dynamic delay value is 80 milliseconds.
Step 711: near-end comparison module 307 is SPower and RMPower/B relatively, and wherein B is a pad value, determines that by experience if SPower<RMPower/B, then execution in step 712; Otherwise, execution in step 713.
Step 712: near-end comparison module 307 judges that the state of current near-end incoming frame signal is an echo, and the state of this near-end incoming frame signal is outputed near end signal dynamic change trend judge module 308, goes to step 714 then.
Step 713: near-end comparison module 307 judges that the state of current near-end incoming frame signal is identical with the preliminary judged result of near-end incoming frame signal, and the state of this near-end incoming frame signal is outputed near end signal dynamic change trend judge module 308.
Step 714: near end signal dynamic change trend judge module 308 is preserved the state of current near-end incoming frame signal, and in conjunction with the state of the preceding near-end incoming frame signal preserved, judge the dynamic change trend of near-end incoming frame signal, the dynamic change trend of near-end incoming frame signal has four kinds: have echo appearance promptly to carry out the transition to echo by voice or noise, lasting echo promptly by echo to echo, have voice to occur promptly carrying out the transition to voice by echo or noise, keep voice promptly by voice to voice.
Step 715: whether the dynamic change trend that near end signal dynamic change trend judge module 308 is judged near-end incoming frame signal for there being the echo appearance, if, execution in step 716~719; Otherwise, execution in step 720~722.
Step 716: comfort noise amplitude update module 310 more current comfort noise amplitudes and the amplitude of clamping down on of clamping down on 309 outputs of amplitude input module, if the former is greater than the latter, then execution in step 717; Otherwise, execution in step 718.
Step 717: comfort noise amplitude update module 310 replaces outputing to comfort noise determination module 311 after the current comfort noise amplitude to clamp down on amplitude, and comfort noise determination module 311 outputs to NLP module 312 with new comfort noise, goes to step 719 then.
Step 718: comfort noise amplitude update module 310 keeps current comfort noise amplitude constant, and comfort noise determination module 311 outputs to NLP module 312 with current comfort noise.
Step 719:NLP module 312 beginning NLP handle, and promptly to switching between comfort noise c (n) and the residual echo e (n), switching is output as Sout (n), in order to obtain taking over seamlessly between c (n) and e (n), uses following interpolating function:
Wherein, M is the length that seamlessly transits; Ramp is variable transit time, and its excursion is 0~M, obviously, switches level and smooth degree by ramp and the common decision of M, and when having echo to occur, ramp is decremented to 0 by M.
Step 720: near end signal dynamic change trend judge module 308 is judged near-end incoming frame signal dynamics tendency of changes whether for the voice appearance is arranged, if, execution in step 721; Otherwise, execution in step 722.
Step 721:NLP module 312 is closed NLP and is handled, at this moment, and with interpolating function
In ramp be incremented to M by 0.
Step 722:NLP module 312 keeps the NLP treatment state constant.
Need to prove that near-end comparison module 307 receives after far-end comparison module 304 is output as voice, beginning according near end signal energy parameter and remote signaling the maximum in the dynamic delay scope judge whether near end input signal is echo.
Specific embodiment two:
When present embodiment realizes that echo is eliminated, before judging whether near end input signal is echo, the frame signal of near-end input has been carried out segment processing, each segment signal after the segmentation has been called the near-end block signal.The difference of this embodiment and specific embodiment one is:
Further comprise between step 710 and the step 711, after near end signal energy parameter computing module 306 further carries out segmentation with the frame signal of near-end input, calculate the level and smooth in short-term power SLPower of sectionally smooth of first section near-end block signal, and SLPower is outputed to near-end comparison module 307.Simultaneously, the SPower in the step 711 changes " SLPower " into, and promptly near-end comparison module 307 judges whether first section near-end block signal is echo.
Near-end incoming frame signal in step 712~722 all replaces with " first section near-end block signal ".
All the other steps are identical with specific embodiment one.
It is to be noted, it more than is the flow process that first section near-end block signal handled, after this, continue, till all block signals of this frame signal of near-end input are all handled second section and later block signal repeating step 706~722.
In actual applications, to all specific embodiments, judge that preliminary near-end incoming frame signal is voice when still being noise, more accurate in order to make judgement, step 701 and 702 also can be done following replacement:
Step 701: after the rough segmentation of near-end incoming frame signal, calculate the level and smooth short-time rating of every segment signal successively, search for the maximum SMPower of all level and smooth short-time ratings then.
SPower in the step 702 changes " SMPower " into, promptly by relatively the maximum SMPower and the near end signal noise threshold of near-end incoming frame signal smoothing short-time rating judge that tentatively near-end incoming frame signal is voice or noise.
In addition, for at the specific embodiment of further judging that the frame signal before whether near end input signal is echo near-end imported is carried out segmentation, consider the continuity of speech frame signal, step 707 and 709 further comprises respectively after existing step, near-end comparison module 307 is preserved this current remote end input signal state, simultaneously, step 713 is done following replacement:
Step 713: near-end comparison module 307 judges at first whether the current remote end input signal state that receives is voice, if current remote end input signal state is voice, then current near-end block signal state is identical with the state of near-end block signal the last period, if and first section near-end block signal is non-echo, the state of then judging first section near-end block signal is identical with the preliminary judged result of near end input signal, and the state of current near-end block signal is outputed near end signal dynamic change trend judge module 308; If current remote end input signal state is a noise, the state of then judging current near-end block signal is voice, and the state of current near-end block signal is outputed near end signal dynamic change trend judge module 308.
In addition, in all specific embodiments, the energy parameter of near end input signal and remote end input signal also utilisable energy or level is represented.
Simultaneously, the present invention also is applicable to the elimination of electric echo.
The above is preferred embodiment of the present invention only, is not to be used to limit protection scope of the present invention.Within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.