A DSP-based decompressor unit for high-fidelity MPEG-Audio over TCP/IP networks

Copyright 1997 by Björn Wesén at Axis Communications AB, Sweden

[ Home | Contents | Component and tool archive ]


Digital Signal Processing

  1. Introduction to digital signal processing
  2. Finding a DSP suitable for MPEG-Audio decoding
  3. Digital-to-analog conversion

Previous chapter: Compression of digital audio, next chapter: Implementation of MPEG-1 Audio

Introduction to digital signal processing

There are numerous situations where analog signals need to be processed in many ways, like filtering and spectral analysis. Designing analog hardware to perform these functions is possible but has become less and less practical, due to increased performance requirements, flexibility needs, and the need to cut down on development/testing time. It is in other words difficult to design analog hardware that performs advanced analysis of signals.

 

Figure 4: Digital signal processing block diagram

The act of sampling an analog signal into the digital domain, and applying processing on the digital version using computing algorithms, and possibly restoring the signal into the analog domain after processing, is called digital signal processing. Processors have emerged over the last 15 years that are specialised for embedded signal processing operations, and such a processor is called a DSP, which stands for Digital Signal Processor. Today there are hundreds of DSP families from as many manufacturers, each one designed for a particular price/performance/usage group. Many of the largest manufacturers, like Texas Instruments and Motorola, offer both specialised DSP's for certain fields like motor-control or modems, and general high-performance DSP's that can perform broad ranges of processing tasks. Development kits and software are also available, and there are companies making software development tools for DSP's that allows the programmer to implement complex processing algorithms using simple "drag'n'drop" methologies.

DSP's more or less fall into two categories depending on the underlying architecture - fixed-point and floating-point. The fixed-point devices generally operate on 16-bit words, while the floating-point devices operate on 32-40 bits floating-point words. Needless to say, the fixed-point devices are generally cheaper. Another important architectural difference is that fixed-point processors tend to have an accumulator architecture, with only one "general purpose" register, making them quite tricky to program and more importantly, making C-compilers inherently inefficient. Floating-point DSP's behave more like common general-purpose CPU's, with register-files.

Finding a DSP suitable for MPEG-Audio decoding

There are thousands of different DSP's on the market, and it is a difficult task finding the most suitable DSP for a project. The best way is probably to set up a constraint and wishlist, and try to compare the processors from the biggest manufacturers against it. For Whitney and MPEG-audio layer-3 decoding, it was important to find a DSP that had as many of the following properties as possible:

The Usenet newsgroup comp.dsp FAQ (frequently asked questions) provided a good overview of the "big four" manufacturers of DSPs: Texas Instruments, Motorola, AT&T and Analog Devices. After an initial selection where all the 16-bit devices were ruled out due to the accuracy requirement, the following device familys were interesting:

All of these seemed powerful enough for performing the decoding job, so the search for efficient, cheap C-compilers began. The cheapest manufacturer-provided compiler was Motorola's GCC-port for the 5600x family - it was free, as all GCC ports have to be. However, as stated above, C-compilers for fixed-point accumulator architectures tend to produce really inefficient and sluggish code, and this was made apparent directly when a small testprogram in C was compiled on it. That more or less ruled out the Motorola family, which was a pity because there were numerous favourable things with it like availability of good development kits with on-board hifi digital-analog converters. The other manufacturers charged very much for their C-compilers, around $1000-$2000, which was too costly for the Whitney thesis. Fortunately, a team of programmers in New Zeeland had just completed a free GCC port for the Texas TMS320C3x/C4x familys, so therefore the TMS320C3x was chosen as the best candidate for powering Whitney.

The development kit (DSK) for the TMS320C3x family is cheap ($99), contains a TMS320C31 50MHz DSP with 2k-word on-chip RAM, an A/D-D/A codec, and full expansion busses. It interfaces directly to a host PC through the parallel-port. The on-chip memory would not be enough for the MPEG algorithm, but since all the DSP's external busses were available as connectors, it was trivial to wire an external memory onto the development board. The D/A converter was quite bad since it only supported mono 12-bit sound at around 19 khz max, but it would be good enough for development.

The conclusion was that the TMS320C31 DSP would be the best chocie of DSP for the project, that the C3x DSK kit should be purchased to do development and testing of the code, and that the C3x GCC port should be used for compiling the MPEG-audio C-code. Later, key-elements of the code would have to be rewritten in assembler to get the required speed.

Digital-to-analog conversion

In the case of MPEG-Audio decoding, digital compressed data is fed into the DSP which performs the decoding, then the decoded samples have to be converted back into the analog domain, and the resulting signal fed into an amplifier or similar audio equipment. This digital to analog conversion (DAC) is performed by a circuit with the same name. Different DAC's provide different performance and quality, as measured by THD (Total harmonic distortion), number of bits, linearity, speed, filter characteristics and other things. For Whitney, the aim was that the output should be "CD-quality". This means, that the DAC should be stereo, have a conversion precision of 16-bits, and a conversion speed of 44.1kHz. It should also have an interface to the TMS320C31 DSP requiring as little glue-logic as possible, and an analog output that can be used without external analog filtering. It turned out to be surprisingly hard to find DAC's complying with this.

Four DAC's complying to most of the requirements were found:

All of these except the DSP202 require some glue-logic. It was interesting to note, that not even Texas own DAC provided a glueless interface to their own DSP's. However the DSP202 is more than 10 times as expensive as any of the others, so it was ruled out directly. The others are more or less equivalent, in both performance and price, so the governing factor became which manufacturer would send us samples first. Factory-fresh PCM1723 samples (a new version of the 1721, with almost identical specifications) appeared after one week, so that chip was chosen as the Whitney DAC. The PCM1723 has a dynamic range of 94dB and accepts input data in 16-, 20- or 24-bit format at sampling frequencies between 16kHz and 96kHz. A CD has a theoretical dynamic range of 96dB so the chip is certainly good enough for Whitney. Another nice feature with the chip, is that it can internally generate the timing for any chosen samplerate, given only a single 27 MHz oscillator input. The other chips have to be fed clocks at 256 times the samplerate, and with 44.1kHz, this amounts to 11.29 MHz, a quite non-standard frequency that isn't trivial to generate.

Additional references:

Previous chapter: Compression of digital audio, next chapter: Implementation of MPEG-1 Audio


This document may be freely distributed for educational purposes. See the copyright notice for additional information.