Live data from Hacker News

Nyquist Frequency

en.wikipedia.org

61–70 of 86 posts

Re: Nyquist Frequency

#61

One misconception that many make regarding the Nyquist frequency is thinking that the sampling rate needs to be twice the highest frequency. Your sampling should really really be twice the bandwidth . e.g. your bandwidth is 100 MHz centered at 1 GHz (it needs to actually be bandlimited to 100 MHz**). You do not need to sample at 2.2 GHz. You sample at 200 MSPS (really, you should sample a little more than that, say 2…

Consider a signal whose value at x seconds is f(2x) - 2 f(3x) + f(4x), where f(x) = sin(2πx)/x. Considering that the absolute frequencies of f(x) are uniformly distributed from 0 to 1 Hz, the absolute frequencies of this total signal should be constrained to between 2 and 4 Hz. Thus, a bandwidth of 2 Hz. But if we sample at 6 Hz (three times the bandwidth!) including x = 0, we'll get all zeros.

Granted, we might say that from the perspective of the complex Fourier transform using signed frequencies, the frequencies of this signal actually range over [-4 Hz, -2 Hz] U [+2 Hz, +4 Hz]. But I'm not sure that's the interpretation you had in mind.

Let me know if I've screwed anything up here!

Re: Nyquist Frequency

#62

To add another misconception, the Nyquist frequency is a lower bound, below which you necessarily get aliasing. It doesn't say anything about whether said sampling rate is sufficient for reconstruction or whatever your intended use is. E.g. sampling a 1hz signal at 2hz still doesn't tell you if the signal was a 1hz sin or a 1hz sawtooth (depending on how lucky or unlucky you are).

If you know the signal is periodic with known frequency/period, you can be clever and sample it at that that frequency +/- a small offset. The frequency spurs then will not fall on top of each other and you can "unwrap" them to give a more complete picture of the signal. In that way you could determine whether a signal with a known frequency of 1Hz is a sawtooth or sine.

Nyquist more or less says "If I you know nothing about the signal, by sampling at X Hz, you can determine what the signal looks like over a bandwidth of 0 Hz to X/2 Hz". If you have additional knowledge about the signal (eg. band limited, periodic or other) you can exceed those limits.

It can also be looked at from an information viewpoint. Nyquist says "if you sample a signal at a certain rate you will get a certain amount of new information about it". You might "spend" this information by saying something about the signal over the band DC-f/2, or you might choose to say something about the signal over a different band of frequencies. In the example above we chose to say something about a set of discrete harmonic frequencies over a very wide bandwidth, ignoring the frequencies in between the harmonics as the 1Hz constraint told us they will be zero.

Re: Nyquist Frequency

#63
I saw the Nyquist Frequency mentioned in the American Cinematographer Magazine. The article illustrate how detailed patterns, like sweaters, can produce a fuzzy jagged artifact called moire. This is because there is too much information for camera's sensor to interpret and summarize the details into pixels (ie. surpassing the Nyquist Frequency).

Their suggested solutions were to 1) get a wide-angle lens to reduce detail beamed into the sensor 2) use a larger image sensor or 3) remove the object causing moire artifacts.

Re: Nyquist Frequency

#64

I saw the Nyquist Frequency mentioned in the American Cinematographer Magazine. The article illustrate how detailed patterns, like sweaters, can produce a fuzzy jagged artifact called moire. This is because there is too much information for camera's sensor to interpret and summarize the details into pixels (ie. surpassing the Nyquist Frequency). Their suggested solutions were to 1) get a wide-angle lens to reduce det…

Yep. Strictly speaking what's happening is that the pattern has a higher spatial frequency than the sensor, and the light detection acts as a non-linear interaction which aliases the higher frequencies down into the bandwidth of the sensor.

