DSPRelated.com
Forums

What Nyquist Didn't Say

Started by Tim Wescott September 29, 2006

Tim Wescott wrote:
> I've seen a lot of posts over the last year or so that indicate a lack > of understanding of the implications of the Nyquist theory, and just > where the Nyquist rate fits into the design of sampled systems. > > So I decided to write a short little article to make it all clear. > > It's a little longer than 'short', and it took me way longer than I > thought it would, but at least it's done and hopefully it's clear. > > You can see it at > http://www.wescottdesign.com/articles/Sampling/sampling.html. > > If you're new to this stuff, I hope it helps. If you're an expert and > you have the time, please feel free to read it and send me comments or > post them here. >
I just had to stop reading about half way through. The writing style and organization is structurally incoherent and comes across as desultory gibberish with intolerably sloppy terminology and perspective. On the upside, it should be somewhat beneficial to the low caliber types who are confused by the subject matter.
> Tim Wescott wrote: > > I've seen a lot of posts over the last year or so that indicate a lack > > of understanding of the implications of the Nyquist theory, and just > > where the Nyquist rate fits into the design of sampled systems. > > > > So I decided to write a short little article to make it all clear. > >
Tim, I like the article and totally agree that there's a lot of smoke and mirrors and misuse of sampling theorem ideas. I would definitely point newcomers to your description. Please don't take the following as flaming. But I just can't resist throwing in a couple of my favourite pet peeves :-( I echo the sentiments of an earlier comment about fs >= 2fmax versus fs > 2fmax If you look at e.g. Oppenheim & Wilsky, Signals & Systems pp 519 they clearly state in terms of proper greater than. However, if you look at Shannon&Weaver "The Mathematical Theory of Communication" P 86 "Band limited ensembles of functions" it's less clear (verbage rather than math): they say (more or less) "let f(t) contain no frequencies over W. Then you can sample at 2W". This would imply the geater-than or equal, which I suspect is incorrect. In fact, in your article you point out that you cannot sample a sine wave at exactly 2*f unless you know the phase, which clearly contradicts the ">=" interpretation. (Actually you need the phase and the amplitude). I'm not entirely sure of the history but I suspect that the band-limiting can actually be traced much father back to Fourier analysis in mid 1800's. In the same vein, I've thought that one could do a neat write-up of how to reconstruct from the sampling of sin(2*pi*f*s) at a frequency approaching (but not equal to) 2f. If you describe how the almost-aliased-to-DC low frequency samples (regardless of phase) get turned back into a full amplitude signal through the magic of sinx/x reconstruction, it would be very cool. The samples would (where phase approached one side) be almost perfect (+1,-1,+1,-1) but as the phase drifted the other way, the envelope would attenuate (+0.0001, -0.0001, etc). Through the magic of summing an infinite series, you get your full-size plain old sine wave back. But that might be more math than the scope of this article. I also would propose a change to sec 3.3 about repetitive signals. There is really no difference between this example and 3.4 - band limited signals! The only reason that the powerline sampling in sec 3.3 works is that you're talking about a bandlimited "modulation" signal that's modulating a 60Hz carrier! So it's not really the case that "sometimes you can sample slower than the Nyquist Thm would indicate"... this is a little misleading. I'd introduce it more like "some classes of signals, which appear to be fast, are actually low bandwidth, they're just a slowly modulated carrier, so you get a low Fs". (I'm not being precise but I hope you get my drift). Cheers, - Kenn
"Mike Monett" <No@email.adr> schrieb im Newsbeitrag 
news:Xns984E39E43288BNoemailadr@208.49.80.251...
> miso@sushi.com wrote: > >> Note that the Bessel filter will ring at higher orders. I don't have my >> copy of Zverev handy, but I think the Bessel rings at 4th order and >> higher. > > Are you sure about that? Here is a 9th order 1 MHz Bessel for LTspice. > (Save as a CKT file) > > * UTS Mike Monett > * Converted From Micro Cap Source file to LTspice > * > C1 0 1 248.3PF > C2 0 2 1200.0PF > C3 0 3 2007.3PF > C4 0 4 2749.9PF > C5 0 Vout 7209.4PF > L1 1 2 1.8UH > L2 2 3 4.1UH > L3 3 4 5.9UH > L4 4 Vout 8.6UH > R1 Vin 1 50 > R5 0 Vout 50 > V1 Vin 0 DC 0 PULSE (0 1 0 0 0 2.5e-006 5e-006) > .TRAN 1e-008 10u 0 1n UIC > .PRINT TRAN V(VOUT) V(VIN) > .PLOT TRAN V(VOUT) V(VIN) > .PROBE > .END > ;$SpiceType=SPICE3 > > It doesn't ring. > > Regards, > > Mike Monett
Hello Mike, It seems you have overlooked that LTspice assumes a certain rise and fall time if you specify t_rise=0 or t_fall=0. V1 Vin 0 DC 0 PULSE (0 1 0 0 0 2.5e-006 5e-006) LTspice assumes in this case trise = fall = 10%*Twidth = 250ns This is the reason why you see no overshoot. Now we use fast edges. V1 Vin 0 DC 0 PULSE (0 1 0 1n 1n 2.5e-006 5e-006) You will see about 1.6x% overshoot. By the way, I am not sure how precise the choosen component values are to get the ideal Bessel filter response. Bessel filters have indeed overshoot in the step response. Best regards, Helmut
  "Helmut Sennewald" <helmutsennewald@t-online.de> wrote:

  > "Mike    Monett"     <No@email.adr>     schrieb    im  Newsbeitrag
  > news:Xns984E39E43288BNoemailadr@208.49.80.251...

  >> miso@sushi.com wrote:

  >>> Note that the Bessel filter will ring at higher orders.  I don't
  >>> have my  copy of Zverev handy, but I think the  Bessel  rings at
  >>> 4th order and higher.

  >> Are you sure about that? Here is a 9th order 1 MHz Bessel for
  >> LTspice. (Save as a CKT file)

  >> * UTS Mike Monett
  >> * Converted From Micro Cap Source file to LTspice
  >> *
  >> C1 0 1 248.3PF
  >> C2 0 2 1200.0PF
  >> C3 0 3 2007.3PF
  >> C4 0 4 2749.9PF
  >> C5 0 Vout 7209.4PF
  >> L1 1 2 1.8UH
  >> L2 2 3 4.1UH
  >> L3 3 4 5.9UH
  >> L4 4 Vout 8.6UH
  >> R1 Vin 1 50
  >> R5 0 Vout 50
  >> V1 Vin 0 DC 0 PULSE (0 1 0 0 0 2.5e-006 5e-006)
  >> .TRAN 1e-008 10u 0 1n UIC
  >> .PRINT TRAN V(VOUT) V(VIN)
  >> .PLOT TRAN V(VOUT) V(VIN)
  >> .PROBE
  >> .END
  >> ;$SpiceType=SPICE3

  >> It doesn't ring.

  >> Regards,

  >> Mike Monett

  > Hello Mike,

  > It seems  you have overlooked that LTspice assumes a  certain rise
  > and fall time if you specify t_rise=0 or t_fall=0.

  > V1 Vin 0 DC 0 PULSE (0 1 0 0 0 2.5e-006 5e-006)

  > LTspice assumes in this case trise = fall = 10%*Twidth = 250ns

  > This is the reason why you see no overshoot.

  > Now we use fast edges.

  > V1 Vin 0 DC 0 PULSE (0 1 0 1n 1n 2.5e-006 5e-006)

  > You will see about 1.6x% overshoot. By the way, I am not  sure how
  > precise the  choosen component values are to get the  ideal Bessel
  > filter response. Bessel filters have indeed overshoot in  the step
  > response.

  > Best regards,
  > Helmut

  Hi Helmut,

  Thanks for taking a look at this, and for pointing out  that LTspice
  changes the rise and fall times if you do not specify the  values. I
  am still learning how LTspice works, and these unexpected variations
  from other SPICE programs can be major pitfalls.

  In this  case,  the amount of overshoot is very small,  and  I'm not
  sure if  the 1.6% is not caused by the way the component  values are
  rounded.

  I use  this filter program for general filter design.  The component
  values were calculated for the theoretical values and  the inductors
  were rounded  to 2 significant digits. This reflects  the difficulty
  in obtaining precision inductors, particularly at VHF and UHF.

  The capacitors  were rounded to tenths of a pf. This is  because the
  program is  used mostly for work at VHF and UHF, where the  caps are
  much smaller.  It  may well be that  using  the  correct theoretical
  values for  the components may reduce or eliminate the  small amount
  of overshoot you measured.

  However, there is still the practical matter of  obtaining inductors
  and capacitors  with the needed precision, and any  practical filter
  will have  imperfect  components.   I   have  found  the  Bessel and
  Equiripple to  be much more tolerant of errors  in  component values
  than other filter types, and still give good performance.

  If we are concerned about such small values of overshoot, we need to
  repeat this using the correct theoretical values for the components.
  Even so,  an  overshoot of 1.6% is not in the same  category  as the
  overshoot from Butterworth or other non-linear phase  filters, which
  may have  ten  percent or more, depending on  the  sharpness  of the
  cutoff. In practise, the Bessel and Equiripple are considered linear
  phase filters, and have negligible overshoot.

  For example, a Butterworth or other nonlinear group delay filter may
  cause excessive timing errors when used to filter digital data. This
  can be minimized by changing to a Bessel or Equiripple filter.

  So practically  speaking,  the   Bessel  and  Equiripple distinguish
  themselves from  other filters by the constant  group  delay through
  the filter bandpass, and the low or non-existant overshoot.

  Regards,

  Mike Monett

  Antiviral, Antibacterial Silver Solution:
  http://silversol.freewebpage.org/index.htm
  SPICE Analysis of Crystal Oscillators:
  http://silversol.freewebpage.org/spice/xtal/clapp.htm
  Noise-Rejecting Wideband Sampler:
  http://www3.sympatico.ca/add.automation/sampler/intro.htm
