Multi-Channel Digital Conversion of Audio Sampling Rates


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


This article shows how to do sampling-rate
conversion using a multi-channel audio DSP system. We will discuss
various aspects of hardware realizations of the conversion
circuitry using members of the Texas Instruments TMS320 family of
DSPs. A single processor can realize digital filters for the
real-time multi-channel sampling rate conversion of audio signals,
without the necessity of expensive multiprocessor systems. We
implemented and tested the algorithms using an experimental
hardware system composed of the TMS320C542 processor and the CS4226
20-bit converter.

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.

Frequency Domain Conversion

For audio digital processing, sampling rate alteration with a
rational factor M/N is often necessary (Table 1 ). Generally,
two different approaches are possible:

  • 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

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

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

Figure 2:  Sampling-rate conversion using an
up-sampler with factor M, a low-pass filter, and a down-sampler
with factor N

Conversion Rate
Factor M
Factor N
Least Common
Multiple of a
Sampling Rate Pair
16 to 48
32 to 48
16 to 44.1
32 to 44.1
44.1 to 48

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.

Conversion Rate
Factor M
Factor N
Least Common
Multiple of a
Sampling Rate Pair
16 to 44
32 to 44
44 to 48

Table 2:  Sampling rate conversion to and from 44

You can realize the filtering operation using an interpolator
and decimation by a low-pass filter with gain M and a normalized
cutoff frequency w c =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

Conversion Rate
Length L of FIR
Average Number of Calculated
16 to 48
32 to 48
16 to 44
32 to 44
44 to 48

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

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 ]

6th-order interpolation is used with simple FIR filter to
compensate sync7 -distortion in the frequency domain
caused by the spline interpolator.

Data Managing

In our algorithm, input samples received from the HPI and output
samples transferred to the BSP (after conversion to Format 5 of the
CS4226 crystal converter) are organized in blocks of 16-bit samples
with length 60. 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,

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.

Number of
Converted Channels
Number of
Samples for
Each Channel
Number of
Instruction Cycles
Between Two Blocks
Use of CPU
by Conversion
Procedure (%)

Table 4:  Time requirements during conversion to and
from 48 ksamples/s

1 comment on “Multi-Channel Digital Conversion of Audio Sampling Rates

  1. oiajfoeijf
    July 28, 2015

    1. Talk with recent clients Ask agents to provide a list of what they've listed and sold in the past year, with contact information, says Ron Phipps, past president of the Chicago-based National Association of Realtors, or NAR. Before you start calling the names, ask the agent if anyone will be “particularly pleased or particularly disappointed,” he says. With past clients, “I'd like to know what the asking price was and then what the sales price was,” says William Poorvu, adjunct professor emeritus at Harvard Business School and co-author of “The Real Estate Game: The Intelligent Guide to Decision-making and Investment.” And, if you're the seller, ask if these past properties are similar to yours in price, location and other salient features, Poorvu says. What you want is someone who specializes in exactly what you're selling. SHARE THIS STORY LinkedIn Delicious Reddit Stumbleupon Email story Another good question for sellers is: How long has the home been on the market?

    2. Look up the licensing States will have boards that license and discipline real estate agents in those states, says Phipps. Check with your state's regulatory body to find out if the person is licensed and if there have been any disciplinary actions or complaints, or check to see if the information is posted online.

    3. Pick a winner Peer-given awards count, says Phipps. One that really means something is the “Realtor of the Year” designation awarded by the state or local branch of NAR. “These agents are the best as judged by their peers,” he says. “That's a huge endorsement.”

    4. Select an agent with the right credentials Just as doctors specialize, so do real estate agents. And even generalists will get additional training in some areas. So that alphabet soup after the name can be an indication that the person has taken additional classes in a certain specialty of real estate sales. Here's what some of the designations mean:

    5. Research how long the agent has been in business You can often find out how long the agent has been selling real estate from the state licensing authority. Or, you can just ask the agent. “If they haven't been in business five years, they're learning on you and that's not good,” says Robert Irwin, author of “Tips & Traps When Buying a Home.” Ultimately, what you're looking for is someone who is actively engaged in a particular area and price range, says Phipps. You'll want to know what knowledge of those two factors they can demonstrate and “what kind of market presence they have,” he says.

    6. Look at their current listings Check out an agent's listings online, says Brobeck. Two places to look are the agency's own site and, a website that compiles properties in the Multiple Listing Service into a searchable online database. Most buyers start their search on the Internet, and you want an agent who uses that tool effectively. “A key thing is an attractive presentation on the Web,” says Brobeck. You also can look at how closely the agent's listings mirror the property you want to buy or sell. Are they in the same area? Is the price range similar? And does the agent have enough listings to indicate a healthy business but not so many that you'd just be a number?

    7. Ask about other houses for sale nearby A good agent should know about other area properties that are available “off the top of his head,” says Irwin. Mention a house in your area that's sold recently or is for sale. If the agent knows the property and can give you a few details, that means he or she really knows your area, he says. “You want someone like that who's on top of the market.”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.