A wide-angle lens would change the effective bandwidth of the system, as would a larger sensor: all either would do is change the apparent size of the moire pattern (possibly so it's less annoying).

What you really want is something that would act as a spatial low-pass filter in front of the sensor; something like a very slightly frosted piece of glass which would prevent any feature size smaller than two sensor pixels from being resolved on the far side. I imagine if that wasn't a completely stupid idea for some other reason that you could buy them.

Re: Nyquist Frequency

#65
post #60

Earlier quoted context omitted.

The folks who are telling you you’re wrong don’t understand Nyquist’s criterion very well. Curse those undergrad courses for only effectively teaching about Nyquist at baseband frequencies. You can sample 100MHz of bandwidth at 1GHz just as you describe at 210MSPS. You’ll get everything in the 950-1050MHz band. Trouble is, without an antialiasing filter, you’ll get every other band that’s a multiple of that sampling…

The most fiendish application of this effect that I've seen is polyphase filtering. I can't remember the details, but at the time I can remember the wonder of understanding (in a lecture by fred harris) how most the logic was running at a low sampling rate yet the input was at a high rate. The mixing was done by aliasing. Details here: https://www.dsprelated.com/thread/7758/understanding-the-con... https://s3.amazona…

Polyphase filtering is less crazy than it initially sounds. Conceptually, you can think of it as: I have this signal in frequency f. I want to resample it to frequency (b/a)*f, where a and b are integers. (You can also do polyphase filtering to resample of non-rational or varying ratios, by essentially approximating towards a rational, but let's ignore that for the moment.) a and b can be pretty large if you want, e.g. a=160,b=147 will downsample from 48 kHz to 44100 Hz.

So what you do to resample a signal (again conceptually), is: 1. Add zeros between every input sample (which repeats the spectrum times), 2. Apply a suitable (long!) FIR lowpass filter so that the signal is bandlimited, 3. Take every -th sample (which doesn't cause any aliasing due to #2).

Now the core of the polyphase filtering idea: We don't need to actually calculate the FIR filter for the samples we don't want in #3. And most of the input values to the filter will be zero due to #1. So instead of storing all the zeros and stuff, we simply pick out every -th tap of the FIR filter and use that on the input signal directly. But since a and b don't line up perfectly, this means we get a different subset of the FIR filter for every output sample; we have a time-varying filter (or a filterbank, if you want). You get different such filters before you're back where you started.

Re: Nyquist Frequency

#66
post #47

Signals and systems was a tough course for me. It was what crushed my 4.0 GPA. Nyquist frequency was a concept I could not wrap my head around. I’ve improved, but it still doesn’t click as I’d like it to. When I took the course, it made no sense to me that you could sample at twice the frequency of the signal and reconstruct it. Consider a sine wave at 1 Hz. If you sample at 2 Hz, you’d get readings of 0, 1, 0, -1, e…

You get the original sine wave back from 0, 1, 0, -1 not by plotting it linearly (which gives you the triangle) but by using a sinc interpolation function.

Re: Nyquist Frequency

#67
The coolest nyquist frequency application I've every come across, if you look up how modulation of nerve impulses works in the optic never you can figure up the fastest rate of blinking your eye can perceive, and it checks out in reality.

Re: Nyquist Frequency

#68
post #60

Earlier quoted context omitted.

The folks who are telling you you’re wrong don’t understand Nyquist’s criterion very well. Curse those undergrad courses for only effectively teaching about Nyquist at baseband frequencies. You can sample 100MHz of bandwidth at 1GHz just as you describe at 210MSPS. You’ll get everything in the 950-1050MHz band. Trouble is, without an antialiasing filter, you’ll get every other band that’s a multiple of that sampling…

The most fiendish application of this effect that I've seen is polyphase filtering. I can't remember the details, but at the time I can remember the wonder of understanding (in a lecture by fred harris) how most the logic was running at a low sampling rate yet the input was at a high rate. The mixing was done by aliasing. Details here: https://www.dsprelated.com/thread/7758/understanding-the-con... https://s3.amazona…

Implemented a polyphase filter in Verilog once. I learned the hard way that it’s easy to mix in unwanted stuff into your polyphase chain if you’re not careful with your implementation.

Re: Nyquist Frequency

#69

One misconception that many make regarding the Nyquist frequency is thinking that the sampling rate needs to be twice the highest frequency. Your sampling should really really be twice the bandwidth . e.g. your bandwidth is 100 MHz centered at 1 GHz (it needs to actually be bandlimited to 100 MHz**). You do not need to sample at 2.2 GHz. You sample at 200 MSPS (really, you should sample a little more than that, say 2…

Is this assuming you have some analog hardware that's demodulating the signal in front of your ADC? How do you demodulate a signal from a 1GHz carrier with 200 MSPS?

To quote a meme: “That’s the neat part. You don’t.” If you bandlimit your input, aliasing effectively strips out the carrier tone and leaves the modulated signal.

In a way, you’re relying on aliasing / frequency folding to do it for you.

https://ars.els-cdn.com/content/image/3-s2.0-B97801241589310...

You can even improve information transfer in these scenarios by using a synchronizer, which allows you to phase shift your sampling to be at the ideal transition point in your information stream.

Re: Nyquist Frequency

#70

I saw the Nyquist Frequency mentioned in the American Cinematographer Magazine. The article illustrate how detailed patterns, like sweaters, can produce a fuzzy jagged artifact called moire. This is because there is too much information for camera's sensor to interpret and summarize the details into pixels (ie. surpassing the Nyquist Frequency). Their suggested solutions were to 1) get a wide-angle lens to reduce det…

Yep. Strictly speaking what's happening is that the pattern has a higher spatial frequency than the sensor, and the light detection acts as a non-linear interaction which aliases the higher frequencies down into the bandwidth of the sensor. A wide-angle lens would change the effective bandwidth of the system, as would a larger sensor: all either would do is change the apparent size of the moire pattern (possibly so i…

Of course, it occurs that the non-stupid version of this is to defocus the lens slightly, so the point spread function does the low-pass filtering job. That also tells you why the advice isn't "put a low-pass filter in front of the sensor": it'll be because for the non-moire case you need the resolution.
Post reply on HN