CS3291 DSP Page 7.13 BMGC 06/03/2006

University of Manchester

CS3291: Digital Signal Processing '05-'06

Section 7: Sampling & Reconstruction

This section is concerned with digital signal processing systems capable of operating on analogue signals which must first be sampled and digitised. The resulting digital signals often need to be converted back to analogue form or “reconstructed”. Before starting, we review some facts about analogue signals.

7.1. Review of some analogue signals and systems theory:-

1. Given an analogue signal xa(t), its analogue Fourier Transform Xa(jw) is:-

where w is the frequency in radians per second. The notation “Xa(jw)” may be unfamiliar and many text-books omit the 'j'. Most communications text-books prefer to use f , i.e. frequency in Hz, rather than w. In signal processing, we like to use Xa(jw) because replacing jw by s gives us the bi-lateral (-¥ to ¥) Laplace transform Xa(s). For real signals, Xa(-jw) is the complex conjugate of Xa(jw). We commonly refer to “negative frequencies” for this reason.

The inverse Fourier transform formula, which expresses xa(t) in terms of Xa(jw) is as follows:

Note that for the inverse transform, the range of integration is also -¥ to ¥ which means that negative

frequencies are included. The differences between this formula and the normal “forward” Fourier

transform are: (i) the (1/2p) factor

(ii) the sign of jwt ( + for inverse, - for forward)

(iii) the variable of integration ( dw for the inverse transform, dt for forward)

2. A unit impulse d(t) is an analogue signal with the following two mathematical properties:-

(i) d(t) = 0 for t ¹ 0

(ii)

It may be visualised as a very high (infinitely high in theory) very narrow (infinitesimally narrow)

rectangular pulse, applied starting at time t=0, with area (height in volts times width in seconds) equal

to one volt-second. The area is the impulse strength. We can increase the impulse strength by

making the pulse we visualise higher for a given narrowness. The “weighted” impulse then becomes

Ad(t) where A is the new impulse strength. We can also delay the weighted impulse by t seconds to

obtain Ad(t-t). An upward arrow labelled with “A” denotes an impulse of strength A.

3. If d(t) is applied as input to a linear time invariant (LTI) analogue circuit or system (e.g. an analogue

filter) the output, h(t) say, is called, not unsurprisingly, the impulse-response. The frequency-response

of the LTI analogue circuit or system is equal to the analogue Fourier transform of h(t).

4.  The Fourier series for a periodic signal x(t) whose period is T seconds may be expressed as:

Its fundamental frequency is 1/T Hz which is equivalent to 2p / T radians per second. A formula for each of the Fourier series coefficients Cn is as follows:-

Now consider the following periodic signal, s(t) = repeatT{d(t)}, which is a series of analogue impulses each of strength one repeated at intervals of ±T seconds:

Applying the formula:

Therefore the Fourier series is:

7.2 Sampling an analogue signal

Given an analogue signal xa(t) with Fourier Transform Xa(jw), consider what happens when we sample xa(t) at intervals of T seconds to obtain the discrete time signal {x[n]} defined as the sequence:

{ ...,x[-1], x[0], x[1], x[2], x[3], ... }

with the underlined sample occurring at time t=0. It follows that x[1] = xa(T), x[2] = xa(2T), etc. The sampling rate is 1/T Hz or 2p/T radians/second.

Define a new analogue signal xS(t) as follows:

= sampleT{x(t)}

where d(t) denotes an analogue impulse. As illustrated in Figure 1, xs(t) is a succession of delayed impulses, each impulse being multiplied by a sample value of {x[n]}. The Fourier transform of xs(t) is:

The expression obtained for Xs(jw), which is the Fourier transform of xs(t), is also known as the discrete time Fourier transform (DTFT) of {x[n]}. It can be calculated from a knowledge of sample values only and is a summation rather than an integral.

7.3. Relative frequency: this is an alternative measure of frequency, denoted W, in units of “radians per sample”. It is related to ordinary frequency, w in radians/second, as follows:-

W = wT = w/fs where fs is the sampling rate in Hertz.

Obviously, W does not mean much unless we know the sampling frequency. Remember that when W=2p, the true frequency in Hz is the sampling frequency fs Hz.

7.4 The discrete time Fourier transform (DTFT) as a function of relative frequency W:

Replacing wT by W in the expression for Xs(jw) gives:-

which is the DTFT of the sequence {x[n]} and is denoted X(ejW). This notation is consistent with that for the "z-transform", X(z), of {x[n]}. Therefore:

and Xs(jw) = X(ejW) with W = wT.

