top | item 35523969

Nyquist Frequency

81 points| 1_over_n | 3 years ago |en.wikipedia.org | reply

82 comments

order
[+] _kb|3 years ago|reply
Had a great encounter with this recently!

In an environment I work there's multichannel audio recordings that are archived. The archival recordings all had a perfect 4kHz tone appearing, seemingly out of nowhere. This was happening on every channel, across every room, but only in one building. Nowhere else. Absolutely nothing of the sort showed up on live monitoring. The systems were all the same and yet this behaviour was consistent across all systems only at one location.

The full system was reviewed: from processing, recording, signal distribution, audio capture, and in room. Maybe there was a test gen that had accidentally deployed? Nope. Some odd bug in an echo canceller? Also no. Something weird with interference from lighting or power? Slim chance, but also no. Complete mystery.

When looking for acoustic sources there was an odd little blip on the RTA at 20kHz. This was traced back to a test tone emitted from the fire safety system (ultrasonic signal for continuous monitoring). It's inaudible to most people and will be filtered before any voice-to-text processing so no reason for concern. Anyway 20kHz is nowhere near 4kHz though so the search continued.

The dissimilarly of 20kHz and 4kHz is true, until you consider what happens in a non-bandwidth limited signal. The initial capture was taking place at a 48kHz sampling rate. It turns out the archival was downsampling to 24kHz, without applying an anti-aliasing filter. Without filtering, any frequency content above the Nyquist 'folds' back over the reproducible range. So in this case a clean 24kHz bandwidth signal with a little bit of inaudible ultrasonic background noise was being folded at 12kHz to create a very audible 4kHz tone.

It was essentially a capture the flag for signals nerds and a whole lot of fun to trace.

[+] spacechild1|3 years ago|reply
> It turns out the archival was downsampling to 24kHz

But... why?

[+] EarthIsHome|3 years ago|reply
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 210 MSPS, so that the bandwidth of interest doesn't butt up against the Nyquist zone edges.)

[+] cushychicken|3 years ago|reply
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 rate. The Nyquist criterion works at every multiple of the sampling frequency.

Bandpass filter your analog input appropriately from 950-1050MHz and you’re golden.

This is the way nearly every commodity Wi-Fi chip downsamples 2.4/5GHz raw RF. Sigma-delta ADCs are cheap, fast, and space efficient for die area using this method.

[+] kayson|3 years ago|reply
I know what you're getting at, but your statement, as others have pointed out, is incorrect. Your sampling rate always always has to be twice the highest frequency of the signal you are sampling.

If you are sampling an RF-modulated signal with a center frequency of 1GHz and 100MHz of baseband bandwidth, then yes, you do need to sample at 2.2GHz+. And some applications do exactly that.

If you're taking the RF signal, mixing it down to baseband, and filtering it to bandlimit, then you have a signal with maximum frequency component of 100MHz, and in that case, yes, your sampling rate can be 200MHz+

[+] YakBizzarro|3 years ago|reply
That's true, but there are a couple of things more. First, your DAC or ADC need to have such analog bandwidth. Working in a higher Nyquist zone also require higher amplification since the signal would be considerably weaker and more complex filtering to remove the signal from the other zones
[+] IIAOPSW|3 years ago|reply
I'm mentally filling in the gaps here and assuming MSPS is MegaSamplesPerSecond?
[+] wittenbunk|3 years ago|reply
Only true for continuous RF sources.

For transient signals you need at least Nyquist frequency.

[+] Chinjut|3 years ago|reply
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!

[+] mikepavone|3 years ago|reply
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?
[+] paulsutter|3 years ago|reply
Thank you I came here to post exactly this. Suggestion, you might want to correct the wikipedia page
[+] gaze|3 years ago|reply
Yeah but you also need the bandwidth of the sampler to exceed the highest frequency of the sample. Most samplers are limited by some kind of RC time and not their sinc envelope. Most.
[+] polalavik|3 years ago|reply
If you're interested in learning more about various DSP topics, I run a blog on over at https://signalprocessingjobs.com/ - a signal processing job board and blog!

One of the more popular series is the Journal2Matlab blog about translating academic journal papers into easy to read matlab.

[+] lumb63|3 years ago|reply
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, etc. If you graph that, it’s a perfect triangle wave, not a sine wave! That’s what I couldn’t not get past. I thought you’d need an infinite sampling rate to accurately capture the sine wave.

As I type this out, I’m realizing that a critical component of this that I wasn’t taught (or I didn’t grasp) is the need for the signal to be bandlimited. Returning to my sine example from above, what bothered me was, if I don’t sample more points, how do I know that it’s only a sine wave, and nothing more? That only works if you pretend there are no higher frequencies (or filter them out, though an ideal filter is impossible in practice). If there aren’t higher frequencies, there can’t be anything you “can’t capture” by sampling at the Nyquist frequency.

