Audio codec and audio codec system
By introducing the ANC noise reduction processing unit into the audio codec and using hardware circuits to generate reverse noise and noise superposition, the problems of high cost and long delay in the audio codec system are solved, and the noise reduction performance and noise reduction bandwidth are improved. .
Patent Information
- Application Number
- CN202311093714.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-28
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2043-08-28
AI Technical Summary
Existing audio coding and decoding systems have problems such as high audio coding and decoding costs and long delays, resulting in poor noise reduction performance, especially inability to deal with low-frequency noise.
An audio codec is designed, including an analog-to-digital conversion unit, an ANC noise reduction processing unit, a data processing and transmission unit, a mixing unit and a digital-to-analog conversion unit. ANC noise reduction is achieved through hardware coding and decoding, resulting in opposite phases and the same amplitude. The reverse noise and noise superposition simplify the system architecture and reduce delay.
It reduces system delay, improves noise reduction performance and noise reduction bandwidth, simplifies system design and user complexity, and saves power consumption.
Smart Images

Figure CN117198303B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of audio technology, and in particular to an audio codec and an audio codec system. Background Art
[0002] With the progress of society and the development of science and technology, more and more noises appear in people's lives. These noises not only affect our normal work and life, making it difficult for us to hear the voice of the person on the other end of the phone clearly in a noisy environment, but also are not conducive to our physical and mental health. For example, people who often live or work in a noisy environment will have bad emotions such as anger, anxiety, irritability, and even insomnia in severe cases. In addition, with the improvement of consumption levels and the change of consumption awareness, people have higher and higher requirements for music quality and call quality, and the existence of noise reduces the user experience. Blindly increasing the volume will not only damage our hearing, but also the problem of "becoming clear" has not been substantially solved.
[0003] Noise cancellation technology is divided into two categories: active noise reduction and passive noise reduction. The principles of these two technologies are different. The principle of passive noise reduction is to block or absorb noise signals outside the ears through material absorption or blocking, thereby achieving partial noise cancellation. However, this technology only solves some high-frequency noise signals with shorter wavelengths, and is powerless against low-frequency noise signals with longer wavelengths. Active noise reduction is achieved by actively emitting "reverse noise" with the same amplitude and opposite phase as the noise signal through the noise reduction device, using the principle of sound wave superposition to offset the noise signal, thereby achieving the effect of active noise reduction.
[0004] The current active noise reduction solution is to use DSP to run the active noise reduction algorithm. The first method is as follows Figure 1 The architecture of the DSP is shown in Figure 1. Figure 1 As can be seen, the system delay path of the main processor built-in DSP solution is very long, including the delay of signal acquisition, the codec conversion and caching of audio streams, and the transmission delay of the data interface between chips, the main processor internal bus routing, arbitration, data handling and other delays, DSP business switching, software scheduling delay, DSP running algorithm delay, data transmission back to the codec data interface delay, codec caching, conversion processing delay of audio streams, and finally the delay of sound signal transmission. The total system delay is generally more than 100 milliseconds. The second method is as follows Figure 2As shown in the figure, the DSP architecture is built into the audio encoder. Compared with the solution with DSP built into the main processor, the system delay of the codec with DSP built into the codec reduces the delay of data interaction between chips and other uncertain delays such as bus routing, arbitration, and data transfer in the main processor. However, the delay of this solution still includes DSP service switching, software scheduling delay, data format conversion on the path, data caching, data transfer and other delays. The total system delay is generally more than ten milliseconds.
[0005] The corresponding relationship between audio codec system delay and noise reduction performance is as follows: Figure 3 As shown, it can be seen that the smaller the delay, the better the noise reduction performance, and the larger the delay, the worse the noise reduction performance, and even rebound occurs at high frequencies, which means that the noise and the reverse noise are positively superimposed, increasing the noise signal, which is not expected. According to the principle of active noise reduction, the reverse noise should be generated as early as possible in order to achieve the best effect of cancellation. Therefore, the total system delay of the electrical path should be as small as possible, otherwise the cancellation effect will be reduced and the noise reduction performance will be reduced accordingly.
[0006] The currently feasible optimization of the above two solutions is to use DSP, data handling module, data transmission interface and other modules that may be used by multiple modules separately for active noise reduction. Other services shall not occupy them after the ANC service is turned on to avoid resource grabbing, thus reducing delays such as software scheduling and bus arbitration. However, this optimization solution has the following disadvantages: increased chip area and cost; more complex system architecture, and increased system power consumption. Summary of the invention
[0007] In view of the above-mentioned shortcomings of the prior art, an object of the present invention is to provide an audio codec and an audio codec system, so as to solve the problems of high cost and long delay of audio codec in the prior art.
[0008] To achieve the above-mentioned and other related purposes, the present invention provides an audio codec, comprising at least an analog-to-digital conversion unit, an ANC noise reduction processing unit, a data processing and transmission unit, a mixing unit, a digital-to-analog conversion unit, and an audio interface;
[0009] The analog-to-digital conversion unit is connected to an analog input signal, and the analog-to-digital conversion unit processes the analog input signal to obtain an audio input signal;
[0010] The first input end of the data processing and transmission unit is connected to the output end of the analog-to-digital conversion unit, and the first output end of the data processing and transmission unit is connected to the input end of the audio interface; the data processing and transmission unit processes the audio input signal and transmits it through the audio interface;
[0011] The second input end of the data processing and transmission unit is connected to the output end of the audio interface, and the second output end of the data processing and transmission unit is connected to the second input ends of the ANC noise reduction processing unit and the mixing unit; the data processing and transmission unit transmits the digital audio signal obtained by processing the multimedia sound output through the audio interface to the ANC noise reduction processing unit and the mixing unit;
[0012] The ANC noise reduction processing unit is connected to the output end of the analog-to-digital conversion unit; the ANC noise reduction processing unit receives the audio input signal and the digital audio signal, and processes the audio input signal and the digital audio signal to obtain reverse noise;
[0013] The first input end of the mixing unit is connected to the output end of the ANC noise reduction processing unit, and the mixing unit performs mixing and superposition processing on the reverse noise and the digital audio signal to obtain a mixed audio signal;
[0014] The input end of the digital-to-analog conversion unit is connected to the output end of the mixing unit, and the digital-to-analog conversion unit processes the mixed audio signal and then outputs an analog output signal.
[0015] Preferably, the data transmission processing unit includes a first data matching module and a second data matching module;
[0016] The input end of the first data matching module is connected to the output end of the analog-to-digital conversion unit, and the output end of the first data matching module is connected to the input end of the audio interface; the first data matching module converts the format of the audio input signal and transmits it through the audio interface;
[0017] The input end of the second data matching module is connected to the output end of the audio interface, and the output end of the second data matching module is the output end of the data processing and transmission unit; the second data matching module transmits the digital audio signal obtained after format conversion of the multimedia sound.
[0018] Preferably, the format conversion performed by the first data matching module and the second data matching module at least includes matching of sampling rates and matching of signal bit widths.
[0019] Preferably, the data transmission processing unit further includes a first data cache module and a second data cache module;
[0020] The input end of the first data cache module is connected to the output end of the first data matching module, and the output end of the first data cache module is connected to the input end of the audio interface; the signal output by the first data matching module is cached via the audio interface;
[0021] The input end of the second data cache module is connected to the output end of the audio interface, and the output end of the second data cache module is connected to the input end of the second data matching module; the second data cache module caches the multimedia sound and transmits it to the second data matching module.
[0022] Preferably, the reverse noise and the audio input signal have opposite phases and the same amplitudes.
[0023] Preferably, the analog input signal at least includes a reference audio stream and an error audio stream, and correspondingly, the audio input signal after analog-to-digital conversion includes a reference audio signal and an error audio signal.
[0024] Preferably, the ANC noise reduction processing unit includes a feedforward branch, a feedback branch and a mixing module;
[0025] The feedforward branch input is connected to the reference audio signal, and the feedforward branch output is connected to the first input end of the mixing module; the feedforward branch performs adaptive filtering on the reference audio signal to obtain a feedforward reverse noise signal;
[0026] The feedback branch input is connected to the error audio signal and the digital audio signal, and the feedback branch output is connected to the second input end of the mixing module; the feedback branch performs adaptive filtering on the error audio signal and the digital audio signal to obtain a feedback reverse noise signal;
[0027] The mixing module receives the feedforward reverse noise signal and the feedback reverse noise signal, and processes the feedforward reverse noise signal and the feedback reverse noise signal to obtain the reverse noise.
[0028] Preferably, the feedforward branch includes a first data conversion module and a feedforward processing module;
[0029] The input of the first data conversion module is connected to the reference audio signal, the output of the first data conversion module is connected to the input end of the feedforward processing module, and the output end of the feedforward processing module is connected to the first input end of the mixing module;
[0030] The first data conversion module converts the reference audio signal and then performs adaptive filtering processing on the reference audio signal by the feedforward processing module to obtain the feedforward reverse noise signal.
[0031] Preferably, the feedback branch includes a second data conversion module, a compensation module, a mixing submodule and a feedback processing module;
[0032] The input of the second data conversion module is connected to the error audio signal, and the output of the second data conversion module is connected to the first input end of the mixing submodule; the input of the compensation module is connected to the digital audio signal, and the output of the compensation module is connected to the second input end of the mixing submodule;
[0033] The signal after the error audio signal is converted by the second data conversion module and the signal after the digital audio signal is compensated by the compensation module are transmitted to the mixing submodule for mixing processing;
[0034] The output end of the mixing submodule is connected to the input end of the feedback processing module, and the feedback processing module performs adaptive filtering on the signal after the mixing processing to obtain the feedback reverse noise signal.
[0035] To achieve the above-mentioned purpose and other related purposes, the present invention also provides an audio codec system, comprising a main processor, an audio input device, an audio output device and the audio codec as described above; the audio input device is used to collect analog input signals; the input end of the audio codec is connected to the audio input device, and the output end of the audio codec is connected to the audio output device; the control interface and data interface of the audio codec are both connected to the main processor; the audio codec processes the analog input signal to obtain the analog output signal, and the analog output signal is output through the audio output device.
[0036] As described above, the audio codec and audio codec system of the present invention have the following beneficial effects:
[0037] The audio codec system of the present invention comprises a main processor, an audio input device, an audio output device and an audio codec; the audio encoder comprises at least an analog-to-digital conversion unit, an ANC noise reduction processing unit, a data processing and transmission unit, a mixing unit, a digital-to-analog conversion unit and an audio interface; the analog input signal is passed through the analog-to-digital conversion unit to obtain an audio input signal; the data processing and transmission unit processes the audio input signal and transmits it through the audio interface; the data processing and transmission unit processes the multimedia sound output through the audio interface to obtain a digital audio signal and transmits it to the ANC noise reduction processing unit and the mixing unit; the ANC noise reduction processing unit receives and processes the audio input signal and the digital audio signal to obtain reverse noise; the mixing unit performs digital-to-analog conversion on the mixed audio signal obtained by mixing and superimposing the reverse noise and the digital audio signal and outputs an analog output signal. The present invention can generate reverse noise based on the analog input signal while performing hardware encoding and decoding on the audio signal in the ANC noise reduction processing unit of the audio codec, and finally output the analog output signal for superposition and cancellation with the noise of the headset, that is, ANC noise reduction is achieved through pure hardware, and there is no need to run a complex noise reduction algorithm through the built-in DSP core, which can simplify the complexity of system architecture design and user use; at the same time, it also saves software scheduling delay, reduces the processing delay of the entire noise reduction system, and improves the noise reduction performance and noise reduction bandwidth. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a schematic diagram showing the structure of the first implementation method of using DSP to perform active noise reduction in the prior art.
[0039] Figure 2 It is a schematic diagram showing the structure of a second implementation method of using DSP to perform active noise reduction in the prior art.
[0040] Figure 3 The figure shows the corresponding relationship between the audio codec system delay and noise reduction performance.
[0041] Figure 4 Shown is a schematic diagram of the structure of the audio codec of the present invention.
[0042] Figure 5 Shown is a schematic diagram of the hardware structure of the ANC noise reduction processing unit in the audio codec of the present invention.
[0043] Figure 6 Shown is a structural schematic diagram of the audio encoding and decoding system of the present invention. DETAILED DESCRIPTION
[0044] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention.
[0045] See also Figure 4-6 It should be noted that the illustrations provided in this embodiment are only used to illustrate the basic concept of the present invention in a schematic manner, and the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0046] The present invention aims to design an audio codec and an audio codec system with an active noise reduction function, that is, to perform adaptive filtering on an analog input signal and then output reverse noise, which is then mixed with other audio code streams of the codec and sent out to achieve the effect of active noise reduction. In addition, while encoding and decoding the audio signal through the hardware of the audio codec, ANC noise reduction can be achieved through pure hardware, without the need to run a complex noise reduction algorithm through a built-in DSP core, which can simplify the system architecture design and simplify the complexity of user use.
[0047] like Figure 4 FIG. 1 is a schematic diagram showing the structure of the audio codec of the present invention. Figure 5 FIG. 1 is a schematic diagram of the hardware structure of the ANC noise reduction processing unit in the audio codec of the present invention. Figure 4 and Figure 5 The audio codec of the present invention is introduced in detail.
[0048] An audio codec of the present invention comprises at least an analog-to-digital conversion unit, an ANC noise reduction processing unit, a data processing and transmission unit, a mixing unit, a digital-to-analog conversion unit and an audio interface;
[0049] The analog-to-digital conversion unit is connected to an analog input signal, and the analog-to-digital conversion unit processes the analog input signal to obtain an audio input signal;
[0050] The first input end of the data processing and transmission unit is connected to the output end of the analog-to-digital conversion unit, and the first output end of the data processing and transmission unit is connected to the input end of the audio interface; the data processing and transmission unit processes the audio input signal and transmits it through the audio interface;
[0051] The second input end of the data processing and transmission unit is connected to the output end of the audio interface, and the second output end of the data processing and transmission unit is connected to the second input ends of the ANC noise reduction processing unit and the mixing unit; the data processing and transmission unit transmits the digital audio signal obtained by processing the multimedia sound output through the audio interface to the ANC noise reduction processing unit and the mixing unit;
[0052] The ANC noise reduction processing unit is connected to the output end of the analog-to-digital conversion unit; the ANC noise reduction processing unit receives the audio input signal and the digital audio signal, and processes the audio input signal and the digital audio signal to obtain reverse noise;
[0053] The first input end of the mixing unit is connected to the output end of the ANC noise reduction processing unit, and the mixing unit performs mixing and superposition processing on the reverse noise and the digital audio signal to obtain a mixed audio signal;
[0054] The input end of the digital-to-analog conversion unit is connected to the output end of the mixing unit, and the digital-to-analog conversion unit processes the mixed audio signal and then outputs an analog output signal.
[0055] The present invention adopts ANC noise reduction (Active Noise Control). The active noise reduction function is to generate reverse sound waves equal to the external noise through the noise reduction system to neutralize the noise, thereby achieving the effect of net noise (noise reduction); the final sound heard by the human ear is: ambient noise + inverted ambient noise, and the two noises are superimposed to achieve sensory noise reduction. Simply put, the working principle is the interference of sound waves, thereby protecting the user's ears.
[0056] The present invention adds an ANC noise reduction processing unit in the audio codec, and can generate reverse noise based on the analog input signal while encoding and decoding the audio signal through the hardware audio codec. The analog output signal finally generated is used to superimpose with the noise at the earphone to achieve the noise reduction effect, that is, ANC noise reduction is achieved through pure hardware, and there is no need to run a complex noise reduction algorithm through the built-in DSP core, which can simplify the system architecture design and the complexity of user use; at the same time, it also saves software scheduling delay, reduces the processing delay of the entire noise reduction system, and improves the noise reduction performance and noise reduction bandwidth; in addition, do not use a very high clock frequency, which can save the power consumption of the entire audio codec system.
[0057] In the present invention, the analog-to-digital conversion unit samples and quantizes the analog input signal to obtain the audio input signal.
[0058] Specifically, the sampling process is
[0059] x(n)=x(nT),-∞ <n<∞
[0060] x q (n) = Q[x(n)]
[0061] The sampling process is to sample the input analog continuous signal x(t) (analog continuous signal is analog input signal) in discrete time according to the sampling period T, and output x(n);
[0062] Specifically, the quantization process is to discretize the amplitude of the output x(n) of the sampling process through the quantization function Q, and output x q (n).
[0063] The analog-to-digital conversion unit of the present invention converts an analog continuous signal (ie, an analog input signal) into an output digital discrete signal (audio input signal) through two processes of sampling and quantization.
[0064] The data transmission processing unit of the present invention comprises a first data matching module and a second data matching module;
[0065] The input end of the first data matching module is connected to the output end of the analog-to-digital conversion unit, and the output end of the first data matching module is connected to the input end of the audio interface; the first data matching module converts the format of the audio input signal and transmits it through the audio interface;
[0066] The input end of the second data matching module is connected to the output end of the audio interface, and the output end of the second data matching module is the output end of the data processing and transmission unit; the second data matching module transmits the digital audio signal obtained after format conversion of the multimedia sound.
[0067] In the present invention, the format conversion performed by the first data matching module and the second data matching module in the data transmission processing unit at least includes matching of sampling rate and matching of signal bit width.
[0068] Taking the format conversion of the audio input signal as an example, the process of filtering and sampling rate conversion of the audio input signal is as follows:
[0069]
[0070] Where x(n) is the audio input signal output by the analog-to-digital conversion unit, M is the downsampling change factor, I is the upsampling change factor, h(k) is the unit impulse response function, and the output is y d (n) or y u (n).
[0071] Audio input signal to match the signal width
[0072]
[0073] The signal width matching is based on the positive or negative nature of the shift width B, which determines whether the width matching is left-shifted to enlarge or right-shifted to reduce.
[0074] The data transmission processing unit of the present invention further includes a first data cache module and a second data cache module;
[0075] The input end of the first data cache module is connected to the output end of the first data matching module, and the output end of the first data cache module is connected to the input end of the audio interface; the signal output by the first data matching module is cached via the audio interface;
[0076] The input end of the second data cache module is connected to the output end of the audio interface, and the output end of the second data cache module is connected to the input end of the second data matching module; the second data cache module caches the multimedia sound and transmits it to the second data matching module.
[0077] The data cache in the present invention is essentially to cache a certain amount of data in the audio interface to avoid repeated sampling or loss of audio data (i.e., repeated sampling of multimedia sound or loss of audio input signal) due to jitter introduced by system clock design defects on both sides of the audio interface, wherein the audio input signal cached to the audio interface by the first data matching module and the first data cache module is used by the main processor to refer to the audio input signal to generate corresponding control instructions for the ANC noise reduction processing unit.
[0078] In the present invention, multimedia sound is a remote audio signal or a local audio playback; wherein, the remote audio signal refers to an audio signal transmitted from the remote end of the audio interface, and is exemplarily described as a call scenario, a sound transmitted from another remote device (such as mobile phone B) to a local device (such as mobile phone A) through a wireless protocol; and the local audio playback refers to an audio file pre-stored in a storage device connected to the audio interface. The present invention processes the multimedia sound and transmits it to the ANC noise reduction processing unit for the noise reduction compensation algorithm.
[0079] The reverse noise generated by the ANC noise reduction processing unit of the present invention after being processed by the noise reduction algorithm has a relationship of opposite phase and same amplitude with the audio input signal.
[0080] Specifically, the mixing unit of the present invention mixes and superimposes the reverse noise signal and the digital audio signal.
[0081]
[0082] In the formula, there are M input digital audio signals x`(n), and after accumulating them, the output mixed audio signal y(n) is obtained.
[0083] The process of the digital-to-analog conversion unit of the present invention processing the mixed audio signal includes interpolation processing and signal conversion;
[0084] The interpolation process is:
[0085]
[0086] Specifically, the sampling rate is increased to the analog processing sampling rate through the interpolation process, and interpolation fitting is performed between digital sample points.
[0087] v=ky(t)
[0088] Specifically, the input digital discrete signal y(n), i.e. the mixed audio signal, is multiplied by the proportional factor k to obtain the output analog voltage signal v(t), i.e. the analog output signal, thereby realizing the function of converting the discrete digital signal into a continuous analog signal.
[0089] The analog input signal of the present invention may be only one, which is an error audio stream or a reference audio stream; or there may be multiple reference audio streams and multiple error audio streams.
[0090] As a preferred implementation, the analog input signal at least includes a reference audio stream and an error audio stream, and correspondingly, the audio input signal after analog-to-digital conversion includes a reference audio signal and an error audio signal. The present invention is described by taking an example where the analog input signal includes a reference audio stream and an error audio stream.
[0091] The audio input signal output by the analog input signal in the present invention provides the reference source and error source required by the ANC algorithm, and the reference source and the error source can be single or multiple. When the analog input signal includes a reference audio stream and an error audio stream, the noise reduction effect performed by the ANC noise reduction processing unit is better, and the output audio effect is better.
[0092] The ANC noise reduction processing unit of the present invention is the core of the audio codec, that is, the ANC noise reduction is realized through a hardware circuit. Figure 5 The figure shows a schematic diagram of the hardware connection structure of the ANC noise reduction processing unit of the present invention. Then the ANC noise reduction processing unit includes a feedforward branch, a feedback branch and a mixing module;
[0093] The feedforward branch input is connected to the reference audio signal, and the feedforward branch output is connected to the first input end of the mixing module; the feedforward branch performs adaptive filtering on the reference audio signal to obtain a feedforward reverse noise signal;
[0094] The feedback branch input is connected to the error audio signal and the digital audio signal, and the feedback branch output is connected to the second input end of the mixing module; the feedback branch performs adaptive filtering on the error audio signal and the digital audio signal to obtain a feedback reverse noise signal;
[0095] The mixing module receives the feedforward reverse noise signal and the feedback reverse noise signal, and processes the feedforward reverse noise signal and the feedback reverse noise signal to obtain the reverse noise.
[0096] Specifically, the feedforward branch of the present invention includes a first data conversion module and a feedforward processing module;
[0097] The input of the first data conversion module is connected to the reference audio signal, the output of the first data conversion module is connected to the input end of the feedforward processing module, and the output end of the feedforward processing module is connected to the first input end of the mixing module;
[0098] The first data conversion module converts the reference audio signal and then performs adaptive filtering processing on the reference audio signal by the feedforward processing module to obtain the feedforward reverse noise signal.
[0099] Specifically, the feedback branch of the present invention includes a second data conversion module, a compensation module, a mixing submodule and a feedback processing module;
[0100] The input of the second data conversion module is connected to the error audio signal, and the output of the second data conversion module is connected to the first input end of the mixing submodule; the input of the compensation module is connected to the digital audio signal, and the output of the compensation module is connected to the second input end of the mixing submodule;
[0101] The signal after the error audio signal is converted by the second data conversion module and the signal after the digital audio signal is compensated by the compensation module are transmitted to the mixing submodule for mixing processing;
[0102] The output end of the mixing submodule is connected to the input end of the feedback processing module, and the feedback processing module performs adaptive filtering on the signal after the mixing processing to obtain the feedback reverse noise signal.
[0103] Specifically, in the present invention, the first data conversion module converts the reference audio signal into the format required by the active noise reduction algorithm, and the second data conversion module converts the error audio signal into the format required by the active noise reduction algorithm. At the same time, the first data conversion module and the second data conversion module also perform DC compensation processing, signal gain processing, etc.
[0104] The conversion of the reference audio signal or the error audio signal into the format required by the active noise reduction algorithm is sample rate matching, supporting upsampling rate and downsampling rate.
[0105] Specifically, the downsampling rate is
[0106]
[0107] In the formula, y d (n) is the downsampling rate output, x(k) is the input reference audio signal or error audio signal, is the output audio input signal from the analog-to-digital conversion module, M is the downsampling change factor, and h(k) is the unit sample response of the low-pass filter.
[0108] Specifically, the upsampling rate is
[0109]
[0110] In the formula, y u (n) is the upsampling rate output, x(k) is the input reference audio signal or error audio signal, and I is the upsampling variation factor.
[0111] Specifically, the DC compensation process is:
[0112] y dc (n) = y d (n) ±dccp or
[0113] The input is the output y of the sampling rate conversion d (n) or y u (n), the output is dccp is the compensation value
[0114] Specifically, the gain processing is
[0115]
[0116] Where the input is the DC compensated output y dc (n), the output is y g (n), is the gain factor.
[0117] In the feedforward branch of the present invention, the feedforward processing module includes multiple filters, and the filters are cascaded. In the present invention, there are at least 12 cascaded filters; as another method, the number of cascaded filters can be more, and the more cascaded the number is, the finer the algorithm adjustment granularity is, and the better the effect is.
[0118]
[0119] Among them, y B(n) = a0x0(n) + a1x0(n-1) + a2x0(n-2) - b1y(n-1) - b2y(n-2); x0 is the input of a filter, which comes from the output of the data conversion unit, a1, a2, a3, b1, b2 are the coefficients of the filter, which come from the control interface, y B (n) is the output of a filter; It is the function of cascading M filters. The minus sign in front indicates that the reverse signal is generated. The total output y of the cascaded M filters is ff (n) is the feedforward reverse noise signal.
[0120] In the feedback branch of the present invention, the compensation value of the digital audio signal by the compensation module is regarded as the error source of the error residual noise and the error audio signal, and is sent to the feedback processing module for processing and adaptive filtering after mixing. Among them, the compensation module is similar to the structure of the feedforward processing module, including a cascaded filter, the difference is that the coefficient of the filter is different from the actual input, and the compensation module outputs a compensation signal.
[0121] In the feedback branch of the present invention, the feedback processing is similar to the feedforward processing module structure, including cascaded filters. The difference is that the coefficients of the filters are different from the actual inputs. There are at least 12 cascaded filters. Of course, the more cascades there are, the finer the algorithm adjustment granularity and the better the effect.
[0122] Specifically, the feedback reverse noise signal x output by the feedback processing module fb (n) is the difference between the error signal and the compensation signal.
[0123] In the present invention, the mixing module superimposes the feedforward reverse noise signal and the feedback reverse noise signal, and the mixed output is used as the reverse noise as the total output of the ANC noise reduction processing unit.
[0124]
[0125] Among them, y(n) is the reverse noise, y ff (n) is the feedforward reverse noise signal, is the feedback reverse noise signal.
[0126] The audio codec of the present invention also includes an interface conversion unit; the interface conversion unit is connected to the ANC noise reduction processing unit; the interface conversion unit converts the protocol format of the control interface into an internal register access format, and is used to convert the format of the control instruction and transmit it to the ANC noise reduction processing unit to control the operation mode of the ANC noise reduction processing unit.
[0127] In the present invention, the interface protocol may be an interface protocol such as I2C, Soundwire, Slimbus, HDA, etc.
[0128] The interface conversion unit of the present invention is also used to perform parameter configuration and status reading on the codec;
[0129] The audio codec of the present invention realizes adaptive filtering processing of the hardware circuit through the ANC noise reduction processing unit, does not require an additional DSP processor, and simplifies the complexity of user use.
[0130] Embodiment 2
[0131] The present invention also provides an audio codec system, comprising a main processor, an audio input device, an audio output device and an audio codec; the audio input device is used to collect analog input signals; the input end of the audio codec is connected to the audio input device, and the output end of the audio codec is connected to the audio output device; the control interface and data interface of the audio codec are both connected to the main processor; the audio codec processes the analog input signal to obtain the analog output signal, and the analog output signal is output through the audio output device.
[0132] Specifically, the audio input device is configured as a digital microphone, an analog microphone, a sensor, or other forms of sound-to-electricity conversion devices, which can be single-channel or multi-channel, and completes the function of converting sound signals into electrical signals. Its input is a sound wave signal, and its output is a voltage signal.
[0133] Specifically, the audio codec is a device that encodes / decodes audio data, converting audio data from one format to another format to reduce data calculation, transmission and storage costs. Its basic structure generally includes three parts. The first part is the uplink (recording) path, including an analog-to-digital conversion unit, a data format conversion unit, a data cache unit, and a data interface; the second part is the downlink (playing) path, including a data cache unit, a data format conversion unit, a mixing unit (multiple audio streams), and a digital-to-analog conversion unit; the third part is a control interface. The audio codec system of the present invention adds an active noise reduction processing unit to the architecture of a conventional audio codec system to form an audio codec system with an active noise reduction function. Among them, the active noise reduction processing unit performs adaptive filtering processing on the real-time analog input signal collected by the audio input, outputs reverse noise, and the reverse noise is mixed with other audio code streams of the codec device and then emitted to achieve the effect of active noise reduction.
[0134] The audio codec has been introduced in detail in the first embodiment and will not be described in detail here.
[0135] In the present invention, the control interface connects the main processor and the audio codec, and the control instructions issued by the main processor to the audio codec are transmitted to the audio codec through the control interface. Correspondingly, the audio codec feeds back the channel of its status to the main processor through the control interface, specifically supporting interface protocols such as I2C, Soundwire, Slimbus, HDA, etc.
[0136] In the present invention, the data interface is a channel for audio data interaction between the main processor and the audio codec. For example, the original analog input signal is processed and transmitted to the main processor through the data interface. The main processor transmits multimedia sound (remote audio signal or local playback audio) to the audio codec through the data interface. The data interface can support interface protocols such as I2S / PCM / TDM, Soundwire, Slimbus, HDA, etc.
[0137] The main processor of the present invention refers to the SOC (System On Chip) processing chip, which is responsible for the main control function of the device, receives and processes the audio data of the audio codec upstream, or transmits the audio data to the audio codec downstream channel for further processing. At the same time, through the control interface, the state of the audio codec is monitored, or parameter configuration is issued to it. When the ANC service is turned on, the received reference audio signal will also be detected and classified for special noise types to control the codec system to switch the different working modes of the ANC noise reduction unit in different noise scenes, such as noise reduction mode, transparent mode, and closed mode. The noise reduction mode is to make the ANC processing unit generate reverse noise and noise superposition to cancel the noise; the transparent mode is to make the ANC processing unit amplify the noise signal (beneficial noise signal) to compensate for the passive noise reduction of the audio device (such as headphones) The situation of the noise signal becoming smaller; the closed mode is that some special noises will cause the ANC system to be unstable, and may produce undesirable sounds that affect the user's hearing. Compared with the noise reduction effect, it is more desirable to reduce the impact of this noise on the system and the user, so the ANC will be turned off.
[0138] The audio output device of the present invention is configured as a receiver, a speaker or a headset; specifically, it can be a combination of one or more, and can be single-channel or multi-channel, completing the function of converting electrical signals into sound signals. The analog output signal is input to the audio output device in the form of a voltage signal, and the analog output signal is output through the audio output device in the form of a sound wave signal.
[0139] To better understand the audio codec system, the audio codec system is described below with reference to a specific example.
[0140] In an embodiment of the present invention, the audio input device is configured as a microphone of the headset. The microphone collects the surrounding analog input signal (noise signal) and transmits the analog input signal to the audio codec system for adaptive filtering to generate reverse noise; the main processor sends the multimedia sound (remote audio signal or local playback audio) to the audio codec through the data interface, and the audio codec mixes the multimedia sound and the reverse noise. The analog audio signal output by the audio codec is emitted through the speaker of the headset, at which time it is superimposed with the external noise. After the specific noise is superimposed and offset with the reverse noise in the analog audio signal, only the multimedia sound remains and is finally sent to the ear to be heard by the user.
[0141] More specifically, the workflow of the audio codec system includes:
[0142] S1, real-time acquisition of analog input signal;
[0143] The present invention collects surrounding analog input signals in real time through a microphone outside the earphone (the analog input signal can be only noise, or noise and voice audio), converts the analog input signal into an analog voltage signal and then inputs it into an audio codec;
[0144] S2, processing the analog input signal to obtain an audio input signal;
[0145] The audio codec of the present invention receives an audio input signal of an analog voltage signal and performs sampling and quantization processing to obtain the audio input signal.
[0146] S3, processing the multimedia sound to obtain a digital audio signal;
[0147] The multimedia sound in the present invention is a remote audio signal or a local audio playback; wherein the remote audio signal refers to an audio signal transmitted from the remote end of the audio interface, and the local audio playback refers to a pre-stored audio file. The present invention performs data caching and data matching processing on the multimedia sound and transmits it to the ANC noise reduction processing unit for the ANC noise reduction compensation algorithm.
[0148] S4, performing adaptive filtering on the digital audio signal and the audio input signal to obtain reverse noise;
[0149] In the present invention, performing adaptive filtering on the digital audio signal and the audio input signal to obtain reverse noise comprises the following steps:
[0150] S41, processing a reference audio signal in the audio input signal to obtain a feedforward reverse noise signal;
[0151] Specifically, the signal converted from the reference audio signal is sent to the filter of the feedforward processing module for processing to generate a feedforward reverse noise signal.
[0152] S42, processing the digital audio signal and the error audio signal in the audio input signal to obtain a feedback reverse noise signal;
[0153] Since the error microphone placed at the headphone speaker will collect a signal mixed with residual noise and music signals, the music signal needs to be removed and reverse noise is generated only based on the residual noise signal. Therefore, the music signal needs to be compensated in advance. Specifically, the digital audio signal is compensated to obtain a compensated signal; the compensated multimedia signal and the speaker signal recorded by the error microphone are mixed, which is equivalent to the signal coming out of the speaker, minus the music signal, leaving only the residual signal.
[0154] The error audio signal is converted to obtain an error signal; the error signal and the compensation signal are mixed and sent to the filter unit of the feedback processing module for adaptive filtering to obtain a feedback reverse noise signal.
[0155] S43, mixing the feedforward reverse noise signal and the feedback reverse noise signal to obtain the reverse noise.
[0156] In the embodiment of the present invention, the signals after feedforward and feedback adaptive filtering (ie, feedforward reverse noise signal and feedback reverse noise signal) are mixed to obtain a total reverse noise signal (ie, reverse noise).
[0157] S5, performing mixing and superposition processing on the reverse noise and the digital audio signal to obtain a mixed audio signal;
[0158] The present invention performs mixed and superimposed processing on the reverse noise processed by the ANC noise reduction unit and the digital audio signal to obtain a mixed audio signal.
[0159] S6, processing the mixed audio signal to output the analog output signal.
[0160] The present invention performs sampling rate increase and digital-to-analog conversion on the mixed audio signal, specifically, the sampling rate of the mixed audio signal in digital form is increased to 6.144MHz format, and then converted into an analog output signal in analog form, and the analog output signal in analog form is emitted through an audio output device (i.e., a speaker). The analog output signal includes reverse noise and multimedia sound, and the reverse noise and the noise signal are superimposed at the ear, the noise signal is offset, and the remaining pure music signal is heard by the user.
[0161] In the present invention, the working process of the audio coding and decoding system further includes: processing the audio input signal and transmitting it through an audio interface.
[0162] Specifically, the audio input signal is format converted into a 192KHz, 24-bit data format, and then transmitted through the audio interface and cached to the main processor.
[0163] In the present invention, the working process of the audio codec system also includes: processing the audio input signal to determine the noise type, and generating different control instructions according to the noise type, and the control instructions are used to control the working mode of the ANC noise reduction processing unit.
[0164] The main processor of the present invention obtains the reference noise signal of the audio input signal through the data interface, runs the noise scene detection algorithm, and determines the noise type; for different scene noises, different filter parameters are sent to the ANC noise reduction processing unit in the audio codec through the control interface, so that the reverse noise characteristics generated by it match the current environmental noise, bringing a better noise reduction experience.
[0165] The audio codec system of the present invention supports a noise transparency mode. The main processor sends a control instruction to the ANC noise reduction processing unit according to the parameters of the transparency mode after judgment. The ANC noise reduction processing unit realizes smooth mode switching by smoothing the two sets of parameters before and after, thereby minimizing the impact on the user's hearing experience.
[0166] The audio codec system proposed in the present invention supports cooperating with the main processor to implement a more flexible noise reduction solution. The codec sends the reference audio signal in the audio input signal to the main processor through the data interface. The main processor runs a noise type detection algorithm to detect special noises, such as wind noise, burst pulse noise, etc. When different scene noises are detected, the main processor sends different instructions to the codec through the control interface. For example, when special noises such as wind noise and burst pulses occur, the active noise reduction system is turned off to avoid user hearing discomfort caused by improper processing of the path where the feedback processing unit is located and untimely howling.
[0167] The audio codec system of the present invention realizes ANC noise reduction through hardware circuits by adding an ANC noise reduction processing unit in the audio codec, specifically, by joint processing of the hardware circuit of the ANC noise reduction processing unit and a main processor.
[0168] The present invention does not need a built-in DSP core to run a noise reduction algorithm, thereby simplifying the architecture design of the audio codec system and simplifying the complexity of user use; and does not need to provide a very high clock frequency to the DSP, which can simplify the chip clock solution and save chip power consumption; and while not needing a built-in DSP, it can reduce the settings of DSP auxiliary modules, further directly reducing the chip area and saving costs.
[0169] The present invention omits DSP and is implemented purely by hardware. The system delay only includes data acquisition delay, ANC noise reduction processing delay, data transmission delay, etc., which greatly reduces the total delay of the audio codec system, which is generally less than 30 microseconds, that is, it has the shortest system processing delay. The smaller the delay, the better the phase of the reverse noise generated by the electrical path can match the noise of the acoustic path, and the better the noise signal can be offset, that is, the phases of the two sound waves of noise and "reverse noise" can be matched (reverse) to the greatest extent, which greatly improves the ANC noise reduction performance.
[0170] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. An audio codec system, It is characterized in that Includes a main processor, an audio input device, an audio output device, and an audio codec; The audio input device is used to collect analog input signals; The input end of the audio codec is connected to the audio input device, and the output end of the audio codec is connected to the audio output device; The control interface and data interface of the audio codec are both connected to the main processor; the control instructions issued by the main processor to the audio codec are transmitted to the audio codec through the control interface; The main processor monitors the state of the audio codec or sends parameter configuration to it through the control interface; when the ANC service is turned on, it also detects and classifies the special noise type of the received reference audio signal to control the codec system to switch different working modes of the ANC noise reduction unit in different noise scenes, including: noise reduction mode, transparency mode, and off mode; The audio codec processes the analog input signal to obtain the analog output signal, and the analog output signal is output through the audio output device; The audio codec at least includes an analog-to-digital conversion unit, an ANC noise reduction processing unit, a data processing and transmission unit, a mixing unit, a digital-to-analog conversion unit and an audio interface; The analog-to-digital conversion unit is connected to an analog input signal, and the analog-to-digital conversion unit processes the analog input signal to obtain an audio input signal; The first input end of the data processing and transmission unit is connected to the output end of the analog-to-digital conversion unit, and the first output end of the data processing and transmission unit is connected to the input end of the audio interface; the data processing and transmission unit processes the audio input signal and transmits it through the audio interface; The second input end of the data processing and transmission unit is connected to the output end of the audio interface, and the second output end of the data processing and transmission unit is connected to the second input ends of the ANC noise reduction processing unit and the mixing unit; the data processing and transmission unit transmits the digital audio signal obtained by processing the multimedia sound output through the audio interface to the ANC noise reduction processing unit and the mixing unit; The ANC noise reduction processing unit is connected to the output end of the analog-to-digital conversion unit; the ANC noise reduction processing unit receives the audio input signal and the digital audio signal, and processes the audio input signal and the digital audio signal to obtain reverse noise; The first input end of the mixing unit is connected to the output end of the ANC noise reduction processing unit, and the mixing unit performs mixing and superposition processing on the reverse noise and the digital audio signal to obtain a mixed audio signal; The input end of the digital-to-analog conversion unit is connected to the output end of the audio mixing unit, and the digital-to-analog conversion unit processes the mixed audio signal and then outputs an analog output signal; Among them, the audio codec implements ANC noise reduction based on pure hardware, and does not need to run complex noise reduction algorithms through the built-in DSP core; at the same time, it also saves software scheduling delays, reduces the processing delay of the entire noise reduction system, and improves noise reduction performance and noise reduction bandwidth.
2. The audio codec system according to claim 1, It is characterized in that The data transmission processing unit includes a first data matching module and a second data matching module; The input end of the first data matching module is connected to the output end of the analog-to-digital conversion unit, and the output end of the first data matching module is connected to the input end of the audio interface; the first data matching module converts the format of the audio input signal and transmits it through the audio interface; The input end of the second data matching module is connected to the output end of the audio interface, and the output end of the second data matching module is the output end of the data processing and transmission unit; the second data matching module transmits the digital audio signal obtained after format conversion of the multimedia sound.
3. The audio codec system according to claim 2, It is characterized in that The format conversion performed by the first data matching module and the second data matching module at least includes matching of sampling rate and matching of signal bit width.
4. The audio codec system according to claim 2 or 3, It is characterized in that The data transmission processing unit further includes a first data cache module and a second data cache module; The input end of the first data cache module is connected to the output end of the first data matching module, and the output end of the first data cache module is connected to the input end of the audio interface; the signal output by the first data matching module is cached via the audio interface; The input end of the second data cache module is connected to the output end of the audio interface, and the output end of the second data cache module is connected to the input end of the second data matching module; the second data cache module caches the multimedia sound and transmits it to the second data matching module.
5. The audio codec system according to claim 1, It is characterized in that The reverse noise and the audio input signal have opposite phases and the same amplitudes.
6. The audio codec system according to claim 1, It is characterized in that The analog input signal at least includes a reference audio stream and an error audio stream. Correspondingly, the audio input signal after analog-to-digital conversion includes a reference audio signal and an error audio signal.
7. The audio codec system according to claim 6, It is characterized in that The ANC noise reduction processing unit includes a feedforward branch, a feedback branch and a mixing module; The feedforward branch input is connected to the reference audio signal, and the feedforward branch output is connected to the first input end of the mixing module; the feedforward branch performs adaptive filtering on the reference audio signal to obtain a feedforward reverse noise signal; The feedback branch input is connected to the error audio signal and the digital audio signal, and the feedback branch output is connected to the second input end of the mixing module; the feedback branch performs adaptive filtering on the error audio signal and the digital audio signal to obtain a feedback reverse noise signal; The mixing module receives the feedforward reverse noise signal and the feedback reverse noise signal, and processes the feedforward reverse noise signal and the feedback reverse noise signal to obtain the reverse noise.
8. The audio codec system according to claim 7, It is characterized in that The feedforward branch includes a first data conversion module and a feedforward processing module; The input of the first data conversion module is connected to the reference audio signal, the output of the first data conversion module is connected to the input end of the feedforward processing module, and the output end of the feedforward processing module is connected to the first input end of the mixing module; The first data conversion module converts the reference audio signal and then performs adaptive filtering processing on the reference audio signal by the feedforward processing module to obtain the feedforward reverse noise signal.
9. The audio codec system according to claim 7, It is characterized in that The feedback branch includes a second data conversion module, a compensation module, a mixing submodule and a feedback processing module; The input of the second data conversion module is connected to the error audio signal, and the output of the second data conversion module is connected to the first input end of the mixing submodule; the input of the compensation module is connected to the digital audio signal, and the output of the compensation module is connected to the second input end of the mixing submodule; The signal after the error audio signal is converted by the second data conversion module and the signal after the digital audio signal is compensated by the compensation module are transmitted to the mixing submodule for mixing processing; The output end of the mixing submodule is connected to the input end of the feedback processing module, and the feedback processing module performs adaptive filtering on the signal after the mixing processing to obtain the feedback reverse noise signal.