The DTFT of {x[n]} is therefore identical to the Fourier transform of the analogue signal xs(t) with W denoting wT.

7.5. Relating the DTFT of {x[n]} to the FT of xa(t):

We have successfully related the DTFT of {x[n]} to the FT of an analogue signal. But the analogue signal is xs(t) which was invented by us and is somewhat theoretical. What we really want to do is relate the DTFT of {x[n]} to the FT of the original analogue signal xa(t). Instead of doing this directly, it is easier to relate the FT of xs(t) to the FT of xa(t). Here xs(t) serves as an intermediate signal: a “half-way house” between the analogue signal xa(t) and the discrete signal {x[n]}

{…, 1, 5, 2.2,7, …..}

xa(t) xS(t) {x[n]}

Ý Ý Ý

ß ß ß

Xa(jw) Ü ? Þ XS(jw) º X(ejW)

So how does XS(jw) relate to the Fourier transform Xa(jw) of the original analogue signal xa(t)?

To answer this question, we prove a convenient form of the 'Sampling Theorem':

Given any signal xa(t) with Fourier Transform Xa(jw), the Fourier Transform of

xS(t) = sampleT{xa(t)} is XS(jw) = (1/T)repeat2p/T{Xa(jw)}.

·  By 'sampleT{xa(t)}' we mean a series of impulses at intervals T each weighted by the appropriate value of xa(t) as seen in fig 1.

·  By 'repeat2p/T{Xa(jw)}' we mean (loosely speaking) Xa(jw) repeated at frequency intervals of 2p/T. This definition will be made a bit more precise later when we consider 'aliasing'.

Proof of Sampling Theorem:

The periodic function s(t) has been shown to have the complex Fourier series:

Therefore, taking the Fourier transform of this new expression for xs(t):

= (1/T) repeat2p/T{Xa(jw)}

This equation shows that Xs(jw) is equal to the sum of an infinite number of identical copies of Xa(jw) each scaled by 1/T and shifted up or down in frequency by a multiple of 2p/T radians per second, i.e.

This equation is valid for any analogue signal xa(t).

7.6: Significance of the Sampling Theorem:

For an analogue signal xa(t) which is band-limited to a frequency range between -p/T and +p/T radians/sec (±fs/2 Hz) as illustrated in Figure 2, Xa(jw) is zero for all values of w with êw ê ³ p/T. It follows that

Xs(jw) = (1/T) Xa(jw) for -p/T < w < p/T

