Friday, December 3, 2010

MPEG audio encoding for single-chip DSP

Summary in order to develop low-cost single-chip DSP voice encoder, MPEG audio coding standard reference for computation and storage requirements for a deeper analysis, considering the encoding quality and speed of the processor, combining computer simulation results, pointed out that the use of single-chip DSP implementation of key based on the AD company ADSP-2181, make full use of its process for voice optimized hardware structure, design enables real-time MPEG Audio Layer 2 encoder hardware scenarios. test results indicate that, in adopting the filter accuracy based MAC extended and improved psychoacoustic model algorithm, encoding quality and real-time performance can be guaranteed.

Keyword coding; sound processing; digital signal processing

MPEG [1] voice compression algorithm is on high-fidelity digital sound compression of the 1st international standard, since 1992 at the end of the International Organization for standardization and International Electrotechnical Commission since the adoption of this standard, it is stored in digital sound, multimedia transmission over the Internet, sound digital audio broadcasting (DAB) [2] and other fields have been widely used, however, MPEG audio coding algorithm is fairly complex, its computation and storage has a very high demand, coupled with the market demand for encoder, so far there is no dedicated ASIC chip is now commonly used method is to use a general DSP complete MPEG audio compression, but only a DEC in foreign countries, such as Philips, Xingit very few companies in the single-chip DSP completed this algorithm, and buy expensive, no source code; there is also a country with two slices of TI's MPEG audio coding TMS320C30 achieve tier 2 [3], but use the DSP has coordinated two slices of control circuit complex and plus tablets external memory prices still expensive research, therefore, has its own property and inexpensive hardware implementations become inevitable choice.

1 MPEG audio coding

MPEG audio coding is an approach based on human auditory sub-band sound encoding algorithm, it is a feeling sound encoding methods-feel the sound encoding algorithm's basic structure as shown in Figure 1. According to the encoder focused frequency resolution or time resolution, can be divided into sub band codec and transform coder .MPEG sound layer 2 encoding algorithm in the frequency domain on the sound signal is divided into 32 child zone, belonging to a seed with encoder in Figure 1, the time-frequency mapping also called filter banks for the input of the sound signal mapping into Asia sampling frequency components according to use, filter banks in nature, that is, filter banks in frequency domain resolution size, these frequency component can be called a subband-like values or frequency line.

  

  

(a)

(b)

Figure 1 feel sound decoder structure diagram

Filter output or filter Group parallel time-frequency transform output for psychoacoustic models to estimate the time related sound masking threshold. psychoacoustic model using a known while masking, including tuning of masking and tuning of masking. If using a sound before and after the masking effect, you can further enhance the masking threshold estimation accuracy. subband-like values or frequency line follow as far as possible ensure that quantization noise spectrum in masking threshold following criteria can be quantified and coding, which can guarantee the quantification of human auditory introduce noise minimal. based on the complexity of the request, you can use the block pressure spread or entropy coding of synthesis methods.

Frame packaging to quantify the encoded output and associated boundary information in accordance with the required format, so that for the decoder uses.

2 encoding quality and DSP speed

Single-chip MPEG audio coding ADSP-2181 achieve critical need to address two issues: first, how to ensure quality voice coding; and second, how to take full advantage of the DSP operation speed. which two issues often is a rightness of Antinomies, need to find the best combination of points.

In General, the decision on the merits of MPEG audio encoder mainly acoustic model is good or bad. However, for the use of single-chip 16bit fixed-point DSP applications, this conclusion is no longer applicable. analysis showed that the long-term response appears limited character encoding quality of a contradiction in particular analysis filter banks, even censored effect brought 33 times 16bitAD conversion quantization error of noise, and the form factor of limited length represents the you and making it up to 96dB side-lobe attenuation filter response down to less than 70dB. therefore, in order to guarantee the quality of sound encoding filter algorithm must be precision scale.

