Digital Audio Processing Revisited: Juan P Bello
Digital Audio Processing Revisited: Juan P Bello
Juan P Bello
Digital audio processing
Microphones
• Sound is an energy disturbance that propagates through a
medium as a wave
• Commonly, the medium is air, thus the sound wave produces
variations of air pressure
• A microphone is a transducer (i.e. a device that converts
energy or information from one form to another).
• Specifically, the microphone converts air pressure into voltage
levels, thus generating an electrical signal analogous to the
mechanical one.
• The following expression notates the relationship between
voltage and pressure in a microphone, where the symbol µ
means “is proportional to”: v(t) µ p(t)
ADC
• The conversion of an analog (continuous) signal x(t) into a
discrete sequence of numbers x(n) is performed by an Analog-to-
digital Converter (ADC)
• The ADC samples the amplitude of the analog signal at regular
intervals in time, and encodes (quantizes) those values as binary
numbers.
• The regular time intervals are known as the sampling period (Ts)
and are determined by the ADC clock.
• This period defines the frequency at which the sampling will be
done, such that the sampling frequency (in Hertz) is:
1
fs =
Ts
• The accuracy of the quantization depends on the number of bits
used to encode each amplitude value from the analog signal.
!
ADC
ADC
LPF
Anti-aliasing
Hearing frequency range
In digital synthesis we
then have to be careful
not to exceed the
Nyquist frequency
Loudness
Dynamic Range
Quantization noise
• Is the distortion produced by the rounding-up of real signal amplitude
values during the ADC process to the values “allowed” by the bit-
resolution of each sample.
• The difference in level between the intended signal and the noise arising
from quantization is the signal-to-quantization-noise ratio (SQNR)
• This depends on the quantization accuracy (# of bits) and the signal itself.
Original
8-colors no dither
8-colors + dither
Oversampling
• If the desired sampling rate is X, oversampling will perform the
analog-to-digital conversion at some faster rate, such as 2X.
• The technique can be used to: minimize aliasing, noise reduction and
increase accuracy beyond that provided by the wordlength.
• It widens the range of the frequency spectrum thus reducing the
(uniformly distributed) noise below the Nyquist frequency.
• When the final filtering is performed, the residual quantization noise in
the audible signal will be less: 4X oversampling yields a 6 dB
reduction (12 dB for 8X oversampling)
Storage Requirements
#1 n=0
" (n) = $
%0 elsewhere
• If we apply a unit impulse to a digital system we obtain y(n) = h(n),
the impulse response of the system.
• A digital system can be completely characterized by its impulse
response
!
Discrete convolution
• Since we know the impulse response h(n) of a given system, we
can calculate its response to ANY input signal x(n) by convolving
the input with its impulse response:
m=%
y(n) = x(n) " h(n) = & x(n) # h(n $ m)
m=$%
• A convolution represents the amount of overlap between x(n) and
a reversed and temporally-shifted version of h(n)
http://mathworld.wolfram.com/Convolution.html
Basic systems
• A 2-sample delay can be described by the relation: y(n) = x(n-2)
!
Transfer function
• However, the temporal relations between input and output are not
all we can use to describe the system
• The frequency-domain behavior of a digital system specifies which
input frequencies will be passed, rejected or emphasized.
• This behavior can be described using the transfer function H(z)
and the frequency response H(f) (that will be discussed later)
• The transfer function is obtained by calculating the Z-transform:
$
X(z) = % x(n) " z #n
n=#$
n=#$
!
Causality and stability
• Some common Z-transforms:
x(n) X(z)
x(n " M) z"M # X(z)
$ (n) 1
$ (n " M) z"M
startwindow
adc~
cycle~ 440
cycle~ 440
stop
+~ turn audio *~ 0.4 multiply by number
*~ 0.2 on/off < 1.0 to attenuate
*~ 0.5 dac~
dac~
read out with tapout~ 100 tapout~ 200 read out with
100 ms delay 200 ms delay
dac~