This is because Xa(j(w - 2p/T)), Xa(j(w + 2p/T) and Xa(jw) do not overlap. Therefore if we take the DTFT of {x[n]} (obtained by sampling xa(t)), set w=W/T to obtain XS(jw), and then remove everything outside ±p/T radians/sec and multiply by T, we get back the original spectrum Xa(jw) exactly; we have lost nothing in the sampling process. From the spectrum we can get back to xa(t) by an inverse FT. We can now feel confident when applying DSP to the sequence {x[n]} that it truly represents the original analogue signal without loss of fidelity due to the sampling process. This is a remarkable finding of the “Sampling Theorem”.

7.7: Aliasing distortion

In Figure 3, where Xa(jw) is not band-limited to the frequency range -p/T to p/T, overlap occurs between Xa(j(w-2p/T)), Xa(jw) and Xa(j(w+2p/T)). Hence if we take Xs(jw) to represent Xa(jw)/T in this case for

-p/T < w< p/T, the representation will not be accurate, and Xs(jw) will be a distorted version of Xa(jw)/T. This type of distortion, due to overlapping in the frequency domain, is referred to as aliasing distortion.

·  The precise definition of 'repeat2p/T{X(jw)}' is "the sum of an infinite number of identical copies of Xa(jw) each scaled by 1/T and shifted up or down in frequency by a multiple of 2p/T radians per second". It is only when Xa(jw) is band-limited between ±p/T that our earlier 'loosely speaking' definition strictly applies. Then there are no 'overlaps' which cause aliasing.

The properties of X(ejW), as deduced from those of Xs(jw) with W= wT, are now summarised.

7.8: Properties of DTFT of {x[n]} related to Fourier Transform of xa(t):

(i) If {x[n]} is obtained by sampling xa(t) which is bandlimited to ±fs/2 Hz (i.e. ±2p/T radians/sec),

at fs (= 1/T) samples per second then

X(e j W) = (1/T) Xa(jw) for -p < W (= wT) < p

Hence X(ejW) is closely related to the analogue frequency spectrum of xa(t) and is referred to

as the "spectrum" of {x[n]}.

(ii) X(e j W) is the Fourier Transform of an analogue signal xs(t) consisting of a succession of

impulses at intervals of T = 1/fs seconds multiplied by the corresponding elements of {x[n]}.

(iii) X(e j W) is periodic in the sense that X(e j (W + 2pn)) = X(e j W ) for n = 0, ±1, ±2, etc. The spectrum

repeats at intervals of 2p.

(iv)   For real signals, X(e - j W ) is the complex conjugate of X(e j W ). You can easily show this.

7.9: Anti-aliasing filter: To avoid aliasing distortion, we often low-pass filter xa(t) to band-limit the signal to ±fS/2 Hz. It then satisfies “Nyquist sampling criterion”.

Example 7.1: xa(t) has a strong sinusoidal component at 7 kHz. It is sampled at 10 kHz without an anti-aliasing filter. What happens to the sinusoids?

Solution:

It becomes 3 kHz sine-wave & distorts the signal.

Example 7.2: Consider how we may devise an anti-aliasing filter specification.

An analogue signal of bandwidth ±3 kHz is received with non-bandlimited noise added to it. It is to be sampled at 10 kHz. An analogue low-pass filter is required to attenuate, by at least 24 dB., any signal components likely to cause aliasing distortion to the 3 kHz bandwidth signal . What order of Butterworth filter is required?

Solution: Signal components likely to cause aliasing to the 3kHz band-width signal will of course be above 5kHz. However, since, for example, a 6kHz sine-wave will become 4 kHz and not affect the frequency range ±3kHz, we can allow unwanted signals or noise to exist right up to 7kHz without fear of aliasing. We may choose to get rid of them later by a digital filter. Therefore we need a Butterworth filter with 3dB point at 3kHz (assuming we can allow up to 3dB attenuation in the range ±3kHz) whose order is such that the attenuation at 7kHz is at least 24 dB. For an nth order analogue Butterworth low-pass filter with 3dB cut-off frequency wc radians/sec the gain response is

In this case wc = 2p3k and we must make n large enough to guarantee that

20 log10(G(2p7k)) < -24 i.e. -10 log10( 1 + (7/3)2n) < -24 i.e. log10(1+(7/3)2n) > 2.4

1+(7/3)2n > 102.4 = 251.19. Therefore 2n log10(2.33333) > 2.398.

2n > 2.398/0.37 = 6.48. Therefore n > 3.24. We must take n=4.

7.10: Reconstruction of xa(t):

Given a discrete time signal {x[n]}, how can we reconstruct an analogue signal xa(t), band-limited to ±fs/2 Hz, whose Fourier transform is identical to the DTFT of {x[n]} for frequencies in the range -fs/2 to fs/2?

Ideal reconstruction: In theory, we must first reconstruct xs(t) (requires ideal impulses) and then filter using an ideal low-pass filter with cut-off p/T radians/second.

In practice we must use an approximation to xs(t) where each impulse is approximated by a pulse of finite voltage and non-zero duration:-

The easiest approach in practice is to use a "sample and hold" (sometimes called “zero order hold”) circuit to produce a voltage proportional to (1/T)x(t) at t = mT, and hold this fixed until the next sample is available at t = (m+1)T. This produces a “staircase” wave-form as illustrated below. The effect of this approximation may be studied by realising that the sample and hold approximation could be produced by passing xs(t) through a linear circuit, which we can call a sample and hold filter, whose impulse response is as shown below:-

The frequency response of the S/H filter may be calculated by means of a Fourier Transform:

(“Half angle” trick)

when w ¹ 0

When w=0, H(jw) = 1.

Therefore H(jw) = e-jwT/2 sinc(wT/(2p)) where

A graph of the magnitude and phase of H(jw) against frequency shows that the gain at w = 0 is 0 dB, and the gain at p/T is 20 log10(2/p) = -3.92 dB. Hence the reconstruction of xa(t) using a sample and hold approximation to xs(t) rather than xs(t) itself incurs a frequency dependent loss (roll-off) which increases towards 3.92 dB as w increases towards p/T. In some cases the loss is not too significant and can be disregarded. In other cases a compensation filter may be used to cancel out the loss. The phase-response of H(jw) is linear, producing just a delay of T/2 seconds.

7.11: Quantisation error: The conversion of the sampled voltages of xa(t) to binary numbers produces a digital signal that can be processed by digital circuits or computers. As a finite number of bits will be available for each sample, an approximation must be made whenever a sampled value falls between two voltages represented by binary numbers or quantisation levels.