Lecture notes for Digital signal processing

geophysical signal processing lecture notes, how is digital signal processing used, how signal processing works and lecture notes in digital signal processing discrete-time signal processing lecture notes pdf free download
Dr.JakeFinlay Profile Pic
Published Date:22-07-2017
Your Website URL(Optional)
INTRODUCTION TO Signal Processing1 Sampling and Reconstruction 1.1 Introduction Digital processing of analog signals proceeds in three stages: 1. The analog signal is digitized, that is, it is sampled and each sample quantized to a finite number of bits. This process is called A/D conversion. 2. The digitized samples are processed by a digital signal processor. 3. The resulting output samples may be converted back into analog form by an ana- log reconstructor (D/A conversion). A typical digital signal processing system is shown below. 100111011 110010100 sampler 0110 ... digital 1101 ... analog and signal reconstructor quantizer processor analog analog digital digital input output input output The digital signal processor can be programmed to perform a variety of signal pro- cessing operations, such as filtering, spectrum estimation, and other DSP algorithms. Depending on the speed and computational requirements of the application, the digital signal processor may be realized by a general purpose computer, minicomputer, special purpose DSP chip, or other digital hardware dedicated to performing a particular signal processing task. The design and implementation of DSP algorithms will be considered in the rest of this text. In the first two chapters we discuss the two key concepts of sampling and quantization, which are prerequisites to every DSP operation. 1.2 Review of Analog Signals We begin by reviewing some pertinent topics from analog system theory. An analog signal is described by a function of time, say,x(t). TheFouriertransformX(Ω) ofx(t) is the frequency spectrum of the signal: 12 1. SAMPLINGANDRECONSTRUCTION  ∞ −jΩt X(Ω)= x(t)e dt (1.2.1) −∞ † where Ω is the radian frequency in radians/second. The ordinary frequency f in Hertz or cycles/sec is related toΩ by Ω = 2πf (1.2.2) The physical meaning ofX(Ω) is brought out by theinverse Fourier transform, which expresses the arbitrary signalx(t) as a linear superposition of sinusoids of different frequencies:  ∞ dΩ jΩt x(t)= X(Ω)e (1.2.3) 2π −∞ The relative importance of each sinusoidal component is given by the quantityX(Ω). The Laplace transform is defined by  ∞ −st X(s)= x(t)e dt −∞ It reduces to the Fourier transform, Eq. (1.2.1), under the substitutions =jΩ. The s-plane pole/zero properties of transforms provide additional insight into the nature of signals. For example, a typical exponentially decaying sinusoid of the form −α t jΩ t s t 1 1 1 x(t)=e e u(t)=e u(t) t wheres =−α +jΩ , has Laplace transform 1 1 1 Im s s-plane s jΩ 1 1 1 X(s)= s−s 1 -α 0 1 Re s with a pole ats =s , which lies in the left-hands-plane. Next, consider the response of 1 a linear system to an input signalx(t): x(t) y(t) linear system input output h(t) † We use the notation Ω to denote the physical frequency in units of radians/sec, and reserve the notationω to denote digital frequency in radians/sample.1.2. REVIEWOFANALOGSIGNALS 3 The system is characterized completely by the impulse response functionh(t). The outputy(t) is obtained in the time domain by convolution:  ∞    y(t)= h(t−t)x(t)dt −∞ or, in the frequency domain by multiplication: Y(Ω)=H(Ω)X(Ω) (1.2.4) whereH(Ω) is the frequency response of the system, defined as the Fourier transform of the impulse responseh(t):  ∞ −jΩt H(Ω)= h(t)e dt (1.2.5) −∞ The steady-state sinusoidal response of the filter, defined as its response to sinu- soidal inputs, is summarized below: jΩt jΩt linear y(t) = H(Ω)e x(t) = e system sinusoid in H(Ω) sinusoid out This figure illustrates the filtering action of linear filters, that is, a given frequency component Ω is attenuated (or, magnified) by an amount H(Ω) by the filter. More precisely, an input sinusoid of frequency Ω will reappear at the output modified in magnitude by a factor H(Ω) and shifted in phase by an amount argH(Ω): jΩt jΩt jΩt+jargH(Ω) x(t)=e ⇒ y(t)=H(Ω)e =H(Ω)e By linear superposition, if the input consists of the sum of two sinusoids of frequen- ciesΩ andΩ and relative amplitudesA andA , 1 2 1 2 jΩ t jΩ t 1 2 x(t)=A e +A e 1 2 then, after filtering, the steady-state output will be jΩ t jΩ t 1 2 y(t)=A H(Ω )e +A H(Ω )e 1 1 2 2 Notice how the filter changes the relative amplitudes of the sinusoids, but not their frequencies. The filtering effect may also be seen in the frequency domain using Eq. (1.2.4), as shown below: X(Ω) Y(Ω) A A 1 2 A H(Ω ) 1 1 H(Ω) A H(Ω ) 2 2 Ω Ω Ω Ω Ω Ω 1 2 1 24 1. SAMPLINGANDRECONSTRUCTION The input spectrumX(Ω) consists of two sharp spectral lines at frequenciesΩ and 1 Ω , as can be seen by taking the Fourier transform ofx(t): 2 X(Ω)= 2πA δ(Ω−Ω )+2πA δ(Ω−Ω ) 1 1 2 2 The corresponding output spectrumY(Ω) is obtained from Eq. (1.2.4):   Y(Ω) =H(Ω)X(Ω)=H(Ω) 2πA δ(Ω−Ω )+2πA δ(Ω−Ω ) 1 1 2 2 = 2πA H(Ω )δ(Ω−Ω )+2πA H(Ω )δ(Ω−Ω ) 1 1 1 2 2 2 What makes the subject of linear filtering useful is that the designer has complete control over the shape of the frequency responseH(Ω) of the filter. For example, if the sinusoidal componentΩ represents a desired signal andΩ an unwanted interference, 1 2 then a filter may be designed that letsΩ pass through, while at the same time it filters 1 out theΩ component. Such a filter must haveH(Ω )= 1 andH(Ω )= 0. 2 1 2 1.3 Sampling Theorem Next, we study the sampling process, illustrated in Fig. 1.3.1, where the analog signal x(t) is periodically measured everyT seconds. Thus, time is discretized in units of the sampling intervalT: t =nT, n = 0, 1, 2,... Considering the resulting stream of samples as an analog signal, we observe that the sampling process represents a very drastic chopping operation on the original signal x(t), and therefore, it will introduce a lot of spurious high-frequency components into the frequency spectrum. Thus, for system design purposes, two questions must be answered: 1. What is the effect of sampling on the original frequency spectrum? 2. How should one choose the sampling intervalT? We will try to answer these questions intuitively, and then more formally using Fourier transforms. We will see that although the sampling process generates high frequency components, these components appear in a very regular fashion, that is, ev- ery frequency component of the original signal is periodically replicated over the entire frequency axis, with period given by the sampling rate: 1 f = (1.3.1) s T This replication property will be justified first for simple sinusoidal signals and then 2πjft for arbitrary signals. Consider, for example, a single sinusoidx(t)=e of frequency f. Before sampling, its spectrum consists of a single sharp spectral line atf. But after 2πjfnT sampling, the spectrum of the sampled sinusoidx(nT)= e will be the periodic replication of the original spectral line at intervals off , as shown in Fig. 1.3.2. s1.3. SAMPLINGTHEOREM 5 ideal sampler x(t) x(nT) analog sampled signal signal T x(t) x(nT) T t . . . t 0 T 2T nT Fig. 1.3.1 Ideal sampler. frequency f . . . . . . f-3f f-2f f-f ff+f f+2f f+3f s s s s s s Fig. 1.3.2 Spectrum replication caused by sampling. Note also that starting with the replicated spectrum of the sampled signal, one can- not tell uniquely what the original frequency was. It could be any one of the replicated  frequencies, namely,f =f +mf ,m = 0,±1,±2,... . That is so because any one of s them has the same periodic replication when sampled. This potential confusion of the original frequency with another is known as aliasing and can be avoided if one satisfies the conditions of the sampling theorem. The sampling theorem provides a quantitative answer to the question of how to choose the sampling time intervalT. Clearly,T must be small enough so that signal variations that occur between samples are not lost. But how small is small enough? It would be very impractical to chooseT too small because then there would be too many samples to be processed. This is illustrated in Fig. 1.3.3, whereT is small enough to resolve the details of signal 1, but is unnecessarily small for signal 2. signal 1 signal 2 T t Fig. 1.3.3 Signal 2 is oversampled. Another way to say the same thing is in terms of the sampling rate f , which is s6 1. SAMPLINGANDRECONSTRUCTION measured in units of samples/sec or Hertz and represents the “density” of samples per unit time. Thus, a rapidly varying signal must be sampled at a high sampling rate f , whereas a slowly varying signal may be sampled at a lower rate. s 1.3.1 Sampling Theorem A more quantitative criterion is provided by the sampling theorem which states that for accurate representation of a signalx(t) by its time samplesx(nT), two conditions must be met: 1. The signal x(t) must be bandlimited, that is, its frequency spectrum must be limited to contain frequencies up to some maximum frequency, sayf , and no max frequencies beyond that. A typical bandlimited spectrum is shown in Fig. 1.3.4. 2. The sampling ratef must be chosen to be at least twice the maximum frequency s f , that is, max f ≥ 2f (1.3.2) s max 1 or, in terms of the sampling time interval:T ≤ . 2f max X(f) f 0 -f f max max Fig. 1.3.4 Typical bandlimited spectrum. The minimum sampling rate allowed by the sampling theorem, that is,f = 2f ,is s max called the Nyquist rate. For arbitrary values off , the quantityf /2 is called the Nyquist s s frequency or folding frequency. It defines the endpoints of the Nyquist frequency inter- val:   f f s s − , = Nyquist Interval 2 2 The Nyquist frequencyf /2 also defines thecutofffrequencies of the lowpass analog s prefilters and postfilters that are required in DSP operations. The values off andf max s depend on the application. Typical sampling rates for some common DSP applications are shown in the following table.1.3. SAMPLINGTHEOREM 7 application f f max s geophysical 500 Hz 1 kHz biomedical 1 kHz 2 kHz mechanical 2 kHz 4 kHz speech 4 kHz 8 kHz audio 20 kHz 40 kHz video 4 MHz 8 MHz 1.3.2 Antialiasing Prefilters The practical implications of the sampling theorem are quite important. Since most signals are not bandlimited, they must be made so by lowpass filteringbefore sampling. In order to sample a signal at a desired rate f and satisfy the conditions of the s sampling theorem, the signal must be prefiltered by a lowpass analog filter, known as an antialiasing prefilter. The cutoff frequency of the prefilter,f , must be taken to max be at most equal to the Nyquist frequencyf /2, that is,f ≤f /2. This operation is s max s shown in Fig. 1.3.5. The output of the analog prefilter will then be bandlimited to maximum frequency f and may be sampled properly at the desired rate f . The spectrum replication max s caused by the sampling process can also be seen in Fig. 1.3.5. It will be discussed in detail in Section 1.5. input spectrum prefiltered spectrum replicated spectrum prefilter f f f 0 -f /2 0 f /2 0 -f f s s s s sampler x (t) analog x(t) x(nT) in and lowpass to DSP analog bandlimited digital quantizer prefilter signal signal signal rate f s cutoff f =f /2 max s Fig. 1.3.5 Antialiasing prefilter. It should be emphasized that the ratef must be chosen to be high enough so that, s after the prefiltering operation, the surviving signal spectrum within the Nyquist interval −f /2,f /2 contains all the significant frequency components for the application at s s hand. Example 1.3.1: In a hi-fi digital audio application, we wish to digitize a music piece using a sampling rate of 40 kHz. Thus, the piece must be prefiltered to contain frequencies up to 20 kHz. After the prefiltering operation, the resulting spectrum of frequencies is more than adequate for this application because the human ear can hear frequencies only up to 20 kHz. 8 1. SAMPLINGANDRECONSTRUCTION Example 1.3.2: Similarly, the spectrum of speech prefiltered to about 4 kHz results in very intelligible speech. Therefore, in digital speech applications it is adequate to use sampling rates of about 8 kHz and prefilter the speech waveform to about 4 kHz. What happens if we do not sample in accordance with the sampling theorem? If we undersample, we may be missing important time variations between sampling instants and may arrive at the erroneous conclusion that the samples represent a signal which is smoother than it actually is. In other words, we will be confusing the true frequency content of the signal with a lower frequency content. Such confusion of signals is called aliasing and is depicted in Fig. 1.3.6. aliased signal true signal T t 0 T 2T 3T 4T 5T 6T 7T 8T 9T 10T Fig. 1.3.6 Aliasing in the time domain. 1.3.3 Hardware Limits Next, we consider the restrictions imposed on the choice of the sampling ratef by the s hardware. The sampling theorem provides a lower bound on the allowed values off . s The hardware used in the application imposes an upper bound. In real-time applications, each input sample must be acquired, quantized, and pro- cessed by the DSP, and the output sample converted back into analog format. Many of these operations can be pipelined to reduce the total processing time. For example, as the DSP is processing the present sample, the D/A may be converting the previous output sample, while the A/D may be acquiring the next input sample. In any case, there is a total processing or computation time, sayT seconds, re- proc quired for each sample. The time intervalT between input samples must be greater thanT ; otherwise, the processor would not be able to keep up with the incoming proc samples. Thus, T ≥T proc or, expressed in terms of the computation or processing rate,f = 1/T , we obtain proc proc the upper boundf ≤f , which combined with Eq. (1.3.2) restricts the choice off to s proc s the range: 2f ≤f ≤f max s proc In succeeding sections we will discuss the phenomenon of aliasing in more detail, provide a quantitative proof of the sampling theorem, discuss the spectrum replication1.4. SAMPLINGOFSINUSOIDS 9 property, and consider the issues of practical sampling and reconstruction and their effect on the overall quality of a digital signal processing system. Quantization will be considered later on. 1.4 Sampling of Sinusoids The two conditions of the sampling theorem, namely, that x(t) be bandlimited and the requirementf ≥ 2f , can be derived intuitively by considering the sampling of s max sinusoidal signals only. Figure 1.4.1 shows a sinusoid of frequencyf, x(t)= cos(2πft) that has been sampled at the three rates: f = 8f,f = 4f, andf = 2f. These rates s s s correspond to taking 8, 4, and 2 samples in each cycle of the sinusoid. f = 8f f = 4f f = 2f s s s Fig. 1.4.1 Sinusoid sampled at ratesf = 8f, 4f, 2f. s Simple inspection of these figures leads to the conclusion that the minimum ac- ceptable number of samples per cycle is two. The representation of a sinusoid by two † samples per cycle is hardly adequate, but at least it does incorporate the basicup-down nature of the sinusoid. The number of samples per cycle is given by the quantityf /f : s f samples/sec samples s = = f cycles/sec cycle Thus, to sample a single sinusoid properly, we must require f s ≥ 2 samples/cycle ⇒ f ≥ 2f (1.4.1) s f Next, consider the case of an arbitrary signalx(t). According to the inverse Fourier transform of Eq. (1.2.3), x(t) can be expressed as a linear combination of sinusoids. Proper sampling ofx(t) will be achieved only if every sinusoidal component ofx(t) is properly sampled. This requires that the signalx(t) be bandlimited. Otherwise, it would contain si- nusoidal components of arbitrarily high frequencyf, and to sample those accurately, we would need, by Eq. (1.4.1), arbitrarily high ratesf . If the signal is bandlimited to s † It also depends on the phase of the sinusoid. For example, sampling at the zero crossings instead of at the peaks, would result in zero values for the samples.10 1. SAMPLINGANDRECONSTRUCTION some maximum frequencyf , then by choosingf ≥ 2f , we are accurately sam- max s max pling the fastest-varying component ofx(t), and thus a fortiori, all the slower ones. As an example, consider the special case: x(t)=A cos(2πf t)+A cos(2πf t)+···+A cos(2πf t) 1 1 2 2 max max wheref are listed in increasing order. Then, the conditions i 2f ≤ 2f ≤···≤ 2f ≤f 1 2 max s imply that every component ofx(t), and hencex(t) itself, is properly sampled. 1.4.1 Analog Reconstruction and Aliasing Next, we discuss the aliasing effects that result if one violates the sampling theorem conditions (1.3.2) or (1.4.1). Consider the complex version of a sinusoid: jΩt 2πjft x(t)=e =e and its sampled version obtained by settingt =nT, jΩTn 2πjfTn x(nT)=e =e Define also the following family of sinusoids, form = 0,±1,±2,... , 2πj(f +mf )t s x (t)=e m and their sampled versions, 2πj(f +mf )Tn s x (nT)=e m Using the propertyf T = 1 and the trigonometric identity, s 2πjmf Tn 2πjmn s e =e = 1 we find that, although the signalsx (t) are different from each other, their sampled m values are the same; indeed, 2πj(f +mf )Tn 2πjfTn 2πjmf Tn 2πjfTn s s x (nT)=e =e e =e =x(nT) m In terms of their sampled values, the signalsx (t) are indistinguishable, or aliased. m Knowledge of the sample valuesx(nT)= x (nT) is not enough to determine which m among them was the original signal that was sampled. It could have been any one of the x (t). In other words, the set of frequencies, m f, f ±f,f ± 2f,..., f ±mf,... (1.4.2) s s s are equivalent to each other. The effect of sampling was to replace the original fre- quencyf with the replicated set (1.4.2). This is the intuitive explanation of the spectrum1.4. SAMPLINGOFSINUSOIDS 11 ideal ideal sampler reconstructor x (t) x(t) x(nT) T a f analog sampled analog 0 -f 2 f /2 / signal signal signal s s rate f lowpass filter s cutoff = f /2 s Fig. 1.4.2 Ideal reconstructor as a lowpass filter. replication property depicted in Fig. 1.3.2. A more mathematical explanation will be given later using Fourier transforms. Given that the sample valuesx(nT) do not uniquely determine the analog signal they came from, the question arises: What analog signal would result if these samples were fed into an analog reconstructor, as shown in Fig. 1.4.2? We will see later that anideal analog reconstructorextracts from a sampled signal all the frequency components that liewithin the Nyquist interval−f /2,f /2 andremoves s s all frequencies outside that interval. In other words, an ideal reconstructor acts as a lowpass filter with cutoff frequency equal to the Nyquist frequencyf /2. s Among the frequencies in the replicated set (1.4.2), there is a unique one that lies † within the Nyquist interval. It is obtained by reducing the originalf modulo-f , that is, s adding to or subtracting fromf enough multiples off until it lies within the symmetric s ‡ Nyquist interval−f /2,f /2. We denote this operation by s s f =f mod(f ) (1.4.3) a s This is the frequency, in the replicated set (1.4.2), that will be extracted by the analog reconstructor. Therefore, the reconstructed sinusoid will be: 2πjf t a x (t)=e a It is easy to see thatf =f only iff lies within the Nyquist interval, that is, only if a f≤f /2, which is equivalent to the sampling theorem requirement. Iff lies outside s the Nyquist interval, that is, ff /2, violating the sampling theorem condition, then s the “aliased” frequencyf will be different fromf and the reconstructed analog signal a x (t) will be different from x(t), even though the two agree at the sampling times, a x (nT)=x(nT). a It is instructive also to plot in Fig. 1.4.3 the aliased frequencyf =f mod(f ) versus a s the true frequencyf. Observe how the straight linef =f is brought down in segments true by parallel translation of the Nyquist periods by multiples off . s In summary, potential aliasing effects that can arise at the reconstruction phase of DSP operations can be avoided if one makes sure that all frequency components of the signal to be sampled satisfy the sampling theorem condition, f≤ f /2, that is, all s † The only exception is when it falls exactly on the left or right edge of the interval,f=±f /2. s ‡ This differs slightly from a true modulo operation; the latter would bringf into the right-sided Nyquist interval0,f . s12 1. SAMPLINGANDRECONSTRUCTION f = f mod( f ) a s f 2 / s -f s f -f /2 0 f 2 f / 2f s s s s -f /2 s Fig. 1.4.3 f mod(f ) versusf. s frequency components lie within the Nyquist interval. This is ensured by the lowpass antialiasing prefilter, which removes all frequencies beyond the Nyquist frequencyf /2, s as shown in Fig. 1.3.5. Example 1.4.1: Consider a sinusoid of frequencyf = 10 Hz sampled at a rate off = 12 Hz. The s sampled signal will contain all the replicated frequencies 10+m12 Hz,m = 0,±1,±2,... , or, ...,−26, −14, −2, 10, 22, 34, 46,... and among these onlyf = 10 mod(12)= 10−12=−2 Hz lies within the Nyquist interval a −6, 6 Hz. This sinusoid will appear at the output of a reconstructor as a−2 Hz sinusoid instead of a 10 Hz one. On the other hand, had we sampled at a proper rate, that is, greater than 2f = 20 Hz, say atf = 22 Hz, then no aliasing would result because the given frequency of 10 Hz already s lies within the corresponding Nyquist interval of−11, 11 Hz. Example 1.4.2: Suppose a music piece is sampled at rate of 40 kHz without using a prefilter with cutoff of 20 kHz. Then, inaudible components having frequencies greater than 20 kHz can be aliased into the Nyquist interval−20, 20 distorting the true frequency components in that interval. For example, all components in the inaudible frequency range 20 ≤f ≤ 60 kHz will be aliased with−20 = 20−40 ≤f−f ≤ 60−40 = 20 kHz, which are audible. s Example 1.4.3: The following five signals, wheret is in seconds, are sampled at a rate of 4 Hz: − sin(14πt), − sin(6πt), sin(2πt), sin(10πt), sin(18πt) Show that they are all aliased with each other in the sense that their sampled values are the same. f = f true1.4. SAMPLINGOFSINUSOIDS 13 Solution: The frequencies of the five sinusoids are: −7, −3, 1, 5, 9Hz They differ from each other by multiples of f = 4 Hz. Their sampled spectra will be s indistinguishable from each other because each of these frequencies has thesame periodic replication in multiples of 4 Hz. Writing the five frequencies compactly: f = 1+ 4m, m=−2,−1, 0, 1, 2 m we can express the five sinusoids as: x (t)= sin(2πf t)= sin(2π(1+ 4m)t), m=−2,−1, 0, 1, 2 m m Replacingt =nT =n/f =n/4 sec, we obtain the sampled signals: s x (nT) = sin(2π(1+ 4m)nT)= sin(2π(1+ 4m)n/4) m = sin(2πn/4+ 2πmn)= sin(2πn/4) which are the same, independently ofm. The following figure shows the five sinusoids over the interval 0 ≤t ≤ 1 sec. t 1 0 They all intersect at the sampling time instantst =nT =n/4 sec. We will reconsider this example in terms of rotating wheels in Section 1.4.2. Example 1.4.4: Letx(t) be the sum of sinusoidal signals x(t)= 4+ 3 cos(πt)+2 cos(2πt)+ cos(3πt) wheret is in milliseconds. Determine the minimum sampling rate that will not cause any aliasing effects, that is, the Nyquist rate. To observe such aliasing effects, suppose this signal is sampled at half its Nyquist rate. Determine the signalx (t) that would be aliased a withx(t). Solution: The frequencies of the four terms are: f = 0,f = 0.5 kHz,f = 1 kHz, andf = 1.5 1 2 3 4 kHz (they are in kHz becauset is in msec). Thus,f =f = 1.5 kHz and the Nyquist rate max 4 will be 2f = 3 kHz. Ifx(t) is now sampled at half this rate, that is, atf = 1.5 kHz, max s then aliasing will occur. The corresponding Nyquist interval is−0.75, 0.75 kHz. The frequenciesf andf are already in it, and hence they are not aliased, in the sense that 1 2 f =f andf =f . Butf andf lie outside the Nyquist interval and they will be aliased 1a 1 2a 2 3 4 with14 1. SAMPLINGANDRECONSTRUCTION f =f mod(f )= 1mod(1.5)= 1− 1.5=−0.5 kHz 3a 3 s f =f mod(f )= 1.5mod(1.5)= 1.5− 1.5 = 0 kHz 4a 4 s The aliased signalx (t) is obtained fromx(t) by replacingf ,f ,f ,f byf ,f ,f ,f . a 1 2 3 4 1a 2a 3a 4a Thus, the signal x(t)= 4 cos(2πf t)+3 cos(2πf t)+2 cos(2πf t)+ cos(2πf t) 1 2 3 4 will be aliased with x (t) = 4 cos(2πf t)+3 cos(2πf t)+2 cos(2πf t)+ cos(2πf t) a 1a 2a 3a 4a = 4+ 3 cos(πt)+2 cos(−πt)+ cos(0) = 5+ 5 cos(πt) The signalsx(t) andx (t) are shown below. Note that they agree only at their sampled a values, that is,x (nT)=x(nT). The aliased signalx (t) is smoother, that is, it has lower a a frequency content thanx(t) because its spectrum lies entirely within the Nyquist interval, as shown below: x(t) x (t) a t 0 T 2T 3T 4T 5T 6T 7T 8T 9T The form ofx (t) can also be derived in the frequency domain by replicating the spectrum a ofx(t) at intervals off = 1.5 kHz, and then extracting whatever part of the spectrum lies s within the Nyquist interval. The following figure shows this procedure. ideal 4 reconstructor 3/2 3/2 2/2 2/2 2/2 2/2 1/2 1/2 1/2 1/2 f -0.75 0.75 -1.5 -1 -0.5 0 0.5 1 1.5 kHz Nyquist Interval Each spectral line ofx(t) is replicated in the fashion of Fig. 1.3.2. The two spectral lines of strength 1/2 atf =±1.5 kHz replicate ontof = 0 and the amplitudes add up to give a 4 total amplitude of(4+ 1/2+ 1/2)= 5. Similarly, the two spectral lines of strength 2/2 at1.4. SAMPLINGOFSINUSOIDS 15 f =±1 kHz replicate ontof=∓0.5 kHz and the amplitudes add to give(3/2+2/2)= 2.5 3 at f =±0.5 kHz. Thus, the ideal reconstructor will extract f = 0 of strength 5 and 1 f =±0.5 of equal strengths 2.5, which recombine to give: 2 2πj0.5t −2πj0.5t 5+ 2.5e + 2.5e = 5+ 5 cos(πt) This example shows how aliasing can distort irreversibly the amplitudes of the original frequency components within the Nyquist interval. Example 1.4.5: The signal x(t)= sin(πt)+4 sin(3πt)cos(2πt) wheret is in msec, is sampled at a rate of 3 kHz. Determine the signalx (t) aliased with a x(t). Then, determine two other signalsx (t) andx (t) that are aliased with the same 1 2 x (t), that is, such thatx (nT)=x (nT)=x (nT). a 1 2 a Solution: To determine the frequency content ofx(t), we must express it as a sum of sinusoids. Using the trigonometric identity 2 sina cosb = sin(a+b)+ sin(a−b), we find:   x(t)= sin(πt)+2 sin(3πt+ 2πt)+ sin(3πt− 2πt) = 3 sin(πt)+2 sin(5πt) Thus, the frequencies present inx(t) aref = 0.5 kHz andf = 2.5 kHz. The first already 1 2 lies in the Nyquist interval−1.5, 1, 5 kHz so thatf =f . The second lies outside and 1a 1 can be reduced modf to givef =f mod(f )= 2.5mod(3)= 2.5− 3=−0.5. Thus, the s 2a 2 s given signal will “appear” as: x (t) = 3 sin(2πf t)+2 sin(2πf t) a 1a 2a = 3 sin(πt)+2 sin(−πt)= 3 sin(πt)−2 sin(πt) = sin(πt) To find two other signals that are aliased withx (t), we may shift the original frequencies a f ,f by multiples off . For example, 1 2 s x (t) = 3 sin(7πt)+2 sin(5πt) 1 x (t) = 3 sin(13πt)+2 sin(11πt) 2 where we replacedf,f byf +f,f =3.5, 2.5 forx (t), and byf +2f,f +f = 1 2 1 s 2 1 1 s 2 s 6.5, 5.5 forx (t). 2 Example 1.4.6: Consider a periodic square wave with periodT = 1 sec, defined within its basic 0 period 0 ≤t ≤1by ⎧ 1 ⎪ 1, for 0t 0.5 ⎨ t x(t)= −1, for 0.5t 1 ⎪ ⎩ 0.5 0 1 0, for t = 0, 0.5, 1 -1 wheret is in seconds. The square wave is sampled at ratef and the resulting samples are s reconstructed by an ideal reconstructor as in Fig. 1.4.2. Determine the signalx (t) that a will appear at the output of the reconstructor for the two casesf = 4Hzandf = 8 Hz. s s Verify thatx (t) andx(t) agree at the sampling timest =nT. a16 1. SAMPLINGANDRECONSTRUCTION Solution: The Fourier series expansion of the square wave contains odd harmonics at frequen- ciesf =m/T =m Hz,m = 1, 3, 5, 7,... . It is given by m 0 x(t) = b sin(2πmt)= m m=1,3,5,... (1.4.4) =b sin(2πt)+b sin(6πt)+b sin(10πt)+··· 1 3 5 whereb = 4/(πm),m = 1, 3, 5,... . Because of the presence of an infinite number of m harmonics, the square wave is not bandlimited and, thus, cannot be sampled properly at any rate. For the ratef = 4 Hz, only thef = 1 harmonic lies within the Nyquist interval s 1 −2, 2 Hz. For the ratef = 8 Hz, onlyf = 1 andf = 3 Hz lie in−4, 4 Hz. The s 1 3 following table shows the true frequencies and the corresponding aliased frequencies in the two cases: f f 1357 9 11 13 15 ··· s 4Hz f mod(4) 1 −11 −11 −11 −1 ··· 8Hz f mod(8) 13 −3 −11 3 −3 −1 ··· Note the repeated patterns of aliased frequencies in the two cases. If a harmonic is aliased with ±f =±1, then the corresponding term in Eq. (1.4.4) will appear (at the output of the 1 reconstructor) as sin(±2πf t)=± sin(2πt). And, if it is aliased with ±f =±3, the term 1 3 will appear as sin(±2πf t)=± sin(6πt). Thus, forf = 4, the aliased signal will be 3 s x (t) =b sin(2πt)−b sin(2πt)+b sin(2πt)−b sin(2πt)+··· a 1 3 5 7 =(b −b +b −b +b −b +···)sin(2πt) 1 3 5 7 9 11 =A sin(2πt) where ∞ ∞   4 1 1 A = b −b = − (1.4.5) 1+4k 3+4k π 1+ 4k 3+ 4k k=0 k=0 Similarly, forf = 8, grouping together the 1 and 3 Hz terms, we find the aliased signal s x (t) =(b −b +b −b +···)sin(2πt)+ a 1 7 9 15 +(b −b +b −b +···)sin(6πt) 3 5 11 13 =B sin(2πt)+C sin(6πt) where ∞ ∞   4 1 1 B = b −b = − 1+8k 7+8k π 1+ 8k 7+ 8k k=0 k=0 (1.4.6) ∞ ∞   4 1 1 C = b −b = − 3+8k 5+8k π 3+ 8k 5+ 8k k=0 k=01.4. SAMPLINGOFSINUSOIDS 17 There are two ways to determine the aliased coefficientsA,B,C. One is to demand that the sampled signals x (nT) and x(nT) agree. For example, in the first case we have a T = 1/f = 1/4, and therefore,x (nT)= A sin(2πn/4)= A sin(πn/2). The condition s a x (nT)=x(nT) evaluated atn = 1 impliesA = 1. The following figure showsx(t),x (t), a a and their samples: t 1/4 1/2 0 1 Similarly, in the second case we haveT = 1/f = 1/8, resulting in the sampled aliased s signalx (nT)=B sin(πn/4)+C sin(3πn/4). Demanding the conditionx (nT)=x(nT) a a atn = 1, 2 gives the two equations √ B sin(π/4)+C sin(3π/4)= 1 B+C = 2 ⇒ B sin(π/2)+C sin(3π/2)= 1 B−C = 1 √ √ which can be solved to giveB =( 2+ 1)/2 andC =( 2− 1)/2. The following figure showsx(t),x (t), and their samples: a t 1/8 1/2 0 1 The second way of determiningA,B,C is by evaluating the infinite sums of Eqs. (1.4.5) and (1.4.6). All three are special cases of the more general sum: ∞ 4 1 1 b(m,M)≡ − π m+Mk M−m+Mk k=0 withMm 0. It can be computed as follows. Write  ∞   1 1 −mx −(M−m)x −Mkx − = e −e e dx m+Mk M−m+Mk 0 then, interchange summation and integration and use the geometric series sum (forx 0) ∞ 1 −Mkx e = −Mx 1−e k=0 to get18 1. SAMPLINGANDRECONSTRUCTION  ∞ −mx −(M−m)x 4 e −e b(m,M)= dx −Mx π 1−e 0 Looking this integral up in a table of integrals 30, we find:   4 mπ b(m,M)= cot M M The desired coefficientsA,B,C are then:   π A =b(1, 4)= cot = 1 4 √   1 π 2+ 1 B =b(1, 8)= cot = 2 8 2 √   1 3π 2− 1 C =b(3, 8)= cot = 2 8 2 The above results generalize to any sampling ratef =M Hz, whereM is a multiple of 4. s For example, iff = 12, we obtain s x (t)=b(1, 12)sin(2πt)+b(3, 12)sin(6πt)+b(5, 12)sin(10πt) a and more generally x (t)= b(m,M)sin(2πmt) a m=1,3,...,(M/2)−1 The coefficientsb(m,M) tend to the original Fourier series coefficientsb in the continuous- m time limit,M→∞. Indeed, using the approximation cot(x)≈ 1/x, valid for smallx,we obtain the limit 4 1 4 lim b(m,M)= · = =b m M→∞ M πm/M πm The table below shows the successive improvement of the values of the aliased harmonic coefficients as the sampling rate increases: coefficients 4Hz 8Hz 12 Hz 16 Hz ∞ b 1 1.207 1.244 1.257 1.273 1 b – 0.207 0.333 0.374 0.424 3 b – – 0.089 0.167 0.255 5 b – – – 0.050 0.182 7 In this example, the sampling rates of 4 and 8 Hz, and any multiple of 4, were chosen so that all the harmonics outside the Nyquist intervals got aliased onto harmonics within the intervals. For other values off , such asf = 13 Hz, it is possible for the aliased harmonics s s to fall on non-harmonic frequencies within the Nyquist interval; thus, changing not only the relative balance of the Nyquist interval harmonics, but also the frequency values. 1.4. SAMPLINGOFSINUSOIDS 19 When we develop DFT algorithms, we will see that the aliased Fourier series coef- ficients for the above type of problem can be obtained by performing a DFT, provided that the periodic analog signal remains a periodic discrete-time signal after sampling. This requires that the sampling frequencyf be an integral multiple of the fundamen- s tal harmonic of the given signal, that is,f =Nf . In such a case, the aliased coefficients s 1 can be obtained by anN-point DFT of the firstN time samplesx(nT),n = 0, 1,...,N−1 of the analog signal. See Section 9.7. Example 1.4.7: A sound wave has the form: x(t) = 2A cos(10πt)+2B cos(30πt) + 2C cos(50πt)+2D cos(60πt)+2E cos(90πt)+2F cos(125πt) wheret is in milliseconds. What is the frequency content of this signal? Which parts of it are audible and why? This signal is prefiltered by an analog prefilterH(f). Then, the outputy(t) of the pre- filter is sampled at a rate of 40 kHz and immediately reconstructed by an ideal analog reconstructor, resulting into the final analog outputy (t), as shown below: a y(t) y(nT) y (t) x(t) a prefilter 40 kHz analog H(f) sampler reconstructor analog analog digital analog Determine the output signalsy(t) andy (t) in the following cases: a (a) When there is no prefilter, that is,H(f)= 1 for allf. (b) WhenH(f) is the ideal prefilter with cutofff /2 = 20 kHz. s (c) WhenH(f) is a practical prefilter with specifications as shown below: Analog Prefilter H(f) 60 dB/octave (0 dB) 1 (-60 dB) f 0 20 40 60 80 kHz That is, it has a flat passband over the 20 kHz audio range and drops monotonically at a rate of 60 dB per octave beyond 20 kHz. Thus, at 40 kHz, which is an octave away, the filter’s response will be down by 60 dB. For the purposes of this problem, the filter’sphaseresponse may be ignored in deter- mining the outputy(t). Does this filter help in removing the aliased components? What happens if the filter’s attenuation rate is reduced to 30 dB/octave? Solution: The six terms ofx(t) have frequencies:

Advise: Why You Wasting Money in Costly SEO Tools, Use World's Best Free SEO Tool Ubersuggest.