Tim, great article and I'm liking your book.

Tim Wescott wrote:
> I've seen a lot of posts over the last year or so that indicate a lack > of understanding of the implications of the Nyquist theory, and just > where the Nyquist rate fits into the design of sampled systems. >...
It is just me or did anyone else get a strong sense of deja-vu? -Dave -- David Ashley http://www.xdr.com/dash Embedded linux, device drivers, system architecture
Fred Bloggs wrote:

> > > Tim Wescott wrote: > >> I've seen a lot of posts over the last year or so that indicate a lack >> of understanding of the implications of the Nyquist theory, and just >> where the Nyquist rate fits into the design of sampled systems. >> >> So I decided to write a short little article to make it all clear. >> >> It's a little longer than 'short', and it took me way longer than I >> thought it would, but at least it's done and hopefully it's clear. >> >> You can see it at >> http://www.wescottdesign.com/articles/Sampling/sampling.html. >> >> If you're new to this stuff, I hope it helps. If you're an expert and >> you have the time, please feel free to read it and send me comments or >> post them here. >> > > I just had to stop reading about half way through. The writing style and > organization is structurally incoherent and comes across as desultory > gibberish with intolerably sloppy terminology and perspective. On the > upside, it should be somewhat beneficial to the low caliber types who > are confused by the subject matter. >
Finally! Someone who sees my writing the way I do! I think we're in the minority, though. I don't think of the intended audience as "low caliber", though -- just people who've had a different educational background, and whose back-brains don't light up with equations when they see a fountain, or a near miss on the freeway. I have to say that this paper rather turned into a monster while I was writing it. I thought it was going to be between 2000 and 3000 words, with almost no math and very little real work. Instead it's about 5500 words, and I've got about a man-week into all those pretty charts and graphs (I should publish an appendix with "the making of..." along with all the math underneath). As a reaction to this I haven't done my usual stage of letting it rest and getting back to it -- I was afraid I'd never do the "getting back to it" step. Instead I've put it outside without giving it time to get it's coat and boots on. If I can figure out how to tighten it up I certainly will -- assuming that I don't run away screaming at the thought of doing even _more_ work on it. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Posting from Google? See http://cfaj.freeshell.org/google/ "Applied Control Theory for Embedded Systems" came out in April. See details at http://www.wescottdesign.com/actfes/actfes.html
David Ashley wrote:

