Handbook for Sound Engineers

(Wang) #1
DSP Technology 1175

Following the system buffer may be a data conver-
sion block that converts the data from a fixed-point
integer format provided by the A/D to either some other
fixed-point format or a floating-point processor,
depending on the DSP and the numerical issues.
Following this, there may be some application buffers
that store buffers of data to give the DSP some flexi-
bility in how much time it takes to process a single
block of data. The application buffers can be viewed as
a rubber band that allows the DSP to use more time for
some frames of data and less time for other frames of
data. As long as the average amount of time required to
process a buffer of data is less than the amount of time
required to acquire that buffer of data, the DSP will
make real-time. If the amount of time required to
process a buffer takes longer than the time to acquire the
buffer, then the system will be unable to process all
buffers and will have to drop buffers because there will
not be any processing time left over to collect the next
buffer from the A/D converter. In this case the system
will not make real time and the missing buffers will
produce audible pops in an audio signal. The applica-
tion buffers can be used to compensate for some frames
that may require more processing (more CPU time) than


others. By providing more frames over which to
average the computation, the DSP will more likely
make real time. Of course, if the DSP cannot perform
the required amount of computation on average during
the time that a buffer of data is acquired, then averaging
over more and more frames will not help. The system
will eventually miss real time and have to drop samples.
After the application buffers, the DSP algorithm
performs the operations that are desired and then passes
the data to possibly another set of application buffers
that in turn can be converted from the numerical format
of the DSP to the format required by the D/A converter.
Finally the data will be sent to the D/A converter and
converted back into an analog signal.
An accounting of the delay of the system should
include all delays beginning when the analog signal
comes in contact with the A/D converter to when the
analog signal leaves the D/A converter. Table 31-4
shows the potential delays in each of the blocks of Fig.
31-17. For this exercise, it is assumed that a frame of
data consists of N samples, where Nt. Each frame of
delay adds N • 1/T seconds of delay to the system. For
example, a delay of 16 samples at 48 kHz corresponds
to 16/48,000 = 333.3μs.

Figure 31-17. A block diagram of the typical DSP system.

A/D ConversionData BuffersApplication

DSP
Algorithm

Application
Buffers

Data
Conversion D/A

System Buffers
System Buffers

Table 31-4. A Summary of Delay Issues in a Typical DSP System
Block Delay Description

A/D From 1 to 16 samples Most A/D converters have some amount of delay built in due to the processing that is done.
Oversampling A/Ds in particular have more delay than other types of A/Ds.
System Buffers Adds at least 1 frame
of delay

In the ping-pong buffer scheme, the system is always processing the last frame of data while
the A/D is supplying the data from the next frame of data.
Data conversion Possibly none The conversion of the data format may be lumped with the algorithm processing delay.
Application buffers Adds M-1 frames of
delay for M buffers

Generalizing the ping-pong buffer scheme to M buffers, the system is always processing the
oldest buffer, which is M-1 buffers behind the most recent buffer.
DSP algorithm Variable, although
usually at least 1
frame

There are two primary ways a DSP algorithm adds delay. One is processing delay and the other
is algorithmic delay. Processing delay occurs because the processor is not infinitely fast, so it
takes some amount of time to perform all of the computation. If the DSP has no extra CPU
cycles after performing the computation, then the processing time adds a full frame of delay to
the system. If it takes more than a frame of delay to perform the computation, then the system
will not make real time.
The algorithmic delay comes from any requirement to use data from future frames of data (i.e.,
buffer the data) in order to make decisions about the current frames of data and other delays
inherent in the algorithm process.
D/A From 1 to 16 samples As with the A/D converter there is some delay associated with converting a digital signal into
an analog signal. Current converters typically have no more than 16 samples of delay.
Free download pdf