Transcription of Sampling and Quantization - Princeton University
1 chapter 5 Sampling and QuantizationOften the domain and the range of an original signalx(t) are modeled as contin-uous. That is, the time (or spatial) coordinatetis allowed to take on arbitraryreal values (perhaps over some interval) and the valuex(t) of the signal itself isallowed to take on arbitrary real values (again perhaps within some interval).As mentioned previously in chapter XX, such signals are continuous model is convenient for some situations, but in other situationsit is more convenient to work withdigitalsignals , signals which have adiscrete (often finite) domain and range. The process of digitizing the domainis calledsamplingand the process of digitizing the range is devices we encounter deal with both analog and digital signals. Digi-tal signals are particularly robust to noise, and extremely efficient and versatilemeans for processing digital signals have been developed. On the other hand,in certain situations analog signals are sometimes more appropriate or evennecessary.
2 For example, most underlying physical processes are analog (or atleast most conveniently modeled as analog), including the human sensorimotorsystems. Hence, analog signals are typically necessary to interface with sensorsand actuators. Also, some types of data processing and transmission are mostconveniently performed with analog signals. Thus, the conversion of analog sig-nals to digital signals (and vice versa) is an important part of many informationprocessing this chapter , we consider some of the fundamental issues and techniquesin converting between analog and digital signals. For Sampling , three fun-damental issues are (i) How are the discrete-time samples obtained from thecontinuous-time signal?; (ii) How can we reconstruct a continuous-time signalfrom a discrete set of samples?; and (iii) Under what conditions can we recoverthe continuous-time signal exactly? For Quantization , the three main issueswe consider are (i) How many Quantization levels should we choose?
3 ; (ii) How c 1999-2002 by Sanjeev R. Kulkarni. All rights reserved. Please do not distribute withoutpermission of the author. Lecture Notes for ELE201 Introduction to Electrical Signals and Systems. Thanks to Richard Radke for producing the 5. Sampling AND Quantization should the value of the levels be chosen?; and (iii) How should we map thevalues of the original signal to one of the Quantization levels? Sampling a Signal0246810121416182028293031323334353 6secondstemperatureSampled version of temperature graphFigure : Sampling an analog shows an analog signal together with some samples of the samples shown are equally spaced and simply pick off the value of theunderlying analog signal at the appropriate times. If we letTdenote the timeinterval between samples, then the times at which we obtain samples are givenbynTwheren=.., 2, 1,0,1,2,.. Thus, the discrete-time (sampled)signalx[n] is related to the continuous-time signal byx[n]=x(nT).
4 It is often convenient to talk about the Sampling frequencyfs. If one sampleis taken everyTseconds, then the Sampling frequency isfs=1/THz. Thesampling frequency could also be stated in terms of radians, denoted by , s=2 fs=2 type of Sampling mentioned above is sometimes referred to as ideal Sampling . In practice, there are usually two non-ideal effects. One effect isthat the sensor (or digitizer) obtaining the samples can t pick off a value at asingle time. Instead, some averaging or integration over a small interval occurs,so that the sample actually represents the average value of the analog signalin some interval. This is often modeled as a convolution namely, we getsamples ofy(t)=x(t) h(t), so that the sampled signal isy[n]=y(nT). In thiscase,h(t) represents the impulse response of the sensor or digitizer. Actually,sometimes this averaging can be desirable. For example, if the original signalx(t) is changing particularly rapidly compared to the Sampling frequency or RECONSTRUCTING A SIGNAL3particularly noisy, then obtaining samples of some averaged signal can actuallyprovide a more useful signal with less variability.
5 The second non-ideal effectis noise. Whether averaged or not, the actual sample value obtained will rarelybe the exact value of the underlying analog signal at some time. Noise inthe samples is often modeled as adding (usually small) random values to in real applications there are usually non-ideal effects such as thosementioned above, it is important to consider what can be done in the ideal casefor several reasons. The non-ideal effects are often sufficiently small that inmany practical situations they can be ignored. Even if they cannot be ignored,the techniques for the ideal case provide insight into how one might deal withthe non-ideal effects. For simplicity, we will usually assume that we get ideal,noise-free Reconstructing a SignalIn the previous section, we discussed the process of Sampling , , obtaining adiscrete-time signal from a continuous-time signal. We now consider the reverseproblem, namely how to construct a continuous-time signal given discrete-timesamples.
6 Suppose we are given a set of samplesx[n] that we know came fromsome continuous-time signalx(t). We also assume we know the Sampling rateT, so that we knowx(nT)=x[n]. How can we recoverx(t) for other values oft?Figure : Possible continuous-time functions corresponding to we have some additional knowledge or make some assumptions, thisproblem clearly has many solutions. Figure shows some discrete-time sam-ples and some possible continuous-time functions from which these samplescould have been obtained. We have no way to know for sure what the val-4 chapter 5. Sampling AND QUANTIZATIONues of the original signal are at times other thannT. However, there are somesimple estimates we might make to approximately reconstructx(t).Figure : Nearest-neighbor first estimate one might think of is to just assume that the value attimetis the same as the value of the sample at some timenTthat is closest tot.
7 Thisnearest-neighborinterpolation results in a piecewise-constant (staircase-like) reconstruction as shown in Figure : Zero-order hold , instead of nearest-neighbor interpolation, most devices implementa similar type of interpolation known aszero-order-holdinterpolation shownin Figure This is one of the most widely used methods and is easy toimplement. As with nearest-neighbor interpolation, this results in a piecewise-constant reconstruction, but the discontinuities are at the sample points insteadof between sample conceptually simple method islinear interpolation, which is alsocalledfirst-order-holdinterpolation and is shown in Figure With thismethod, the reconstruction is a continuous function that just connects the sam-ple values with straight lines. Higher order interpolation schemes also exist thatpass smoother functions through the samples. The higher the order, the moresamples that need to be used to reconstruct a value at each time.
8 One techniquethat actually usesallthe samples will be mentioned in the next THE Sampling THEOREM5 Figure : First-order hold interpolation techniques can be viewed in terms of simple convolutionoperations. Suppose we replace the discrete-time signal with a continuous-time signal that has delta functions at the sample timesnT. The height of(area under) each impulse is the value of the sample at that time. Then thereconstruction from zero-order-hold interpolation can be obtained by convolvingthis set of impulses with the functionh(t)={1if0 t<T0 otherwiseIn other words, the reconstruction is obtained by passing the discrete-time sam-ples, as a set of impulses, into an appropriate system. In this case, the systemhas a very simple impulse response and can be easily implemented. Likewise,nearest neighbor and linear interpolation can be viewed as convolving the sampleimpulses by rect(t/T)andtri(t/T), useful property of zero-order-hold that is not satisfied by nearest-neighboror first-order-hold interpolation is that it iscausal.}
9 This means that the recon-struction at timetonly depends on samples obtainedbeforetimet. Causalitycan be important in real-time systems when we must (or wish to) reconstructthe continuous-time signal without delays caused by waiting for future samplevalues. In many applications this is not an issue since either all the data isalready stored and available or the delays induced are The Sampling TheoremIn this section we discuss the celebrated Sampling Theorem, also called theShannon Sampling Theorem or the Shannon-Whitaker-Kotelnikov SamplingTheorem, after the researchers who discovered the result. This result givesconditions under which a signal can beexactlyreconstructed from its basic idea is that a signal that changes rapidly will need to be sampledmuch faster than a signal that changes slowly, but the Sampling theorem for-malizes this in a clean and elegant way. It is a beautiful example of the powerof frequency domain 5.
10 Sampling AND 1 where s >> Figure : Sampling a sinusoid at a high begin, consider a sinusoidx(t)=sin( t) where the frequency is not toolarge. As before, we assume ideal Sampling with one sample everyTseconds. Inthis case, the Sampling frequency in Hertz is given byfS=1/Tand in radiansby s=2 /T. If we sample at rate fast compared to , that is if s>> then we are in a situation such as that depicted in Figure In this case,knowing that we have a sinusoid with not too large, it seems clear that wecan exactly reconstructx(t). Roughly, the only unknowns are the frequency,amplitude, and phase, and we have many samples in one period to find theseparameters the other hand, if the number of samples is small with respect to thefrequency of the sinusoid then we are in a situation such as that depicted inFigure In this case, not only does it seem difficult to reconstructx(t), butthe samples actually appear to fall on a sinusoid with a lower frequency thanthe original.