11 ms·
Nyquist Frequency
- kurokawad 3y ago[flagged]
- EarthIsHome 3y agoOne 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.)
- paulsutter 3y agoThank you I came here to post exactly this. Suggestion, you might want to correct the wikipedia page
- stagger87 3y agoYou do not want to "correct" the wiki because the wiki is not wrong. The person you are replying to is clearly thinking about some sort of RF system (given the frequencies mentioned) where it's important to have a baseband filter to eliminate aliasing, and that filter will have some sort of roll off region, resulting in a higher sample rate than available bandwidth. That's all great, but the Nyquist theorem isn't talking about an RF system. It's referring to sampling. When the wiki uses the word "bandwidth", they mean the frequencies that don't alias given a specific sample rate.
- eternauta3k 3y agoIs the wikipedia page really wrong though? Highest frequency is what the mathematicians care about. EEs care about bandwidth because they're always modulating stuff and thinking in terms of carrier and baseband. Strictly speaking, what the EE grandparent suggested is using aliasing to mix the signal down to baseband.
- IIAOPSW 3y agoI'm mentally filling in the gaps here and assuming MSPS is MegaSamplesPerSecond?
- BenjiWiebe 3y agoYes
- YakBizzarro 3y agoThat'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
- wittenbunk 3y agoOnly true for continuous RF sources. For transient signals you need at least Nyquist frequency.
- azalemeth 3y agoOr use the traditional "lock-in" amplifier technique of mixing with a known reference at the frequency mid-point of the range you care about? (That's how NMR spectrometers / MRI scanners worked for decades
- muffles 3y agoIsnt the lock-in amplifier technique used to improve the SNR ratio of a signal by filtering out noise at frequencies outside a specific range of interest? High-speed sampling would still be required to accurately measure transient signals.
- mhh__ 3y agoIn that sense isn't the bandwidth 0-Max anyway though?
- mikepavone 3y agoIs 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?
- klodolph 3y agoNo, this assumption is incorrect. You can ADC first and then demodulate afterwards. The spectrum of your high-frequency (near 1 GHz) signal will be aliased at frequencies below the Nyquist frequency, but it’s easy to calculate the original frequency, if you know that the signal is band-limited.
- labcomputer 3y agoAs the sibling comment mentioned, you don’t need to demodulate first, because that is actually what the sampling process of your ADC does. You can think of it as multiplying the original signal by a comb (in the time domain) of delta functions, which folds everything (in the frequency domain) back into the nyquist frequency of your ADC. Each delta function corresponds to one sample. If your original signal was truly band-limited to 100MHz, then what comes out is a replica of the band limited signal. One catch (which is actually fairly easy to do in practice) is that the sampling window needs to correspond to around 1/f of the carrier frequency. This is what YakBizzaro is talking about (ADC analog bandwidth) in their sibling post.
- mikepavone 3y agoThanks for the explanation! Between your comment and the Undersampling wiki page diydsp linked to I think I am on the path to enlightenment. > If your original signal was truly band-limited to 100MHz In practice, this means you need to band pass before the ADC, right? i.e. "signal" in this case is the entire input to the ADC and not just the particular modulated signal you care about
- labcomputer 3y ago> In practice, this means you need to band pass before the ADC, right? i.e. "signal" in this case is the entire input to the ADC and not just the particular modulated signal you care about Right and right. And, you’d normally want that to be a contiguous 100 MHz band of frequencies (you could in principle have multiple discontiguous bands that add up to 100 MHz if they are spaced right (they don’t fold down to the same base frequencies), but that would be quite an unusual application).
- kayson 3y agoI 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+
- gct 3y agoI'm afraid you're mistaken (source: worked as DSP engineer for 15 years). Often you apply your filter around the RF frequency you want and then sample at a lower rate. You're right that the signal will get aliased doing that, but the information is always preserved. If you sample s.t. your folding frequencies are in an appropriate place, you can fold your desired region into the first nyquist region without needing to mix it down. This is especially desirable if you can avoid having to build an IQ mixer because they're hard to keep balanced. The worst case doing this is that your signal spectrum is reversed in frequency, but you can correct that easily digitally.
- deleted 3y ago[deleted]
- kayson 3y agoI'm afraid I'm not mistaken (source: I design integrated RF transceivers) ;) Yes, you can subsample if you have a suitably bandpass-limited signal. But that's not the general case, nor is it what the nyquist-shannon theorem proves, which is where "nyquist frequency" comes from. Nyquist frequency by the original definition is 2X highest frequency, though some papers textbooks evidently have started using it to mean 2X bandwidth, enough so that wikipedia[1] actually mentions it. In integrated circuits, IQ mixing isn't problematic as we can fairly easily do gain and phase calibration to correct for the mismatch. [1] https://en.m.wikipedia.org/wiki/Nyquist_frequency#Other_meanings https://en.m.wikipedia.org/wiki/Nyquist_frequency#Other_mean...
- gaze 3y agoYeah 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.
- cushychicken 3y agoThe 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.
- femto 3y agoThe 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-concept-of-polyphase-filters https://www.dsprelated.com/thread/7758/understanding-the-con... https://s3.amazonaws.com/embeddedrelated/user/124841/fbmc_book_ch_6_text_5_61615.pdf https://s3.amazonaws.com/embeddedrelated/user/124841/fbmc_bo... https://s3.amazonaws.com/embeddedrelated/user/124841/fbmc_ch_6_supplement_3_934.pdf https://s3.amazonaws.com/embeddedrelated/user/124841/fbmc_ch...
- Sesse__ 3y agoPolyphase 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 <a> zeros between every input sample (which repeats the spectrum <a> times), 2. Apply a suitable (long!) FIR lowpass filter so that the signal is bandlimited, 3. Take every <b>-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 <a>-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 <b> different such filters before you're back where you started.
- Chinjut 3y agoConsider 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!
- Chinjut 3y agoThat is, it's not quite as simple as saying you just need to sample at any frequency at least twice the bandwidth. Rather, it's the more complicated behavior described by this graph: https://en.wikipedia.org/wiki/Undersampling#/media/File:Samplerates.svg https://en.wikipedia.org/wiki/Undersampling#/media/File:Samp.... That is, the general rule is that the ratio of the highest frequency in the signal to half the sample rate, and the ratio of the lowest frequency in the signal to half the sample rate, have to lie within an interval of consecutive natural numbers. When the lowest frequency is zero, this is the familiar rule that the sample rate has to be at least twice the highest frequency in the signal. But more generally, it's more complicated.
- Chinjut 3y agoWhoops, I should've pulled the division by x out of the definition of f. The example I had in mind was [sin(4πx) - 2 sin(6πx) + sin(8πx)]/x. [Another good example is [sin(6πx) - 2 sin(8πx) + sin(10πx)]/x, whose frequencies are between 3 Hz and 5 Hz, thus a bandwidth of 2 Hz, but sampling at 4 Hz or even 8Hz gets all zeroes.] Anyway, the details on that example don't matter, the Wikipedia graph and article makes things more clear.
- polalavik 3y agoIf you're interested in learning more about various DSP topics, I run a blog on over at https://signalprocessingjobs.com/ 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.
- gooseyard 3y agoDan Worrall made a fantastic video which touches on Nyquist. His youtube channel is a tremendous resource: https://www.youtube.com/watch?v=-jCwIsT0X8M https://www.youtube.com/watch?v=-jCwIsT0X8M
- elromulous 3y agoTo 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).
- kardos 3y agoA 1hz sawtooth would not be band limited below 2hz
- Evidlo 3y agoA 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").
- PaulDavisThe1st 3y agoThis is incorrect, though subtly, and for several different reasons: 1) It is completely possible to create a sawtooth wave that contains only a single frequency. However, you could also consider the wave to be an (infinite) sum of sinusoids at different frequencies. Both views are "correct", and which is more appropriate depends on the context. 2) Related to (1): natural (acoustic) sounds are almost always best considered as a sine series. While there are such sounds which are most easily described as a sawtooth, when you consider the physical/mechanical process by which they are formed, the sine series is a more obvious approach. 3) A digital 1Hz sinusoid can trivially contain no harmonics at all. However, the moment you attempt to convert this into an acoustic pressure wave, the nature of the physical world essentially guarantees that the acoustic pressure wave will have a series of harmonics going out far beyond the base frequency. Once you start actually moving things (like magnetic coils, speaker cones and air), it's more or less impossible to avoid generating harmonics. But since the original signal was genuinely a pure sine tone, it becomes a little tricky to decide what the correct way to describe this is.
- _kb 3y agoHad 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 3y ago> It turns out the archival was downsampling to 24kHz But... why?
- deleted 3y ago[deleted]
- InitialLastName 3y agoIn situations where you don't need the archival to be at "perfect reproduction" quality (including things like broadcast archives or recordings of voice comms) you can get by with a 12kHz maximum frequency without losing the essentials (especially clarity of voices). Many adults can't hear much past 12kHz anyway and most music and voice content doesn't have content past 10khz. You don't lose much, but you save half your file size by x2 downsampling.
- lumb63 3y agoSignals 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.
- Sesse__ 3y agoWhat 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.
- tomjakubowski 3y agoA 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 3y agoI'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.
- 3y ago
- abhaynayar 3y agoSoothing.
- coolandsmartrr 3y agoI 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 3y agoYep. 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.
- OscarCunningham 3y agoOr you can vibrate the camera: https://en.wikipedia.org/wiki/Pentax_K-3 https://en.wikipedia.org/wiki/Pentax_K-3.
- regularfry 3y agoOf 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.
- kimburgess 3y agoYou can buy them: https://rawlite.com/olpf-for-blackmagic-pocket-cinema-camera-4k/ https://rawlite.com/olpf-for-blackmagic-pocket-cinema-camera..., https://www.grassvalley.com/products/optical_low_pass_filter https://www.grassvalley.com/products/optical_low_pass_filter
- monkeycantype 3y agoThe 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 3y agoBeware, there are lots of misconceptions in the comments.