DSPRelated.com
Forums

Nyquist Didn't Say That

Started by Tim Wescott August 22, 2006
David Hearn wrote:
> Tim Wescott wrote: > > Kinda off topic -- > > > > A month or two ago there was a spate of postings on these groups > > displaying a profound misunderstanding of how to apply Nyquist's theorem > > to problems of setting sampling or designing anti-alias filters. I > > helped folks out as much as I could, but it really demands an article, > > which I am currently working on. > > > > The misconceptions that I noticed pretty much boiled down to the > > following two: > > > > One, "I need to monitor a signal that happens at X Hz, so I'm going to > > sample it at 2X Hz". > > > > Two, "I can sample at X Hz, so I'm going to build an anti-alias filter > > with a cutoff of X/2 Hz". > > > > I estimate that answering these misconceptions will only take 3-4k > > words, but I don't want to miss any other big ones. > > > > Have you seen any other real howlers that relate to Nyquist, and what > > you should really be thinking about when you're pondering sampling > > rates, anti-aliasing filters and/or reconstruction filters? > > > > Danke. > > So, if you need to monitor a signal that occurs at xHz - what frequency > should you sample it at? > > D
a little over 2x the bandwidth of the signal should be sufficient, -Lasse
Jim Stewart wrote:

> Tim Wescott wrote: > >> Kinda off topic -- >> >> A month or two ago there was a spate of postings on these groups >> displaying a profound misunderstanding of how to apply Nyquist's >> theorem to problems of setting sampling or designing anti-alias >> filters. I helped folks out as much as I could, but it really demands >> an article, which I am currently working on. >> >> The misconceptions that I noticed pretty much boiled down to the >> following two: >> >> One, "I need to monitor a signal that happens at X Hz, so I'm going to >> sample it at 2X Hz". >> >> Two, "I can sample at X Hz, so I'm going to build an anti-alias filter >> with a cutoff of X/2 Hz". >> >> I estimate that answering these misconceptions will only take 3-4k >> words, but I don't want to miss any other big ones. >> >> Have you seen any other real howlers that relate to Nyquist, and what >> you should really be thinking about when you're pondering sampling >> rates, anti-aliasing filters and/or reconstruction filters? > > > Before going into a detailed article, perhaps > you could review/improve the wikipedia article: > > http://en.wikipedia.org/wiki/Nyquist-Shannon_sampling_theorem > >
Because I'm a mercenary. Posting to wikipedia doesn't pay directly, nor does it give me public credit. While it benefits the world it doesn't lead to me getting any checks in the mail. By contrast I can contribute to newsgroups, post articles on my website, or sell articles to trade magazines. Each one of these activities binds my name to the knowledge*, gives it distribution to the english speaking world to one extent or another, gives me a reasonable chance of having my name pop up on a web search, and should it get bought by a magazine I'll get almost 1/10th of minimum wage for the effort I've put into it. As a consequence, folks who need to know how to do the stuff I write about see me as a potential resource when they go looking for consultants. Until I win the lottery or retire I can't afford to spend the time on anonymous contributions to Wikis. * Hopefully that's a good thing. -- 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
Tim,

