Audio signal processing system and method
By synchronizing the sampling rate phase of the output and input signals in the audio signal processing system, the problem of low voice echo cancellation efficiency caused by inconsistent sampling rates is solved, and rapid convergence and low-power consumption voice echo cancellation are achieved.
Patent Information
- Application Number
- CN202210275148.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-18
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2042-03-18
AI Technical Summary
In systems such as smart speakers, the sampling rates of the sound output signal and the input signal are inconsistent during speech echo cancellation, resulting in a mismatch between the trained phases and affecting the efficiency of speech echo cancellation and system power consumption.
Through the output signal acquisition and sampling rate conversion module and the input signal acquisition and sampling rate conversion module, the respective upsampling clock phase and downsampling filter phase are obtained, and when they are set to the preset value in the synchronization module, the voice echo is started Elimination ensures that the sound output signal and input signal are synchronized so that the adaptive filter converges quickly.
It improves the quality of voice echo cancellation, reduces the hardware work of the system when voice echo cancellation is not needed, and reduces power consumption.
Smart Images

Figure CN114678035B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of digital signal processing, and in particular relates to an audio signal processing system and method. Background Art
[0002] For a smart speaker, or a similar system that needs to emit and collect sound at the same time, when there are sound output signals and sound input signals at the same time, voice echo cancellation (Acoustic Echo Cancellation, AEC) processing is required.
[0003] When performing voice echo cancellation, the sampling rates of the sound output signal and the sound input signal are inconsistent, and the start time of the sound output signal and the sound input signal is uncertain. This can easily lead to the mismatch between the trained phases of the sound output signal and the sound input signal input to the AEC filter, which requires retraining. Therefore, it takes a lot of time to achieve complete voice echo cancellation, affecting system power consumption and response time. Summary of the invention
[0004] The object of the present invention is to provide an audio signal processing system and method, which can improve the quality of speech echo cancellation and reduce the power consumption of the system.
[0005] To achieve the above object, the present invention provides an audio signal processing system, comprising:
[0006] An output signal acquisition and sampling rate conversion module acquires a first up-sampling clock phase and a first down-sampling filter phase of a current sound output signal;
[0007] An input signal acquisition and sampling rate conversion module acquires a second up-sampling clock phase and a second down-sampling filter phase of a current sound input signal; and
[0008] A synchronization module is electrically connected to the output signal acquisition and sampling rate conversion module and the input signal acquisition and sampling rate conversion module. When the first upsampling clock phase, the first downsampling filter phase, the second upsampling clock phase and the second downsampling filter phase are the same and are preset values, an enable signal of the sound output signal and the sound input signal is output, and voice echo cancellation is started.
[0009] In one embodiment of the present invention, the synchronization module includes a synchronization trigger, which is electrically connected to the output signal acquisition and sampling rate conversion module and the input signal acquisition and sampling rate conversion module. When the first upsampling clock phase, the first downsampling filter phase, the second upsampling clock phase and the second downsampling filter phase are the same and are preset values, the synchronization trigger outputs a high level.
[0010] In one embodiment of the present invention, the synchronization module includes:
[0011] A first trigger, a signal input terminal of which is electrically connected to an output terminal of the synchronization trigger;
[0012] A second trigger connected to the output terminal of the first trigger through a logic circuit; and
[0013] A second AND gate, having an input terminal inputting a first output enable signal and a first input enable signal, and an output terminal electrically connected to enable terminals of the first trigger and the second trigger;
[0014] When the synchronous flip-flop outputs a high level, and the first output enable signal and the first input enable signal are at a high level, the second flip-flop outputs a high level.
[0015] In one embodiment of the present invention, the synchronization module includes:
[0016] A first AND gate, whose input terminal is electrically connected to the output terminal of the first trigger and the output terminal of the synchronous trigger; and
[0017] The first OR gate has an input terminal electrically connected to the output terminal of the first AND gate and the output terminal of the second trigger, and an output terminal electrically connected to the input terminal of the second trigger.
[0018] In one embodiment of the present invention, the synchronization module includes:
[0019] a third trigger, whose input terminal is electrically connected to the first input enable signal, the output terminal of the second trigger and the enable signal of the sound output signal through a logic circuit, and outputs the enable signal of the sound input signal; and
[0020] The fourth trigger has an input end electrically connected to the first output enable signal, the output end of the second trigger and the enable signal of the sound input signal through a logic circuit, and outputs the enable signal of the sound output signal.
[0021] In one embodiment of the present invention, the output of the third trigger is:
[0022] MIC_EN_ACT=MIC_EN&((!SPK_EN_ACT)|(SPK_EN_ACT&RisedgeFound{p,q,m,n});
[0023] Among them, MIC_EN_ACT is the second input enable signal, that is, the enable signal of the sound input signal, MIC_EN is the first input enable signal, SPK_EN_ACT is the second output enable signal, that is, the enable signal of the sound output signal, m is the first upsampling clock phase, n is the first downsampling filter phase, p is the second upsampling clock phase and q is the second downsampling filter phase, and RisedgeFound{p,q,m,n} is the output of the second trigger.
[0024] In one embodiment of the present invention, the synchronization module further includes:
[0025] A third AND gate, an input end of which is electrically connected to the output end of the second trigger and the output end of the fourth trigger;
[0026] A first NOT gate, an input end of which is electrically connected to the output end of the fourth trigger;
[0027] a second OR gate, whose input terminal is electrically connected to the output terminals of the third AND gate and the first NOT gate; and
[0028] A fourth AND gate has an input terminal electrically connected to the output terminal of the second OR gate and the first input enable signal, and an output terminal electrically connected to the third trigger.
[0029] In one embodiment of the present invention, the output of the fourth trigger is:
[0030] SPK_EN_ACT=SPK_EN&((!MIC_EN_ACT)|(MIC_EN_ACT&RisedgeFound{p,q,m,n});
[0031] Among them, SPK_EN_ACT is the second output enable signal, that is, the enable signal of the sound output signal, SPK_EN is the first output enable signal, MIC_EN_ACT is the second input enable signal, that is, the enable signal of the sound input signal, m is the first upsampling clock phase, n is the first downsampling filter phase, p is the second upsampling clock phase and q is the second downsampling filter phase, and RisedgeFound{p,q,m,n} is the output of the second trigger.
[0032] In one embodiment of the present invention, the synchronization module further includes:
[0033] a fifth AND gate, an input terminal of which is electrically connected to the output terminal of the second trigger and the output terminal of the third trigger;
[0034] A second NOT gate, an input end of which is electrically connected to the output end of the third trigger;
[0035] a third OR gate, whose input terminal is electrically connected to the output terminal of the fifth AND gate and the output terminal of the second NOT gate; and
[0036] A sixth AND gate has an input end electrically connected to the output end of the third OR gate and the first output enable signal, and an output end electrically connected to the fourth trigger.
[0037] In one embodiment of the present invention, the audio signal processing system further includes a first variable sampling filter, which performs variable sampling on the sound output signal, and a variable sampling multiple of the first variable sampling filter is the first upsampling clock phase / the first downsampling filter phase.
[0038] In one embodiment of the present invention, the audio signal processing system further includes a second variable sampling filter, which performs variable sampling on the sound input signal, and the variable sampling multiple of the first variable sampling filter is the second upsampling clock phase / the second downsampling filter phase.
[0039] The present invention also provides an audio signal processing method, comprising the following steps:
[0040] Collecting a first up-sampling clock phase and a first down-sampling filter phase of a current sound output signal;
[0041] Collecting a second up-sampling clock phase and a second down-sampling filter phase of the current sound input signal;
[0042] When the first up-sampling clock phase, the first down-sampling filter phase, the second up-sampling clock phase and the second down-sampling filter phase are the same and are preset values, an enable signal of a sound output signal and a sound input signal is output, and speech echo cancellation is started.
[0043] In summary, the present invention provides an audio signal processing system and method, which is provided with a synchronization module that synchronizes the sound output signal and the sound input signal, so that the processing system can stop voice echo elimination when voice echo elimination is not needed. When voice echo elimination is needed, because the sound output signal and the sound input signal are phase synchronized, the difference between the trained adaptive filter and the ideal filter is small, so it can converge quickly. And after each low-power wake-up, the ideal adaptive filter will also be very close to the adaptive filter before entering the low-power mode, and can converge quickly. In this way, the quality of voice echo elimination can be improved, and when voice echo elimination is not needed, the corresponding hardware can be stopped, thereby reducing the power consumption of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0045] Figure 1 It is a structural block diagram of an audio signal processing system in the present invention.
[0046] Figure 2 It is a circuit diagram of a synchronization module in the present invention.
[0047] Description of reference numerals:
[0048] Sound output module 10; output trigger 101; first frequency division clock 102; first clock generation module 103; output sound memory 104; digital-to-analog converter 105; power amplifier 106; speaker 107; sound input module 20; input trigger 201; microphone 202; analog-to-digital converter 203; second frequency division clock 204; second clock generation module 205; input sound memory 206; output signal acquisition and sampling rate conversion module 30; sampling trigger 301; reference signal memory 302; first sampling rate conversion and filtering unit 3 03; input signal sampling rate conversion module 40; second sampling rate conversion and filtering unit 401; hybrid memory 402; speech echo cancellation module 50; synchronization module 60; control module 70; synchronization trigger L0; first trigger REG1; second trigger REG2; third trigger REG3; fourth trigger REG4; first AND gate G1; second AND gate G3; third AND gate G4; fourth AND gate G7; fifth AND gate G8; sixth AND gate G11; first OR gate G2; second OR gate G6; third OR gate G10; first NOT gate G5; second NOT gate G9. DETAILED DESCRIPTION
[0049] In order to facilitate the understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. The preferred embodiments of the present application are given in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thoroughly and comprehensively understood.
[0050] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0051] In the description of the present invention, it should be understood that the orientations or positional relationships indicated by the terms "center", "upper", "lower", "front", "back", "left", "right", etc. are based on the orientations or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or component referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.
[0052] See also Figure 1 As shown, an audio signal processing system provided by the present invention, for example, a smart speaker, has a sound output module 10 and a sound input module 20. The sound output module 10 is used to convert digital signals into analog signals and output them through a speaker 107. The sound input module 20 can collect sound signals through a microphone 202 and convert the analog signals into digital signals for input.
[0053] See also Figure 1 As shown, in one embodiment of the present invention, when there is a sound input signal in the sound input module 20 and there is a sound output signal in the sound output module 10, that is, when the microphone 202 and the speaker 107 work at the same time, the sound of the speaker 107 is fed back to the microphone 202 to cause an echo. A voice echo cancellation module 50 is provided in the system, and an adaptive filter is provided in the voice echo cancellation module 50, which can process the sound input signal and the sound output signal, filter out the part that will cause interference, and then eliminate the voice echo. In this embodiment, the adaptive sensor in the voice echo cancellation module 50 can be trained using a sound input signal with a preset sampling rate and a sound output signal with a preset sampling rate, and a specific algorithm is adopted to automatically adjust the filter coefficient to achieve the best filtering characteristics.
[0054] See also Figure 1As shown, in one embodiment of the present invention, the audio signal processing system provided by the present invention further includes an output signal acquisition and sampling rate conversion module 30, an input signal sampling rate conversion module 40 and a synchronization module 60. The output signal acquisition and sampling rate conversion module 30 acquires the sound output signal and obtains the clock phase and the corresponding filter phase of the sound output signal, that is, the first up-sampling clock phase and the first down-sampling filter phase of the current sound output signal. The input signal sampling rate conversion module 40 acquires the sound input signal and obtains the clock phase and the corresponding filter phase of the sound input signal, that is, the second up-sampling clock phase and the second down-sampling filter phase of the current sound input signal. And the current first up-sampling clock phase, the first down-sampling filter phase, the second up-sampling clock phase and the second down-sampling filter phase are input into the synchronization module 60. When the first up-sampling clock phase, the first down-sampling filter phase, the second up-sampling clock phase and the second down-sampling filter phase are input synchronously, an enable signal is output, and speech echo cancellation is started for the sound output signal and the sound input signal.
[0055] See also Figure 1 As shown, in one embodiment of the present invention, the sound output module 10 includes a first frequency-divided clock 102, a first clock generation module 103, an output sound memory 104, an output trigger 101, a digital-to-analog converter 105, a power amplifier 106 and a speaker 107. Among them, the first frequency-divided clock 102 and the output sound memory 104 are electrically connected to the control module 70, and the first frequency-divided clock 102 has a first frequency, and the first frequency is the sampling rate of the speaker 107, and the output sound memory 104 stores the sound output signal to be output. The first clock generation module 103 is electrically connected to the first frequency-divided clock 102, and serves as a buffer and clock gating of the first frequency-divided clock 102. The first clock generation module 103 is electrically connected to the clock input end of the output trigger 101, and the output sound memory 104 is electrically connected to the signal input end of the output trigger 101. The first output enable signal output by the control module 70 generates a second output enable signal through the action of the synchronization module 60, and the second output enable signal is electrically connected to the enable end of the output trigger 101. The output end of the output trigger 101 is electrically connected to the digital-to-analog converter 105. When the second output enable signal is at a high level, the sound output signal in the output sound memory 104 can be output to the output end of the output trigger 101 according to the frequency of the first frequency-divided clock 102. The digital-to-analog converter 105 converts the digital sound output signal with the first frequency output by the output trigger 101 into an analog sound output signal and transmits it to the speaker 107. In this embodiment, a power amplifier 106 is provided between the digital-to-analog converter 105 and the speaker 107 to strengthen the converted analog sound output signal to meet the power range of the speaker 107.
[0056] See also Figure 1 As shown, in one embodiment of the present invention, the sound input module 20 includes a microphone 202, an analog-to-digital converter 203, an input trigger 201, a second frequency-divided clock 204, a second clock generation module 205 and an input sound storage 206. Among them, the microphone 202 is electrically connected to the analog-to-digital converter 203, and the analog-to-digital converter 203 is electrically connected to the signal input end of the input trigger 201. The second frequency-divided clock 204 is electrically connected to the control module 70, and the second frequency-divided clock 204 has a second frequency, and the second frequency is the sampling rate of the microphone 202. The second clock generation module 205 is electrically connected to the second frequency-divided clock 204, and can be used as a buffer and clock gating of the second frequency-divided clock 204, and the second clock generation module 205 is electrically connected to the clock input end of the input trigger 201. The control module 70 outputs a first input enable signal, and after the action of the synchronization module 60, a second input enable signal is generated, and the second input enable signal is electrically connected to the enable end of the input trigger 201. The output end of the input trigger 201 is electrically connected to the input sound memory 206. When the second input enable signal is at a high level, the sound input signal collected by the microphone 202 and converted by the analog-to-digital converter 203 can be output at a second frequency to the input sound memory 206. In this embodiment, the input sound memory 206 can temporarily store the received enable signal.
[0057] See also Figure 1As shown, in one embodiment of the present invention, the output signal acquisition and sampling rate conversion module 30 includes a sampling trigger 301, a reference signal memory 302 and a first sampling rate conversion and filtering unit 303. Among them, the signal input end of the sampling trigger 301 is electrically connected to the output end of the output trigger 101, the clock input end of the sampling trigger 301 is electrically connected to the output end of the first clock generation module 103, the enable end of the sampling trigger 301 is electrically connected to the second output enable signal, and the output end of the sampling trigger 301 is electrically connected to the reference signal memory 302. When the second output enable signal is at a high level, the output end of the sampling trigger 301 outputs the sound output signal according to the first frequency and temporarily stores it in the reference signal memory 302. The first sampling rate conversion and filtering unit 303 is electrically connected to the reference signal memory 302. And the first sampling rate conversion and filtering unit 303 is provided with a first variable sampling filter, which can perform variable sampling on the sound output signal, so that the sound output signal of the first frequency becomes the sound output signal of the preset frequency. For example, the sound output signal may be first upsampled, and then downsampled, and the upsampling multiple / downsampling multiple=first frequency / preset frequency. Two counters are provided in the first sampling rate conversion and filtering unit 303, which respectively record the first upsampling clock phase of the sound output signal and the first downsampling filter phase. The first upsampling clock phase is the phase difference between the upsampled sound output signal and the original sound output signal, and the first downsampling filter phase is the phase difference between the downsampled sound output signal and the upsampled output signal. The enable ends of the two counters are controlled by the first output enable signal, and the first variable sampling filter performs variable sampling according to the first upsampling clock phase and the first downsampling filter phase, and the variable sampling multiple of the first variable sampling filter is the first upsampling clock phase / first downsampling filter phase.
[0058] See also Figure 1As shown, in one embodiment of the present invention, the input signal acquisition and sampling rate conversion module includes a second sampling rate conversion and filtering unit 401. The second sampling rate conversion and filtering unit 401 is electrically connected to the input sound storage 206, and a second variable sampling filter is provided in the second sampling rate conversion and filtering unit 401, which can perform variable sampling on the sound input signal so that the sound input signal of the second frequency becomes a sound output signal of a preset frequency. For example, the sound input signal can be upsampled first, and then the sound input signal can be downsampled, and the upsampling multiple / downsampling multiple=second frequency / preset frequency. Two counters are provided in the second sampling rate conversion and filtering unit 401, which respectively record the second upsampling clock phase of the sound input signal and the second downsampling filter phase. Among them, the second upsampling clock phase is the phase difference between the upsampled sound input signal and the original sound output signal, and the second downsampling filter phase is the phase difference between the downsampled sound input signal and the upsampled input signal. The enable ends of the two counters are controlled by the second input enable signal, and the second variable sampling filter performs variable sampling according to the second upsampling clock phase and the second downsampling filter phase. And the sampling multiple of the second sampling filter is the second up-sampling clock phase / the second down-sampling filter phase.
[0059] See also Figure 1 As shown, in one embodiment of the present invention, a hybrid memory 402 is also provided at the output end of the output signal acquisition and sampling rate conversion module 30 and the input signal sampling rate conversion module 40. The hybrid memory 402 stores the sound input signal and the sound output signal at each moment, and the sound input signal and the sound output signal are arranged according to the sampling time. And the output end of the hybrid memory is electrically connected to the voice echo cancellation module 50. The voice echo cancellation module 50 is provided with an adaptive filter, which can perform echo cancellation processing on the sound input signal and the sound output signal.
[0060] See also Figure 1 As shown, in one embodiment of the present invention, in order to ensure that the sound input signal and the sound output signal have the same phase when being sampled, a synchronization module 60 is provided in the audio signal processing system. The input end of the synchronization module 60 receives the first input enable signal and the first output enable signal sent by the control module 70, and the output end outputs the second input enable signal and the second input enable signal that can make the sound input signal and the sound output signal have the same phase.
[0061] See also Figure 1 and Figure 2As shown, in one embodiment of the present invention, a plurality of triggers are provided in the synchronization module 60, for example, a first trigger REG1 and a second trigger REG2 for performing logic operations on the first up-sampling clock phase, the first down-sampling filter phase, the second up-sampling clock phase, and the second down-sampling filter phase, a third trigger REG3 for outputting a second input enable signal, and a fourth trigger REG4 for outputting a second output enable signal. The clock input terminals of the first trigger REG1, the second trigger REG2, the third trigger REG3, and the fourth trigger REG4 are electrically connected to the bus clock.
[0062] See also Figure 1 and Figure 2 As shown, in one embodiment of the present invention, the first counter, the second counter, the third counter and the fourth counter are all electrically connected to the synchronous trigger L0. When the first up-sampling clock phase, the first down-sampling filter phase, the second up-sampling clock phase and the second down-sampling filter phase are equal and are all preset values, for example, 0, the synchronous trigger L0 outputs a high level. The output end of the synchronous trigger L0 is electrically connected to the signal input end of the first trigger REG1, the output end of the first trigger REG1 and the output end of the synchronous trigger L0 are electrically connected to the first AND gate G1, and the input end of the first AND gate G1 connected to the first trigger REG1 is a low-level effective input end. When the output of the synchronous trigger L0 is a high level and the bus clock does not have a rising edge, the first trigger REG1 outputs a low level, and the output of the first AND gate G1 is a high level. When the output of the synchronous trigger L0 is a high level and the bus clock has a rising edge, the output of the first AND gate G1 is a low level. The detection of the rising edge of the bus clock can be realized. The output end of the first AND gate G1 is electrically connected to the first OR gate G2. The other input end of the first OR gate G2 is electrically connected to the output end of the second trigger REG2, and the output end of the first OR gate G2 is electrically connected to the signal input end of the second trigger REG2. The first output enable signal and the first input enable signal are input to the input end of the second AND gate G3, and the output end of the second AND gate G3 is electrically connected to the enable ends of the first trigger REG1 and the second trigger REG2. It is ensured that only when the first up-sampling clock phase, the first down-sampling filter phase, the second up-sampling clock phase and the second down-sampling filter phase are equal and are all preset values, such as 0, and the first output enable signal and the first input enable signal are both high level, the second trigger REG2 has a signal output.
[0063] See also Figure 1 and Figure 2As shown, in one embodiment of the present invention, the output terminal of the second trigger REG2 is electrically connected to an input terminal of the third AND gate G4, and the other input terminal of the third AND gate G4 is electrically connected to the output terminal of the fourth trigger REG4. The output terminal of the third AND gate G4 is electrically connected to an input terminal of the second OR gate G6, and the output terminal of the fourth trigger REG4 is electrically connected to the input terminal of the first NOT gate G5, and the output terminal of the first NOT gate G5 is electrically connected to the other input terminal of the second OR gate G6. The output terminal of the second OR gate G6 is electrically connected to an input terminal of the fourth AND gate G7, the first input enable signal is connected to the other input terminal of the fourth AND gate G7, and the output terminal of the fourth AND gate G7 is electrically connected to the signal input terminal of the third trigger REG3. The output of the second input enable signal output by the third trigger REG3 is:
[0064] MIC_EN_ACT=MIC_EN&((!SPK_EN_ACT)|(SPK_EN_ACT&RisedgeFound{p,q,m,n}).
[0065] Among them, MIC_EN_ACT is the second input enable signal, MIC_EN is the first input enable signal, SPK_EN_ACT is the second output enable signal, m is the first upsampling clock phase, n is the first downsampling filter phase, p is the second upsampling clock phase and q is the second downsampling filter phase, RisedgeFound{p,q,m,n} is the output of the second trigger, when {p,q,m,n} is a preset value, RisedgeFound{p,q,m,n} is a high level, and when {p,q,m,n} is a non-preset value, RisedgeFound{p,q,m,n} is a low level.
[0066] See also Figure 1 and Figure 2 As shown, in one embodiment of the present invention, the output terminal of the second trigger REG2 is electrically connected to an input terminal of the fifth AND gate G8, and the other input terminal of the fifth AND gate G8 is electrically connected to the output terminal of the third trigger REG3. The output terminal of the fifth AND gate G8 is electrically connected to an input terminal of the third OR gate G10, the output terminal of the third trigger REG3 is electrically connected to the input terminal of the second NOT gate G9, and the output terminal of the second NOT gate G9 is electrically connected to the other input terminal of the third OR gate G10. The output terminal of the third OR gate G10 is electrically connected to an input terminal of the sixth AND gate G11, the first input enable signal is connected to the other input terminal of the sixth AND gate G11, and the output terminal of the sixth AND gate G11 is electrically connected to the signal input terminal of the fourth trigger REG4. The output of the second input enable signal output by the fourth trigger REG4 is:
[0067] SPK_EN_ACT=SPK_EN&((!MIC_EN_ACT)|(MIC_EN_ACT&RisedgeFound{p,q,m,n}).
[0068] Among them, SPK_EN_ACT is the second output enable signal, SPK_EN is the first output enable signal, MIC_EN_ACT is the second input enable signal, m is the first upsampling clock phase, n is the first downsampling filter phase, p is the second upsampling clock phase and q is the second downsampling filter phase, RisedgeFound{p,q,m,n} is the output of the second trigger, when {p,q,m,n} is a preset value, RisedgeFound{p,q,m,n} is a high level, and when {p,q,m,n} is a non-preset value, RisedgeFound{p,q,m,n} is a low level.
[0069] See also Figure 1 and Figure 2 As shown, in one embodiment of the present invention, when the first output enable signal is at a high level and the first input enable signal is at a low level, the second flip-flop REG2 outputs a low level. At this time, the fourth AND gate G7 outputs a low level, and the third flip-flop REG3 outputs a low level, that is, the second input enable signal is at a low level. This causes the second NOT gate G9 to output a high level, the third OR gate G10 to output a high level, and the sixth AND gate G11 to output a high level, and the fourth flip-flop REG4 to output a high level, that is, the second output enable signal is at a high level.
[0070] See also Figure 1 and Figure 2 As shown, in one embodiment of the present invention, when the first output enable signal is at a low level and the first input enable signal is at a high level, the second flip-flop REG2 outputs a low level. At this time, the sixth AND gate G11 outputs a low level, and the fourth flip-flop REG4 outputs a low level, that is, the second output enable signal is at a low level. This causes the first NOT gate G5 to output a high level, the second OR gate G6 to output a high level, and the fourth AND gate G7 to output a high level, and the third flip-flop REG3 to output a high level, that is, the second input enable signal is at a high level.
[0071] See also Figure 1 and Figure 2As shown, in one embodiment of the present invention, when the first output enable signal changes from a low level to a high level, and the first input enable signal changes from a low level to a high level, the second output enable signal and the second input enable signal change as described below. When the first output enable signal and the first input enable signal are at a low level, the outputs of the first trigger REG1, the second trigger REG2, the third trigger REG3 and the fourth trigger REG4 are all at a low level. When the first output enable signal changes to a high level, and the first input enable signal changes to a high level, after the next bus clock passes, the outputs of the third trigger REG3 and the fourth trigger REG4 change to a high level, that is, the second output enable signal and the second input enable signal are both at a high level. At the same time, since the counters of the first up-sampling clock phase, the first down-sampling filter phase, the second up-sampling clock phase, and the second down-sampling filter phase are the same at the beginning of the startup, for example, they are all preset values 0, and the synchronization trigger L0 outputs a high level. The first AND gate G1 outputs a high level, and the second trigger REG2 outputs a high level. When the second flip-flop REG2 outputs a high level, and the first output enable signal is a high level, the third AND gate G4 outputs a high level, the second OR gate G6 outputs a high level, and the fourth AND gate G7 outputs a high level, then the third flip-flop REG3 outputs a high level, and the second input enable signal remains at a high level. When the second flip-flop REG2 outputs a high level, and the first input enable signal is a high level, the fifth AND gate G8 outputs a high level, the third OR gate G10 outputs a high level, and the sixth AND gate G11 outputs a high level, then the fourth flip-flop REG4 outputs a high level, and the second output enable signal remains at a high level. That is, when the first output enable signal and the first input enable signal are synchronously changed from a low level to a high level, the counters of the first up-sampling clock phase, the first down-sampling filter phase, the second up-sampling clock phase, and the second down-sampling filter phase are all preset values 0 (n', m', p', q'), at this time, the first output enable signal and the first input enable signal have the same phase, and the second output enable signal and the second input enable signal are also consistent, and can be directly output.
[0072] See also Figure 1 and Figure 2As shown, in one embodiment of the present invention, when the first output enable signal is at a high level and the first input enable signal changes from a low level to a high level, the second output enable signal and the second input enable signal change as described below. When the first output enable signal is at a high level and the first input enable signal is at a low level, the first trigger REG1 and the second trigger REG2 both output a low level, the third trigger REG3 outputs a low level, and the fourth trigger REG4 outputs a high level. That is, at this time, the second output enable signal is at a high level and the second input enable signal is at a low level. When the first input enable signal changes from a low level to a high level, if the values of the counters are not equal, the synchronous trigger L0 outputs a low level, and the second trigger REG2 still outputs a low level. Then the first NOT gate G5 outputs a low level, the third AND gate G4 outputs a low level, the second OR gate G6 outputs a low level, then the fourth AND gate G7 outputs a low level, and the third trigger REG3 outputs a low level. That is, the second input enable signal is still at a low level. Only when the counters of the first up-sampling clock phase, the first down-sampling filter phase, the second up-sampling clock phase, and the second down-sampling filter phase meet the preset value, for example, 0, the synchronous trigger L0 outputs a high level. At this time, the first AND gate G1 outputs a high level, the first OR gate G2 outputs a high level, the second trigger REG2 outputs a high level, the third AND gate G4 outputs a high level, the second OR gate G6 outputs a high level, then the fourth AND gate G7 outputs a high level, and the third trigger REG3 outputs a high level. That is, the second input enable signal is a high level. That is, when the first output enable signal is a high level, and the first input enable signal changes from a low level to a high level, only when the counters of the first up-sampling clock phase, the first down-sampling filter phase, the second up-sampling clock phase, and the second down-sampling filter phase meet the preset value, the second input enable signal can change to a high level, so as to achieve the phase unification of the second input enable signal and the second output enable signal.
[0073] See also Figure 1 and Figure 2As shown, in one embodiment of the present invention, when the first input enable signal is at a high level and the first output enable signal changes from a low level to a high level, the second input enable signal and the second output enable signal change as described below. When the first input enable signal is at a high level and the first output enable signal is at a low level, the first trigger REG1 and the second trigger REG2 both output a low level, the third trigger REG3 outputs a high level, and the fourth trigger REG4 outputs a low level. That is, at this time, the second input enable signal is at a high level and the second output enable signal is at a low level. When the first output enable signal changes from a low level to a high level, if the values of the counters are not equal, the synchronous trigger L0 outputs a low level, and the second trigger REG2 still outputs a low level. Then the second NOT gate G9 outputs a low level, the fifth AND gate G8 outputs a low level, the third OR gate G10 outputs a low level, then the sixth AND gate G11 outputs a low level, and the fourth trigger REG4 outputs a low level. That is, the second output enable signal is still at a low level. Only when the counters of the first up-sampling clock phase, the first down-sampling filter phase, the second up-sampling clock phase, and the second down-sampling filter phase meet the preset value, for example, 0, the synchronous trigger L0 outputs a high level. At this time, the first AND gate G1 outputs a high level, the first OR gate G2 outputs a high level, the second trigger REG2 outputs a high level, the fifth AND gate G8 outputs a high level, the third OR gate G10 outputs a high level, then the sixth AND gate G11 outputs a high level, and the fourth trigger REG4 outputs a high level. That is, the second output enable signal is a high level. That is, when the first input enable signal is a high level, and the first output enable signal changes from a low level to a high level, only when the counters of the first up-sampling clock phase, the first down-sampling filter phase, the second up-sampling clock phase, and the second down-sampling filter phase meet the preset value, the second input enable signal can become a high level, so that the second output enable signal and the second input enable signal are in phase unity.
[0074] See also Figure 1 As shown, the synchronization module 60 described above can perform logical operations on the first output enable signal and the first input enable signal from the system to generate a synchronization enable signal, a second output enable signal, and a second input enable signal, to ensure that no matter whether the speaker 107 or the microphone 202 is started first, at the moment when the voice echo cancellation is finally started, the count value of {p, q, m, n} of the main sampling rate change is consistent each time the voice echo cancellation is started.
[0075] See also Figure 1 As shown, in one embodiment of the present invention, after the synchronization module 60 synchronizes the first output enable signal and the first input enable signal into the second output enable signal and the second input enable signal, the counter needs to be reset, wherein the reset counter and the initialization signal of the reset counter are:
[0076] ini_ref=SPK_EN_ACT&(~SPK_EN_ACT_DLY);
[0077] ini_mic=MIC_EN_ACT&(~MIC_EN_ACT_DLY);
[0078] Among them, ~SPK_EN_ACT_DLY and ~MIC_EN_ACT_DLY are set delay clock cycle signals, and the frequencies of ~SPK_EN_ACT_DLY and ~MIC_EN_ACT_DLY are much higher than the first frequency and the second frequency. ini_ref is an initialization signal related to the reference signal, and ini_mic is an initialization signal related to the microphone.
[0079] Under this condition, when SPK_EN_ACT / MIC_EN_ACT is high, SPK_EN_ACT_DLY and MIC_EN_ACT_DLY are still low, which indicates that a rising edge of SPK_EN_ACT has occurred, and a cyclic ini_ref signal will appear at this time.
[0080] See also Figure 1 As shown, in a specific embodiment of the present invention, when the speaker sampling rate is 48kHz, the microphone sampling rate is 25kHz, and a unified output sampling rate of 30kHz is required. When the counter value of the first up-sampling clock phase is M=5, the counter value of the first down-sampling filter phase is N=6, the counter value of the second up-sampling clock phase is P=5, and the counter value of the second down-sampling filter phase is Q=8, the audio signal processing system is simulated, and when the speaker is enabled first and the microphone is enabled later, the first input enable signal is synchronized at 3800us and the second input enable signal is synchronized at 16500us. When the microphone is enabled first and the speaker is enabled later, the first output enable signal is synchronized at 24400us and the second output enable signal is synchronized at 36700us. When the speaker and then the microphone are enabled at the same time, they are synchronized at 79600us. It can be seen from the simulation results that this synchronization module can synchronize the sampling time of the microphone and speaker data within a very small range (that is, when the counter values P, Q, M, and N are all 0). This ensures that whenever voice echo cancellation is required (that is, when the speaker and microphone work at the same time), the valid speaker input data and microphone input data are always in the same alignment state, thereby ensuring that the AEC training convergence results can be reused.
[0081] In summary, the audio signal processing system provided by the present invention includes a sound output module for converting digital signals into analog signals, a sound input module for collecting sound signals and converting analog signals into digital signal inputs, an output signal collection and sampling rate conversion module for collecting sound output signals, an input signal sampling rate conversion module for collecting sound input signals, a control module for outputting a first output enable signal and a first input enable signal, and a synchronization module for synchronizing the sound output signal with the sound input signal. After the synchronization module synchronizes the sound output signal with the sound input signal, the voice echo can be eliminated by voice echo cancellation, which can improve the quality of voice echo cancellation and reduce the power consumption of the audio processing system.
Claims
1. An audio signal processing system, characterized in that: include: An output signal acquisition and sampling rate conversion module acquires a first upsampling clock phase and a first downsampling filter phase of a current sound output signal, wherein the first upsampling clock phase is a phase difference between the upsampled sound output signal and the original sound output signal, and the first downsampling filter phase is a phase difference between the downsampled sound output signal and the upsampled output signal; An input signal acquisition and sampling rate conversion module is used to acquire a second upsampling clock phase and a second downsampling filter phase of a current sound input signal, wherein the second upsampling clock phase is a phase difference between the upsampled sound input signal and the original sound output signal, and the second downsampling filter phase is a phase difference between the downsampled sound input signal and the upsampled input signal; as well as A synchronization module is electrically connected to the output signal acquisition and sampling rate conversion module and the input signal acquisition and sampling rate conversion module. When the first upsampling clock phase, the first downsampling filter phase, the second upsampling clock phase and the second downsampling filter phase are the same and are preset values, an enable signal of the sound output signal and the sound input signal is output, and voice echo cancellation is started.
2. The audio signal processing system according to claim 1, characterized in that: The synchronization module includes a synchronization trigger, which is electrically connected to the output signal acquisition and sampling rate conversion module and the input signal acquisition and sampling rate conversion module. When the first upsampling clock phase, the first downsampling filter phase, the second upsampling clock phase and the second downsampling filter phase are the same and are preset values, the synchronization trigger outputs a high level.
3. An audio signal processing system according to claim 2, characterized in that: The synchronization module comprises: A first trigger, a signal input terminal of which is electrically connected to an output terminal of the synchronization trigger; A second trigger connected to the output terminal of the first trigger through a logic circuit; and A second AND gate, having an input terminal inputting a first output enable signal and a first input enable signal, and an output terminal electrically connected to enable terminals of the first trigger and the second trigger; When the synchronous flip-flop outputs a high level, and the first output enable signal and the first input enable signal are at a high level, the second flip-flop outputs a high level.
4. The audio signal processing system according to claim 3, characterized in that: The synchronization module comprises: A first AND gate, whose input terminal is electrically connected to the output terminal of the first trigger and the output terminal of the synchronous trigger; and The first OR gate has an input terminal electrically connected to the output terminal of the first AND gate and the output terminal of the second trigger, and an output terminal electrically connected to the input terminal of the second trigger.
5. The audio signal processing system according to claim 3, characterized in that: The synchronization module comprises: a third trigger, whose input terminal is electrically connected to the first input enable signal, the output terminal of the second trigger and the enable signal of the sound output signal through a logic circuit, and outputs the enable signal of the sound input signal; and The fourth trigger has an input end electrically connected to the first output enable signal, the output end of the second trigger and the enable signal of the sound input signal through a logic circuit, and outputs the enable signal of the sound output signal.
6. The audio signal processing system according to claim 5, characterized in that: The output of the third flip-flop is: MIC_EN_ACT=MIC_EN&((!SPK_EN_ACT)|(SPK_EN_ACT&RisedgeFound{p,q,m,n}); Among them, MIC_EN_ACT is the second input enable signal, that is, the enable signal of the sound input signal, MIC_EN is the first input enable signal, SPK_EN_ACT is the second output enable signal, that is, the enable signal of the sound output signal, m is the first upsampling clock phase, n is the first downsampling filter phase, p is the second upsampling clock phase and q is the second downsampling filter phase, and RisedgeFound{p,q,m,n} is the output of the second trigger.
7. The audio signal processing system according to claim 5, characterized in that: The synchronization module also includes: A third AND gate, an input end of which is electrically connected to the output end of the second trigger and the output end of the fourth trigger; A first NOT gate, an input end of which is electrically connected to the output end of the fourth trigger; a second OR gate, whose input terminal is electrically connected to the output terminals of the third AND gate and the first NOT gate; and A fourth AND gate has an input terminal electrically connected to the output terminal of the second OR gate and the first input enable signal, and an output terminal electrically connected to the third trigger.
8. The audio signal processing system according to claim 5, characterized in that: The output of the fourth flip-flop is: SPK_EN_ACT=SPK_EN&((!MIC_EN_ACT)|(MIC_EN_ACT&RisedgeFound{p,q,m,n}); Among them, SPK_EN_ACT is the second output enable signal, that is, the enable signal of the sound output signal, SPK_EN is the first output enable signal, MIC_EN_ACT is the second input enable signal, that is, the enable signal of the sound input signal, m is the first upsampling clock phase, n is the first downsampling filter phase, p is the second upsampling clock phase and q is the second downsampling filter phase, and RisedgeFound{p,q,m,n} is the output of the second trigger.
9. The audio signal processing system according to claim 5, characterized in that: The synchronization module also includes: a fifth AND gate, an input terminal of which is electrically connected to the output terminal of the second trigger and the output terminal of the third trigger; A second NOT gate, an input end of which is electrically connected to the output end of the third trigger; a third OR gate, whose input terminal is electrically connected to the output terminal of the fifth AND gate and the output terminal of the second NOT gate; and A sixth AND gate has an input end electrically connected to the output end of the third OR gate and the first output enable signal, and an output end electrically connected to the fourth trigger.
10. The audio signal processing system according to claim 1, characterized in that: The audio signal processing system further includes a first variable sampling filter, which performs variable sampling on the sound output signal, and a variable sampling multiple of the first variable sampling filter is the first up-sampling clock phase / the first down-sampling filter phase.
11. The audio signal processing system according to claim 1, characterized in that: The audio signal processing system further includes a second variable sampling filter, which performs variable sampling on the sound input signal, and a variable sampling multiple of the second variable sampling filter is a second up-sampling clock phase / a second down-sampling filter phase.
12. A method for processing an audio signal, Its characteristics are as described above, including the following steps: Collecting a first upsampling clock phase and a first downsampling filter phase of a current sound output signal, wherein the first upsampling clock phase is a phase difference between the upsampled sound output signal and the original sound output signal, and the first downsampling filter phase is a phase difference between the downsampled sound output signal and the upsampled output signal; Collecting a second upsampling clock phase and a second downsampling filter phase of the current sound input signal, wherein the second upsampling clock phase is a phase difference between the upsampled sound input signal and the original sound output signal, and the second downsampling filter phase is a phase difference between the downsampled sound input signal and the upsampled input signal; When the first up-sampling clock phase, the first down-sampling filter phase, the second up-sampling clock phase and the second down-sampling filter phase are the same and are preset values, an enable signal of a sound output signal and a sound input signal is output, and speech echo cancellation is started.