[+] tomjakubowski|3 years ago|reply
A triangle wave at 1Hz would have many higher frequency components. If you know a priori that the highest frequency of the signal is 1Hz, sampling at 2Hz is enough to infer 0, 1, 0, -1, ... came from a sine wave.
[+] jancsika|3 years ago|reply
I've had an open GSoC project for some years to create a library that makes a handful of these audio misconceptions true. So the student would design an oscillator or oscillator bank where the closer you get to Nyquist, the more some "bad thing" happens to the corresponding output. Morphing into a triangle would be one way to do it.
[+] Sesse__|3 years ago|reply
What you are saying is generally correct, but: If you sample a 1 Hz sine at 2 Hz, you wouldn't get readings of 0, 1, 0, -1, etc.; you would get readings of 1, -1, 1, -1, etc., or if you're very unlucky, 0, 0, 0, 0, …! The _exact_ case is of Fs/2 is, well, an edge case.
[+] rnpk|3 years ago|reply
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.
[+] coolandsmartrr|3 years ago|reply
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.

[+] regularfry|3 years ago|reply
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.

[+] kimburgess|3 years ago|reply

  When a grid’s misaligned
  with another behind
  That’s a moiré…

  When the spacing is tight
  And the difference is slight
  That’s a moiré
[+] monkeycantype|3 years ago|reply
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.
[+] xchip|3 years ago|reply
Beware, there are lots of misconceptions in the comments.
[+] elromulous|3 years ago|reply
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).

[+] ska|3 years ago|reply
That isn't really what is going on. If the signal doesn't contain any higher frequency information, the Nyquist limit establishes what you need to exactly reconstruct the signal. It is therefore sufficient for any use.

So your case, a 1hz sin doesn't contain any higher frequencies, and will be reconstructed perfectly. A 1hz sawtooth contains higher frequencies, and so is not.

I think what you are really getting into is that a signal with periodicity of, say 1hz, does not mean that the Nyquist limit is 1hz. Square waves and sawtooths are particularly obvious examples of this, because the sharp edges cannot be achieved without (very many) high frequency contributions.

Now you can avoid this by creating a different set of component functions and a different sense of "frequency" but that just pushes the problem around. Also, since you are doing non-standard things you need to explain it, especially if what you are using doens't form a proper basis.

Finally, of course this is all in the idea mathematical setting, in real world noise etc. also has to be taken into effect.

[+] Evidlo|3 years ago|reply
A 1Hz sawtooth contains frequencies above 1Hz.

It actually has frequency components that go out to infinity, so its impossible to perfectly reconstruct a sawtooth without knowing beforehand that its a sawtooth.

This is true for any signal with discontinuities (i.e. not "band-limited").

[+] Sesse__|3 years ago|reply
> 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.

Yes, it does. The Nyquist criterion gives exactly the (minimum) sampling frequency you need for perfect reconstruction of a bandlimited signal.

> 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).

A 1 Hz sawtooth is not a bandlimited signal, so the Nyquist theorem does not apply.

[+] duped|3 years ago|reply
> It doesn't say anything about whether said sampling rate is sufficient for reconstruction or whatever your intended use is.

Formally, the Shannon-Nyquist theorem states that if you sample a band limited signal at twice its bandwidth, an ideal reconstruction filter can be used to perfectly reconstruct the input signal. There's some wiggle room over ideal sampling/filtering, but the point is that it tells you exactly what the input was, provided it was band limited.

The misconception I think you're having is that band width is not the period of a signal.

[+] femto|3 years ago|reply
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.

[+] GeompMankle|3 years ago|reply
What is the point of adding a misconception?

The conception of the theorem is that if the signal being sampled is sufficiently integrable AND bandlimited AND the signal is uniformly sampled at at least the Nyquist rate over all time/space THEN then reconstruction of the bandlimited signal is exactly possible using the sinc interpolator. The proof is covered in "Shannon's original proof" in the Wikipedia article and most books on signal analysis such as Gaskill's Linear System book. Most EE people will have to do the proof as an intro course assignment in the first month of a DSP class.

OTOH, if you are not able to sample the function over all space or time AND the function happens to be periodic outside the interval you did sample THEN reconstruction of the bandlimited periodic signal is possible using the Dirchlet kernel.

If you are not able to sample the function overall space (from the first) AND that function is not periodic, you have small problems which occasionally become big problems if you are no careful. Most DSP books have a chapter about windowing discrete data and dealing with this conundrum. Basically, exact reconstruction is not guaranteed and context-specific techniques need to be employed to ensure desirable fidelity.

[+] kardos|3 years ago|reply
A 1hz sawtooth would not be band limited below 2hz
[+] TimTheTinker|3 years ago|reply
A low pass filter at 2hz would filter out the high frequencies contained in a sawtooth waveform, thus rendering a 1hz sine waveform.

To accurately sample a 1hz sawtooth waveform, you'd have to filter/sample at a much higher frequency.

[+] Gordonjcp|3 years ago|reply
Sampling a 1Hz sawtooth at 2Hz will alias.