"Tim Wescott" <tim@seemywebsite.com> wrote in message 
news:hrGdnX1RNLcIE3bZnZ2dnUVZ_omdnZ2d@web-ster.com...
> Posting to wikipedia doesn't pay directly, nor does it give me public > credit. While it benefits the world it doesn't lead to me getting any > checks in the mail.
Perhaps you'd be willing to take your articles and post them on Wikipedia as well as the places where your name is directly tied to it (in a slightly modified form)? That way you'd help the public at large (it's a lot easier to find things on Wikipedia than trying to search through a dozen technical journals), and anyone who actually *has* money to pay will still find you. ---Joel
langwadt@ieee.org wrote:
> David Hearn wrote: > > Tim Wescott wrote: > > > Kinda off topic -- > > > > > > A month or two ago there was a spate of postings on these groups > > > displaying a profound misunderstanding of how to apply Nyquist's theorem > > > to problems of setting sampling or designing anti-alias filters. I > > > helped folks out as much as I could, but it really demands an article, > > > which I am currently working on. > > > > > > The misconceptions that I noticed pretty much boiled down to the > > > following two: > > > > > > One, "I need to monitor a signal that happens at X Hz, so I'm going to > > > sample it at 2X Hz". > > > > > > Two, "I can sample at X Hz, so I'm going to build an anti-alias filter > > > with a cutoff of X/2 Hz". > > > > > > I estimate that answering these misconceptions will only take 3-4k > > > words, but I don't want to miss any other big ones. > > > > > > Have you seen any other real howlers that relate to Nyquist, and what > > > you should really be thinking about when you're pondering sampling > > > rates, anti-aliasing filters and/or reconstruction filters? > > > > > > Danke. > > > > So, if you need to monitor a signal that occurs at xHz - what frequency > > should you sample it at? > > > > D > > a little over 2x the bandwidth of the signal should be sufficient,
Depending on what you want to do. And you'd better make sure that your sampling points aren't 180 degrees apart wrt to the signal frequency you want to sample. -- Bill Sloman, Nijmegen
Joel Kolstad wrote:

> Tim, > > "Tim Wescott" <tim@seemywebsite.com> wrote in message > news:hrGdnX1RNLcIE3bZnZ2dnUVZ_omdnZ2d@web-ster.com... > >>Posting to wikipedia doesn't pay directly, nor does it give me public >>credit. While it benefits the world it doesn't lead to me getting any >>checks in the mail. > > > Perhaps you'd be willing to take your articles and post them on Wikipedia as > well as the places where your name is directly tied to it (in a slightly > modified form)? That way you'd help the public at large (it's a lot easier to > find things on Wikipedia than trying to search through a dozen technical > journals), and anyone who actually *has* money to pay will still find you. > > ---Joel > >
I may do that. -- 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

Tim Wescott wrote:



>>> Have you seen any other real howlers that relate to Nyquist, and what >>> you should really be thinking about when you're pondering sampling >>> rates, anti-aliasing filters and/or reconstruction filters?
Recently I run into a problem with the digital PLL occasionally locking on the aliased frequencies. The problem happens when the signal constellation has N phase angles. That multiplies the difference phase by N. Thus the error frequency may appear to be higher then baudrate/2, causing all kinds of problems. Special care has to be taken to avoid this. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Tim Wescott <tim@seemywebsite.com> wrote in 
news:q6mdnZgxjJhQHnbZnZ2dnUVZ_rGdnZ2d@web-ster.com:

> Have you seen any other real howlers that relate to Nyquist, and what > you should really be thinking about when you're pondering sampling > rates, anti-aliasing filters and/or reconstruction filters? >
Leave plenty of headroom is the motto. These days, with disk space around a buck per Gig, and communication protocols that sling data from embedded systems to where they need to be very quickly, sample faster than you need to. Having a sample rate that's too fast could cause problems with digital filter design down the road a ways, but it a helluva lot easier to downsample later then to find out later you haven't sampled fast enough and lost data integrity. If it's important, filter if you need to. For about $100/channel, you can get nifty 8-pole Bessels that have pretty linear phase in the pass band. Personally, Im big on anti-aliasing filtering. I do pretty low frequency physiological stuff, and by matter of course I filter with 8 poles at 200Hz and sample at 500. But, people should be aware that anti-aliasing filtering is no magic bullet, and can be worthless if you design something wrong, like if you introduce ground loops or somehow push noise into the system after the filters. Anti-aliasing countermeasures begin with careful analog design to keep high frequency noise out of the system-- shields, good grounding schemes, correct bypassing, etc. Even with care, this can get nasty if you're driving real loads, like motors. I've toyed around with the whacked out idea of entirely isolating data acquisition and prefiltering from everything else, with isolating DC/DC converter or isolation transformers, and linear optical isolators on every analog input or output, and plain old optical isolators on every digital line. This design got expensive quickly, and its almost guaranteed to fail when someone new tries to expand your system. The more headroom in Nyquist you can afford to have, the less money you'll need to spend on your anti-aliasing filters, because the rolloff can be more gentle--sort of like how oversampling digital music makes the output filter cheaper. The choice of filter family is also a design parameter that might depend on good ol' Nyquist. If you're keeping things loose, you can choose a filter that doesn't drop like a hot rock, like a Bessel or Butterworth, but if you need to tighten things up, you need a Chebyshev or some such. That brings up another issue: anti-alias filtering is not free--clearly from a cost perspective, but you also need to deal with time delays and small passband gain fluctuation for Bessel Filters, passband phase distortion problems for Butterworth (and maybe a lower cutoff frequency to help with the slow rolloff), and phase and gain problems for the chebyshevs, when you need really fast rolloffs. I've also thought about actually doing silly things, like using dsp's to sample superfast with cheap analog filters on the inputs, and then doing the real filtering digitally, spitting the results out on DACs, and then resampling for storage. This seems real odd, but push comes to shove, it might be cheaper than $100 per channel for good analog filters. But, it doesn't really make sense-- you could just use the base system to oversample like mad, filter, and decimate prior to storage. Sorry for the ramble, Tim. It's a little late for me to be forming replies like this. -- Scott Reverse name to reply
Tim Wescott wrote:
> Kinda off topic -- > > A month or two ago there was a spate of postings on these groups > displaying a profound misunderstanding of how to apply Nyquist's theorem > to problems of setting sampling or designing anti-alias filters. I > helped folks out as much as I could, but it really demands an article, > which I am currently working on. > > The misconceptions that I noticed pretty much boiled down to the > following two: > > One, "I need to monitor a signal that happens at X Hz, so I'm going to > sample it at 2X Hz". >
Nyquist said that you need to sample at least 2X Bandwidth of the signal to accurately reconstruct that signal. This is often miss-quoted because in control system or some other applications the bandwidth goes down to dc so we are quote 2X highest freq of interest. Of course due to other problems (not going into them here) we need to sample about 5 to 10 times higher where feedback is involved. S.
*** top posting fixed ***
decious wrote:
> Tim Wescott wrote: >> David Hearn wrote: >>> Tim Wescott wrote: >>> >>>> A month or two ago there was a spate of postings on these groups >>>> displaying a profound misunderstanding of how to apply Nyquist's >>>> theorem to problems of setting sampling or designing anti-alias >>>> filters. I helped folks out as much as I could, but it really >>>> demands an article, which I am currently working on. >>>> >>>> The misconceptions that I noticed pretty much boiled down to the >>>> following two: >>>> >>>> One, "I need to monitor a signal that happens at X Hz, so I'm >>>> going to sample it at 2X Hz". >>>> >>>> Two, "I can sample at X Hz, so I'm going to build an anti-alias >>>> filter with a cutoff of X/2 Hz". >>>> >>>> I estimate that answering these misconceptions will only take >>>> 3-4k words, but I don't want to miss any other big ones. >>>> >>>> Have you seen any other real howlers that relate to Nyquist, >>>> and what you should really be thinking about when you're >>>> pondering sampling rates, anti-aliasing filters and/or >>>> reconstruction filters? >>> >>> So, if you need to monitor a signal that occurs at xHz - what >>> frequency should you sample it at? >> >> You need to be more than 2X times the highest interesting >> frequency component in your periodic wave, which can be quite >> high in some cases. You may also have to do some anti-alias >> filtering. >> >> Or in other words "that depends". Which is why I'm writing the >> dang article, so I only have to write it once... > > are you going to be including in your artcle cases with filter > banks, specifically, critical sampled, oversampled etc, and how > nyquist fits into those implementations?
Don't top-post. It is rude and contravenes the standard practices in newsgroups. Your response belongs below, or intermixed with, the *snipped* material you quote. See the links in my sig. below. The thing to remember about alias filtering is the word alias. The point is to remove incoming signals that can create false, or alias, signals in the output. No alias filter can really be an instantaneous cutoff, so you have to ensure that aliasing noise is sufficiently attenuated to not affect the actual response. At the same time all filters have effects on the time delay at various frequencies, or phase response. Linear phase filters, or constant delay filters, have much less sharp cutoffs than may be desirable. As ever, the task of the engineer is to make suitable compromises between performance and cost. There is nothing magic about the word Nyquist - it is purely a theoretical limit. I imagine these are the sort of things Tim will address. Read the links below, and please refrain from top-posting in the future. It will make life easier for all. -- Some informative links: news:news.announce.newusers http://www.geocities.com/nnqweb/ http://www.catb.org/~esr/faqs/smart-questions.html http://www.caliburn.nl/topposting.html http://www.netmeister.org/news/learn2quote.html
Tim Wescott wrote:
> Kinda off topic -- > > A month or two ago there was a spate of postings on these groups > displaying a profound misunderstanding of how to apply Nyquist's theorem > to problems of setting sampling or designing anti-alias filters. I > helped folks out as much as I could, but it really demands an article, > which I am currently working on. > > The misconceptions that I noticed pretty much boiled down to the > following two: > > One, "I need to monitor a signal that happens at X Hz, so I'm going to > sample it at 2X Hz". > > Two, "I can sample at X Hz, so I'm going to build an anti-alias filter > with a cutoff of X/2 Hz". > > I estimate that answering these misconceptions will only take 3-4k > words, but I don't want to miss any other big ones. > > Have you seen any other real howlers that relate to Nyquist, and what > you should really be thinking about when you're pondering sampling > rates, anti-aliasing filters and/or reconstruction filters? > > Danke.
A couple of others have mentioned this already, but the bandwidth vs highest frequency issue does come to mind. Rune