> Tim Wescott wrote: > >>I've seen a lot of posts over the last year or so that indicate a lack >>of understanding of the implications of the Nyquist theory, and just >>where the Nyquist rate fits into the design of sampled systems. >>... > > > It is just me or did anyone else get a strong sense of deja-vu? > > -Dave >
Yes, I did write essentially that at the head of a posting soliciting suggestions for the article -- and you all helped. (note to self -- add an acknowledgments section) -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Posting from Google? See http://cfaj.freeshell.org/google/ "Applied Control Theory for Embedded Systems" came out in April. See details at http://www.wescottdesign.com/actfes/actfes.html
>I've seen a lot of posts over the last year or so that indicate a lack >of understanding of the implications of the Nyquist theory, and just >where the Nyquist rate fits into the design of sampled systems. > >So I decided to write a short little article to make it all clear. > >It's a little longer than 'short', and it took me way longer than I >thought it would, but at least it's done and hopefully it's clear. > >You can see it at >http://www.wescottdesign.com/articles/Sampling/sampling.html. > >If you're new to this stuff, I hope it helps. If you're an expert and >you have the time, please feel free to read it and send me comments or >post them here. > >-- > >Tim Wescott >Wescott Design Services >http://www.wescottdesign.com > >Posting from Google? See http://cfaj.freeshell.org/google/ > >"Applied Control Theory for Embedded Systems" came out in April. >See details at http://www.wescottdesign.com/actfes/actfes.html >
My opinion is that your paper is a good opening introduction to the sampling process of real time signals. The concept of &#4294967295;sub sampling&#4294967295;, section 3.3 is very much used in sophisticated systems where acquisition limitations are being pushed. However, the effect is not so much a result of a &#4294967295;quirk&#4294967295; in the Nyquist theorem, but of an understanding of definitions of the analysis signals to begin with. In your example, a Sinc function convolved with a single frequency. Perhaps you said that and I just missed it. The issue of group dly and the trade offs one could make to correct the problem, i.e., brute force, &#4294967295;make the hardware&#4294967295; perfect vs adaptive filter correction is another topic in of itself. My personal experience in control loops is that the electronics is just so much faster than the mechanical plant or sensors that the issue of delay as a result of the use of a Nyquist filter is just not an issue. Albeit the potential for problems needs to be understood. jdc
Mike Monett wrote:
> miso@sushi.com wrote: > >> Note that the Bessel filter will ring at higher orders. I don't have >> my copy of Zverev handy, but I think the Bessel rings at 4th order >> and higher. > > Are you sure about that? Here is a 9th order 1 MHz Bessel for LTspice. > (Save as a CKT file) >
Bessel filters do have a small overshoot, which decreases at higher orders. 2nd .43% 4th .84% 6th .64% 8th .34% 10th .06% note the *very low* value for higher orders. In fact the frequency response gets hardly better then. The Gauss filter has indeed zero ringing, but a much larger transition band. -- ciao Ban Apricale, Italy