Phil Lucht Math & Physics Archive
Home / Math and Physics Files / Math / Spectral Theory Book / Edits done 2003 re L3

chapter 4

DOCX · 29.7 KB
Open DOCX file

Draft chapter from a book manuscript on spectral theory, in a folder of edits dated 2003. It argues that symmetric FIR filters have linear phase and constant group delay of (N-1)/2 time steps. It explains image spectra from sampling as interference between delta-function spectra, including amplitude modulated pulse trains, then begins a section on oversampling and decimation.

AI-written summary; may contain errors.

Extracted text (machine-read; may contain errors)
Chapter 4: Some Practical Topics This chapter applies the results of earlier chapters to some simple test situations and applications. By providing some wordy discussion of seemingly mundane topics, we attempt to prop up our so-far mostly mathematical approach to things. It is in matters like these that one's understanding is really put to the test. 4.1 Do FIR filters have linear phase? We stick this little discussion here for interest, and because it has a slight bearing on what follows. Consider the Fourier integral spectrum X(w) of a real valued pulse x(t) that is symmetrical and centered at t=0. Since x(-t) =x(t), you can fold the negative portion of the dt integration in (1.1) over to the positive side. When you do this, you get x(t) times e-iwt + e+iwt = 2cos(wt). Thus, everything is real, and X(w) must therefore be real. We have already seen several examples of this: d(t) gives X(w) = 1, a square pulse gives (At) sinc(wt/2). Thus, it is reasonable to say that X(w) is a sum of cosines. If we displace the pulse to the right by some amount of time M∆t, then X(w) is no longer real, it picks up the usual shift phase from (12.1) which here would be exp(-iwM∆t). Suppose now that x(t) is a pulse which we will sample to create the coefficients of a digital FIR filter. For example, suppose you have X"(z) = a + bz-1 + cz-2, N = 3. This is the Z transform of sample points of x(t) such that x0 = x(0) = a, x1 = x(∆t) = b andx2 = x(2∆t) = c. Suppose we set a=c. Then the x(t) being sampled looks like a nice symmetric pulse, but it is centered at t=∆t instead of t=0. The phase of X(w) for this x(t) must therefore be exp(-iw∆t). The pulse is 1 step off center, and 1 = (N-1)/2 for our N=3 case. Suppose we have an N=4 filter with coefficients a,b,b,a. This thing is now off center by 1.5 time steps. And the phase of X"(z) for such a filter will be exp(-i 1.5 w ∆t). Again, 1.5 = (N-1)/2. We hope you agree , based on an obvious extension of cases N=3 and N=4, that the phase of any convolution filter with N taps and with symmetric coefficients must be this: f(w) = -iw∆t(N-1)/2 ∆t(N-1)/2 = shift needed to bring x(t) back centered at t=0 and therefore the group delay is t = { (N-1)/2 } ∆t. Thus, with a symmetric set of coefficients, you can easily make an FIR filter that has constant group delay, and perfect linear phase. Excel made me a believer. 4.2 Where do Image Spectra come from? In this section, we first discuss delta functions, and then analyze again the notion of a delta function sampled signal. This leads to a simple understanding of the physical origin of image spectra. Then we extend the interpretation to the amplitude modulated pulse train. (a) Gaussian pulse. Here is the gaussian pulse and its gaussian spectrum: x(t) = exp[ -(t/a)2] X(w) = exp [ -()2 ] As the width 'a' of pulse x(t) pulse gets smaller , the width 2/a of the spectrum gets larger. Think of x(t) as being a summation of cosines, as noted above. The problem is killing off x(t) on both its sides, which are getting closer together. It takes higher and higher frequencies to cause this killoff as the pulse gets narrow. The area under x(t) we know from (10.1) is X(0) =1. Thus, in the limit a Æ 0, the above gaussian x(t) becomes exactly d(t). (b) Delta spike. So the spectrum now of d(t) is X(w) = 1. Now all frequencies up to infinity are required to force this spike to be zero on both its sides, which are now infinitely close together. For the gaussian, at least X(w) tapers off after a while when you get around w = 2/a. Here, you are stuck with a constant energy spectrum all the way out to a billion GHz and well beyond. You might say that all this spectral energy is in the sharp needle-like edge of the delta function . If you had a voltage v(t) = d(t) going into a 1K resistor, the pulse energy would be equal to d(0)/1000 watt-seconds, which is infinite. It takes more than all the generators in the universe to create one delta function, and the reason is that its spectral energy must be supported all the way out. (c) Delta Spike Sampled Signals and the Origin of Image Spectra In section 20 it was shown that if you "sample" a reasonable function y(t) with genuine delta function spikes, you end up with a Fourier integral spectrum that contains an infinite set of copies of the main spectrum of y(t). One tends ask oneself some questions: •Where do all those image spectra really come from? •How can they be there going out to infinite frequency? •Are they really there or not? A good example to consider is y(t) = a simple square box a little more than 3 times the delta function spacing. Then the sampled signal w(t) is a set of 3 delta spikes all by themselves, all of equal height, separated from each other by some ∆t. Since each delta has spectral energy out to infinity, and w(t) is a superposition of 3 of them, our second question is answered. No problem with infinite frequency here. Where does the "main spectrum" come from? Well, you might argue that there is a ghost of that square box sitting there in the three delta spikes. It is the skeleton of the box, it ought to have a little of the main spectrum. But why image spectra? In fact, from (20.5) and (9.2) we know what the answer must be for all the spectra, main + image: W(w) = w1 = 2p/∆t t = 2∆t This looks like a rough sum to try and compute. It is the superposition of little sinc patterns, but they are close together and overlap a lot. The second zero of the the main spectrum is smack on top of the center of the first image spectrum, and so on. Now, in answer to the first question above -- where do the image spectra come from -- we give our simple answer. Recall that X(w) = 1 is the spectrum of d(t), and recall the phasing rule for time shifts. Thus, if we add our three little delta's spectra we get this: W(w) = e+iw∆t + 1 + e-iw∆t In other words, the image spectra are caused by interference between the spectra of the three delta functions. This is also the "cause" of the main spectra as well, since it is really no different from the rest. The above sum is one we do in fact know how to do, W(w) = 1 + 2 cos(w∆t) Clearly this thing has a peak of 3 when w = 0, and that peak repeats whenever w∆t = m p, and these repeats are the image spectra. You always get repeats when you have phase intereference. Suppose we close the spacing between the delta functions so now 101 of them fit in our box y(t). The signal is more complicated because now we have to add up 101 phases, and the sum looks like: W(w) = 1 + 2 cos(w∆t) + 2 cos(2w∆t) + 2 cos(3w∆t) + ... 2 cos(50w∆t) Now it's easier to see the general picture from the sinc(w) sum above, since there is no longer any significant overlap. Basically, this set of 101 delta functions is acting like a phased array radar. There are interference maxima located at certain values of w where the phases are all "in phase". This happens when the phase difference between adjacent delta "transmitters" is a multiple of 2p. Thus, we set w∆t = m2p and find that the "radiation beams" are located at w = m(2p/∆t) = mw1. The main spectrum is the central beam at m=0. The other beams are the image spectra. So we now summarize our answers to the posed questions. First, the image spectra are generated by interference between the delta function spectra from simple superposition. Second, the interference is maximum whenever w = m(2p/∆t) , for m = any integer. Since integers don't stop anywhere, neither do the image spectra. They go to infinite frequency. Finally, yes they are really there, if you can really make a set of delta functions. (d) The spectrum of an amplitude modulated pulse train. We know the answer, it is given in the box in Section 25, W(w) = (1/T1) Xpulse(w) This situation is perhaps easier to handle than the delta function limit discussed above. xpulse(t) can be a pulse you can really make. If this pulse is a narrow square wave, our signal w(t) looks like that shown in Figure 26.1. The curve there is y(t). Now where do the image spectra come from? It's the same thing. Each pulse in the pulse train has a spectrum that is equal to yn Xpulse(w) multiplied by a phase determined by where that pulse is sitting. Here is the interference sum if there are only three pulses of amplitudes y-1, y0, y1: W(w) = y-1 Xpulse(w) • e+iw∆t + y0 Xpulse(w) • 1 + y1Xpulse(w) • e-jw∆t = Xpulse(w) [ y-1 • e+iw∆t + y0 • 1 + y1 • e-jw∆t ] Although the magnitude of each term is now different, the phases are still going to add up at the same places as before, at places where the phase between terms is a multiple of 2p. So you know there are going to be an infinite number of image spectra regardless of how many terms yn there are, and you know where they are going to be located: w = m(2p/∆t) . You see also how Xpulse(w) factors out to be a common factor in the final answer. So why is each spectrum a copy of Y(w)? By definition, the sum shown above is Y'(w), the Digital Fourier spectrum. And we know that Y'(w) is always a sum of the Y(w)'s. But this does not quite answer the question just posed. Instead of dwelling on this mystery, here is an observation that seems closely related and interesting. Suppose you only got the central spectrum Y(w), and no image spectra. You would then have obtained Y(w) from just the three sample points y-1, y0, y1. But there are many functions y(t) that hit these three points, and they cannot all have the same spectrum Y(w), see Figure 26.1. It is the overlap between the image spectra and the main spectrum Y(w) that resolves this puzzle. The sum of the main and all image spectra is exactly the equation above with the three terms. This sum only knows about the three numbers y-1, y0, y1 and ∆t. As you deform the curve y(t) such that it still hits these three values, you alter Y(w), so you alter the shape of the main and all image spectra. However, despite this alteration, they still add up to what they did before the alteration! You could thus say that the image spectra reflect the lack of knowledge of y(t). As you learn more about y(t) by having more sample points closer together, the image spectra recede away. When you have perfect knowledge of y(t), the image spectra are completely gone, and you have only the main spectrum Y(w). If y(t) is band-limited, then we have to adjust the above argument just slightly. As the sample points become closer, the image spectra do move out. But once the samples are close enough at spacing T1 such that Y(w) fits entirely below w1/2, the spectra no longer overlap and Y(w) is complete. Although only a finite number of points on y(t) are being sampled, Y(w) is completely known because there is no longer wiggle room (below the w1/2 limit) for an altered function y(t) to fit the points. What about the energy in our three-pulse signal? How many generators are now needed to make it? The bracketed three terms above by themselves require infinite energy, just as in our delta spike example, but we are of course saved by the overall multiplying factor Xpulse(w) which keeps the lights from dimming in Madagascar. For the box shaped pulse, we know that the envelope of Xpulse(w) goes down as 1/w , as shown in Figure 17.1. The area under |W(w)|2 is quite integrable, and by (10.5) is equal to the area under |w(t)|2 times 2p. With w(t) as shown in Figure 26.1, the result is easily computed and is quite finite. 4.3 Oversampling and Decimation. Consider a standard D/A output system operating at sampling period T1 and w1 = 2p/T1. Assume there are a few output latches before the D/A converter, and that the D/A is glitch-free. Assume there is some aperture time t on the output of the D/A with t/T1 = D, the aperture duty cycle, and that this is corrected by an analog post-filter with sin(x)/x correction. This has been discussed in detail in Section 26. The output of the D/A converter is signal w(t) which is an amplitude modulated pulse train approximation to signal y(t). We know the spectrum of w(t) from (26.3), W(w) = (1/T1) Xpulse(w,t) [ Y(w ) + ] where Xpulse(w,t) = t sinc(wt/2) exp(-iwt/2) Note that the image spectra are separated by distance w1, and Y(w) is the Fourier spectrum of y(t). Suppose now the digital clocking frequency going to the final latch before the D/A converter and the converter itself is raised by a factor of 4, and that the duty cycle of the D/A aperture is kept at D, but no other changes are made. What happens to the output signal w(t) and its spectrum W(w)? Certainly w(t) now looks different. The old w(t) was a set of duty cycle D pulses separated by T1 tracking the signal y(t), as shown in Figure 26.1. The new w(t) has closer pulses spaced by T1/4, and they are not tracking y(t) any more because the new pulses come in groups of 4 which have the same amplitude. Only every fourth pulse correctly "tracks" y(t). This is because back in the input latch to the D/A converter we clock in the same identical data four times since we raised this latch's clock rate by a factor of 4. The new pulse is the same as the original pulse except t is 1/4 what it was before, so we get Xpulse(w,t/4). What is the spectrum W(w) of this complicated new signal? We compute it in our standard way, by superposing time-shifted pulses. We get: W(w) =Xpulse(w,t/4) [ ..... y0 + y0 e-iw(T1/4) + y0 e-2iw(T1/4) + y0 e-3iw(T1/4) + .... ] Here we have shown the contribution of one group of four pulses of the same amplitude. The entire sum is groups of four like this. We can combine these four terms to get [ 1 + e-iw(T1/4) + e-2iw(T1/4) + e-3iw(T1/4) ] y0 = F(w) y0 Of course every group of four terms will have this same common factor F(w), so we can factor it out of the entire sum. The sum now looks like this: W(w) = Xpulse(w,t/4) F(w) [ ..... y0 + y1 e-4iw(T1/4) + y2 e-8iw(T1/4) + .... ] But now the thing in brackets is exactly Y'(w)/T1, our original digital Fourier spectrum of y(t). Go look at the definition in (25.5) . Thus we conclude that W(w) = (1/T1) Xpulse(w,t/4) F(w) [ Y(w ) + ] D stayed fixed So this is the spectrum of the output of our new circuit, where we have increased the output latch and D/A clock rate by 4, and have kept the D/A duty cycle fixed, and have done nothing else. Look at the result. There are many observations that can be made about it: (a) the Xpulse(w,t/4) is fine, it is just the aperture factor that we know is present. This is the spectrum of a pulse that is 4X narrower than our original pulse, so the sinc function is now 4X broader than it was before. This is an improvement, because we have less aperture distortion on the main spectrum. (b) Of course if we made the above change and held the aperture time t fixed (assuming it was less than 25% of T1 to start with), then we would still have our original Xpulse(w,t) . In this case, the above result would be W(w) = (1/T1) Xpulse(w,t) F(w) [ Y(w ) + ] t stayed fixed (c) The image spectra are still at spacing w1. They are not spaced at 4w1as you might think. (d) We have a new messy factor F(w) sitting in the result! At the new higher clock rate, you can think of this as the action of some mysterious filter F"(z) = 1 + z-1 + z-2 + z-3 that appeared out of nowhere. As we saw above, you can interpret this thing as the cause of the little pulses repeating four times. This new factor F(w) is bad news, because it is distorting our output signal. After all, the whole purpose of our circuit including the analog post-filter is to try and recover W(w) = Y(w). In the case that we held aperture time t fixed, the factor F(w) is the only "new" thing introduced into our result by the 4X clock speedup. Thus, by doing this speedup with a constant aperture time t, we have definitely made things worse. (e) Here is an interesting limit. Suppose the aperture were 100% before and after our change. This would be the case in the simplest circuit you could design. In this case, the signal w(t) does not change at all when we make our 4X speedup. It continues to be a stepwise fit to y(t). Thus W(w) must not change. Since the first formula above must apply, and since Y(w) certainly cannot have changed, it must be true in this case that: Xpulse(w,t/4) F(w) = Xpulse(w,t) for t = T1 That this is true is certainly not obvious , but when you write it all out, you find that it is indeed true. If you let z = exp(-iwT1/ 4), replace sinc(x) with sin(x)/x, and replace sin(x) with exponentials, the thing boils down to this: (1 - z) ( 1 + z + z2 + z3) = (1 - z4) which we know is true. In this case of maintaining 100% aperture time, we have not made things any worse by our 4X speedup. Things stay exactly the same. Looking back at the origin of F(w) in the above development, it is clear that you could get rid of the F(w) distortion and make F(w) = 1 if you were to kill off the last 3 pulses in every group of 4 pulses. It is easy to imagine a hardware circuit that would do this as part of the 4X speedup business. This process is called decimation, and the resulting spectrum for W(w) would be this: W(w) = (1/T1) Xpulse(w,t/4) [ Y(w ) + ] D stayed fixed+ decimation So if we do the 4X speedup with decimation, and keep the duty cycle of the D/A fixed, we get the above result that has no F(w) distortion, and also has reduced aperture distortion on the main spectrum because the aperture is 4X less than it was before. If we now think of aperture = 100% again, then w(t) is the exact shape of the digital signal before the D/A converter. That is, w(t) is the output of a latch clocked at 4X . Between clockings, the signal holds a constant level. So now forget the D/A converter and just think about this digital domain signal. If you speed up the clock 4X and decimate, the spectrum of the digital signal at the output of the decimating latch is given by W(w) = (1/T1) Xpulse(w,T1/4) [ Y(w ) + ] The factor Xpulse(w,T1/4) just arises from the fact that the signal is constant between sample points, so we are in effect superposing a bunch of abutting square wave pulses (3 out of 4 have zero amplitude). The digital signal at this point is in good shape. There is no F(w) distortion because we decimated. The image spectra are still w1 apart, they are not 4w1 apart. What happens now if you send this digital signal into a digital low pass filter designed to do roughly a brick wall just above w1/2. We assume that y(t) is Nyquist-OK and has no components beyond this point. We presume of course that this digital filter is going to run at the 4X rate. As we know from earlier analysis, the image spectra of this filter are spaced at 4w1. So the first thing that happens is that the two image spectra of W(w) which lie between the main spectrum and the m=4 spectrum are completely knocked out. So we get W(w) DigitalFilter(w) = Output(w) has spectra spaced by 4w1. If we now take Output(w) into a D/A converter running at 4X, here is what we get: Output(w) ≈ (1/T1) Xpulse(w,t) [ Y(w ) + ] 4X with decimation Here we use ≈ because the digital filter is probably not a perfect brick wall. Compare the above result to where we started this section, ie, a system without 4X and decimation: Output(w) = (1/T1) Xpulse(w,t) [ Y(w ) + ] 1X The only difference is that factor of 4 in the image spectra separation. The method being discussed here is called "4 times oversampling". If you do N times oversampling, including decimation and a digital filter, the image spectra are pushed out by a factor of N. Then you can run the D/A output through an analog filter that is optimized for constant phase, like a 3rd order Bessel filter that has 3 components including only 1 inductor Such filters tend to have rather amorphous magnitude dropoff, but that is fine here because there is lots of room between the main spectrum and the first image spectrum which is now at w = Nw1. The net result of doing all this is the following: FinalOutput(w) ≈ Y(w ) The digital convolution filter is hopefully a cheap digital integrated circuit, and the analog filter is also cheap. This is why 4X oversampling CD players cost $100. There are several ways of dealing with the potential aperture distortion. If you have a narrow-pulse ground-dumping sample and hold circuit after the D/A, you can make the aperture t very small, and pretty much get rid of the aperture distortion represented by Xpulse(w,t) . Or you can pre-correct for it in the digital filter by designing in a sinx/x boost. In the 1X situation, you might even set the aperture at full 100% since this puts the first zero of the sinc function at the first image spectrum, helping the analog post-filter to crush it out. Without the oversampling, this analog filter must try to meet both the brick wall and the constant phase requirements. Basically, this is an impossible task and one must compromise. The steep edge of the brick wall causes ringing , and ringing is distortion in the form of group delay dispersion, which is just a way of saying the filter has phase problems. Moreover, the filter is expensive because a brick wall requires high order. Looking in the charts, in order to have magnitude down below 100 dB at the first image spectrum, a Chebyshev filter with 0.1 dB passband ripple would have to be 11th order, which means 11 reactive components in a passive implementation.