Regarding the speed issue, first thought is use fast algorithm, we also tried in the sub-band filtering using fast algorithms [4]. However, practice has shown that these fast algorithm for use in the DSP effect is not satisfactory, it has the following three reasons: (1) only to consider the addition and multiplication of the number of times, and on the report of value, addressing, and so indifferent, but on all directives are single-cycle of the DSP, the number of times a multiplications and additions relative to other operations do not seem to be especially important; (2) does not take into account the characteristics of the hardware DSP, the algorithm does not give full play to the DSP by accumulator (MAC) parallel processing capabilities; (3) ADSP-2181 is 16-bit arithmetic operation optimization, expansion in the precision required, the operation of the order of magnitude speed increase dramatically.

Based on the above quality and speed of analysis, we use appropriate DSP instructions by summation of the heterogeneous structure of the filter group implementation using a MAC-based structure of precision extension methods, better solve the encoding quality and DS

P speed between. Moreover, the sampling data input methods, psychoacoustic model, scale factor encoding are suitable for ADSP-2181 improvements reduce the amount of the operation, ensuring real-time performance.

3 algorithm software design

Software design is a MPEG audio coding chip DSP core, the encoding quality and speed demands require careful design of DSP software can achieve.

(1) the structure of accuracy based MAC extended analysis of MPEG audio encoding filter banks can have many approaches, heterogeneous structure is the MPEG standards recommend that its mathematical representation is

(1)

(2)

Analysis shows that, on a double word Yk extensions can be censored effect brought about by the noise reduction of 33 times. However, taking into account the ADSP-2181 only supports 16bit, by accumulation operations need to style (1) conversion, that is,

(3)  Yk=HYk+2-16LYk  

(4)

In this way, you can use DSP by accumulator structure, the operation quantity only increased by about 1 times the storage capacity increased to 64 characters.

(2) of the input data of the Organization to enter data organizations must not only consider the easily from the DAC to obtain sound raw data, but also the input data in the chip data RAM storage suitable for Polyphase filter Group and acoustic model of FFT operation input. Polyphase filter groups each move into 32 new sound data, remove the-like values 32 gejiu, operates as follows:

   Xi = Xi-32, I = 511,510, ..., Xi 32 =, I next-input-audio-sample = 31, 30, ..., 0 but is not suitable for realization of ADSP-2181 data movement with each assignment operations require two instructions to complete, each analysis filter operation requires 1024 instruction cycle. If using ADSP-2181 multichannel automatic buffering capacity of the serial port and indirection, proper organization of the input sound data, you can use the sliding window approach to data move in and out, as shown in Figure 2.

  

Figure 2 Polyphase filtering of sliding window technology

In order to ensure the continuity of the frame boundary handling, input data cache should be designed in the form of a circular buffer, its length should be can't store two frames sound input data in the DSP frame data, the input data can be buffered to another frame. Thus, the data movement cost savings at the same time, enter the data of organizations should also facilitate the acoustic model's FFT algorithm, FFT requires ADSP-2181 address reverse addressing modes. calculation and FFT input data cache is at the same time, FFT calculation of pointer needs to address reverse, while the input buffer pointer cannot address reverse, otherwise it will cause the input sound data is arranged chaos.

ADSP-2181 provides this ability, it's the first address of the pointer set I1, I0, I2, I3 has address reverse ability, and the second address pointer group I4, I5, I7 I6, is not subject to address the impact of reverse mode-so from the second address pointer group select pointer for the input buffer, the pointers from the first group, select the pointer for the FFT calculation.

(3) improvement of acoustic model with DSP psychoacoustic model of a challenge is one of a large number of logarithmic operations, although you can find the approximate polynomial approximation, but its huge computation shows this is not a wise choice in improved psychoacoustic model, after the FFT algorithm does not immediately converted to logarithmic domains, but with piecewise linear polyline approximation domain masking effect curve for simplicity, use the standard consistent with subparagraph methods-approximation for index of polynomial expansions of the methods, which although relatively rough, but as the preceding analysis, the acoustic model implemented in 16bit Sentinel is not a contradiction, thus still acceptable.

