Design Article
Multi-Channel Digital Conversion of Audio Sampling Rates
Tomasz Marciniak and Adam Dabrowski
12/1/2001 12:00 AM EST
![]() |
|
|
ABOUT THE AUTHORS
Adam Dabrowski received
an M.Sc. degree in electrical engineering from Poznan University of
Technology in 1976 and an M.Sc. degree in mathematics from Adam
Mickiewicz University in 1977. In 1983 he received a Ph.D. degree
in electronics. He is now a full professor at the Institute of
Electronics and Telecommunication and the head of the Division for
Signal Processing and Electronic Systems at Poznan University of
Technology.
More... |
||
Audio signals are currently represented digitally with various
sampling rates: 8, 16, 22.05, 24, 32, 44.1, 48, and 96
ksamples/s.
In order to achieve high spatial realism of audio
signals, you should use a multi-channel representation. Two typical
systems are stereo sound (two front channels) and 5.1 surround
sound (three front channels, two rear channels, and a subwoofer).
An online multi-channel sampling rate conversion is a very
important task that you can realize using modern DSPs, which
feature a host port interface (HPI) and a buffered serial port
(BSP).

Figure 1 presents an experimental DSP
hardware system for multi-channel sampling-rate conversion.
Figure 1: A DSP audio system with a TMS320C542 signal processor. The CS4226 audio CODEC is connected using the BSP. Data is transferred to and from the host computer via HPI.
- The frequency-domain approach based on discrete Fourier
transformation (DFT) or on frequency selective filtering with
interpolation by M and then decimation by N
- The time-domain approach based on direct interpolation in time, in other words, on the realization of a sequence of non-integer delays.
You can also mix these two approaches, resulting in a reduction of the required intermediate sampling rate. In this article, we concentrate on the frequency-domain approach you implement with filtering.
Figure 1 shows a block diagram of a simple system to
realize sampling-rate conversion.
Output samples are calculated using difference
equations, which utilize the up- and down-sampling and the
filtering in-between. Table 1 presents the respective up-
and down-sampling factors for the sampling rate conversions under
consideration. These factors are equal to the least common multiple
of a pair of sampling rates, divided by the respective rate of this
pair.
Figure 2: Sampling-rate conversion using an up-sampler with factor M, a low-pass filter, and a down-sampler with factor N
|
(ksamples/s) |
Factor M |
Factor N |
Multiple of a Sampling Rate Pair |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Table 1: Sampling rate conversion factors
Since the up- and down-sampling factors for the rate conversion to/from 44.1 ksamples/s are too large, we accepted a slightly lower sampling rate, 44 ksamples/s (Table 2). This introduces a small error with a relative value of d = 0.22676% which, in most cases, is inaudible.
|
(ksamples/s) |
Factor M |
Factor N |
Multiple of a Sampling Rate Pair |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Table 2: Sampling rate conversion to and from 44 ksamples/s
You can realize the filtering operation using an interpolator
and decimation by a low-pass filter with gain M and a normalized
cutoff frequency wc=min(p/M, p/N) .
You can design the respective FIR filter using
the Parks-McClellan algorithm (Figure 3). Table 3
presents the lengths of FIR filters and the numbers of effective
taps depending on the converted rates and the desired signal
resolution (16- or 20-bit word length, corresponding to the
stop-band attenuation of 96 or 120 dB, respectively).
Figure 3: Illustrative frequency responses of FIR filters for two conversions: 32 to 48 ksamples/s and 32 to 44 ksamples/s
|
(ksamples/s) |
|
L/(2M) |
||
|
Resolution |
Resolution |
Resolution |
Resolution |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Table 3: Low-pass FIR filters
Interpolation in Time Domain
You can calculate the output signal of arbitrary sampling rate
using the time-domain approach. The following relationships
determine the output signal sample:
where Tin = ti+1 - ti input sampling interval, Tout - output sampling interval, ti - instant for a new output sample. These relationships are illustrated in Figure 4.
Figure 4: Time relationship between input (red) and output (blue) samples
One of the simplest time-domain sampling-rate conversion methods
consists of high oversampling and then choosing an appropriate
output sample with the nearest time position to the required
position. Figure 5 presents a multi-stage approach for this
high oversampling.
The time-analysis unit controls interpolators
with factors 64 and 128, which computes the appropriate sampling
instants. The main advantage of this approach (in comparison with
the considered frequency-domain method) is the possibility of using
the same filter coefficients for different sampling-rate ratios
and, thus, a simplified realization of the interpolation
filters.
Figure 5: Multistage oversampling and choosing the output sample nearest to the required position in time
Time domain conversion can also be based on typical numerical
methods such as polynomial interpolation, Lagrange interpolation,
or spline interpolation.

In the case of an Nth-order spline with a
function defined in interval [xk,..., xk+m]
as
6th-order interpolation is used with simple FIR filter to
compensate sync7-distortion in the frequency domain
caused by the spline interpolator.
Figure 6 presents the sampling rate
conversion procedure.
Figure 6: The sampling-rate conversion procedure consists of producing M data blocks from the received N data blocks, where M and N are the up- and down-sampling factors, respectively
The filter output is calculated only for these taps, for which
input samples are non-zero. Using FIRS instruction and indirect
addressing, the total number of multiplications is equal to L/(2M),
where L is the filter length (Table 2). Table 4
presents the time requirements for conversion to and from the
sampling rate of 48 ksamples/s, assuming 25 ns instruction cycles
and 16-bit precision. For 60 samples, the conversion procedure
needs 3180 cycles. From Table 4 we conclude that for 16-bit
precision, a single DSP can additionally compute an FFT, which
needs about 33,000 cycles for the 512-point FFT.
|
Converted Channels |
Samples for Each Channel |
Instruction Cycles Between Two Blocks |
by Conversion Procedure (%) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Table 4: Time requirements during conversion to and from 48 ksamples/s