Get masking threshold, for the purpose of calculating the cover letter than for bit allocation use, or the need for conversion from linear to log-domain domain-this time, we use a ADSP-2181 shifter approximate calculation methods-directives by EXP, can extract 2-ary complement fractions index, in terms of energy and thus 1bit about 3dB. index values by 3 to approximate the complement fractions dB value, mantissa part of negligible.

(4) the scale factor for encoding MPEG audio coding standards gives a total of 63 a scaling factor, but not all of these scale factor can be used on the number of 2-band 16bit-if you use double word for accuracy in the measurement time and will face the double word Division of huge overhead, therefore, only use one can use the 2-ary complement 16bit decimals accurate representation of the ordinal as a subset, which is a multiple of 3 and less than or equal to 45 scaling factor.

Use scale factor subset, scaling factor coding can no longer be by way of comparison, and you can directly through the calculation of subband maximise index access, simplifies the scaling factor of coding.

(5) software simulation results combined with the above algorithm improvement, according to the characteristics and ADSP-2181 MPEG standards, AD company developing software for the software emulation. table 1 below lists the various modules of simulation on computation and storage requirements for estimation of results

-Simulation in the sampling rate for the encoding mode for 48kHz stereo input signal for the frequency be 1 kHz sine wave, the output bit rate to 192kbit/s of.

From table 1, ADSP-2181 performance is more fully utilized. simulation results indicate that, in these conditions, the decoded output SNR up to around 80dB. visible, the algorithm is more effective.

Table 1 the module operation and storage requirements

  

Computation/(106 instruction/s) program storage capacity/103-Word data storage/103 words subband filtering 183.06.5 acoustic model 103.51.5 bit allocation and quantify 22.0 — format a bit stream 10.51.0

4 hardware design

Hardware structure diagram shown in Figure 3. basic functions of each module are as follows:

  

DSP core: in addition to complete all the coding, but also to complete the initialization of the ADC circuit configuration; auxiliary control circuit select sampling clock, interface circuit accepts host coding parameters.

Auxiliary control circuit: the FPGA and ancillary circuit, complete clock generation, FIFO status monitoring, address decoding capabilities.

Output buffering: coding flow temporarily store while providing fully asynchronous output interface methods in the need to achieve image sound lip synchronization application is particularly useful.

External storage: includes BDMA space and I/O space.

ADC circuit: complete sound of digital, direct and DSP serial 0. sampling frequency by externally supplied 256 times the sampling clock frequency decisions, work needs to be initialized.

Interface: the interface circuit is divided into two parts, one is the encoding of the output interface, the other part is connected to the host's interface-host interface RS232 interface chip complete DSP serial port 1 and serial port connection of host, the DSP uses internal timer interrupt and implement asynchronous serial-communications.

The programme has been in the ninth five-year scientific and technical key project realization, real-time encoding and decoding of sound through the subjective test.

* The national "ninth five-year focus on scientific and technical key project funded

Author: Lin Mun love East Beijing University of posts and telecommunications engineering, Beijing 100876; first author 25 years old, male, PhD

Reference documents

[1] ISO/IEC 11172-3-1993 Coding of moving pictures and associated audio for digital storage media at up to about 1.5 Mbit/s——part 3: audio

[2] Brandenburg K, Dehry Y F, Johnston J D, et al. ISO-MPEG-1 audio: a generic standard for coding of high-quality digital audio.

J Audio Eng Soc, 1994, 42 (10): 780~791

[3] Wang Xin, Dong in sight, the Japanese side strong MPEG audio coding algorithm and real-time implementation of journal of Tsinghua University, 1997, 37 (10): 45 ~ 48

[4] Konstantinides K, Fast subband filtering in MPEG audio coding.

IEEE Signal Processing Letters, 1994,

No comments:

Post a Comment