Path: EDN Asia >> Design Centre >> IC/Board/Systems Design >> Grasping the intuitive sampling theory (Part 2)
IC/Board/Systems Design Share print

Grasping the intuitive sampling theory (Part 2)

16 Oct 2013  | Michael Dunn

Share this page with your friends

In part 1, we began to make some intuitive connections between near-Nyquist sampling, the addition of close-frequency sines, and how those signals would interact with perfect LP filters. Let's put that aside for a moment to consider the aliasing phenomenon.

Through the looking glass
You've probably heard the term "aliasing." It's what you don't want your digital scope to do, for example. Can we get an intuitive handle on it?

First, what is it? Aliasing occurs when any part of a signal we are sampling is at or above the Nyquist frequency. Once we have an aliased signal, there's no way to fix it – no way to tell the difference between it and a valid signal. We need to avoid it in the first place!

Here's a little thought experiment to help understand aliasing. Imagine a sine wave right at the sampling frequency (say 1MHz at 1MSa/s). Each sample will fall at the same spot on the cycle. We'll end up with a DC level, not 1MHz.

Now, drop the input frequency to 999,999Hz. Each sample will be taken a tiny bit earlier in the sine cycle than the previous one – 0.00036° earlier if you're counting. After one million samples, the sampling point will have traversed one whole cycle. Our 999,999Hz signal appears as a 1Hz signal, and is time-reversed to boot.

Imagine continuing to lower the input frequency to our sampler. The apparent frequency will be a mirror image, if you will, of the actual input frequency, increasing from DC to the Nyquist as we decrease the input from f(s) to the Nyquist.

Figure 1: An example of aliasing. There are 10 cycles of input signal (in red), but only 11 sample points. The blue sine is what we're left with after sampling – a signal of frequency = 1 (11-10).

Now you have a feel for where that 505kHz signal comes from in our example from part 1 – it's the reflection of 495kHz across the 500kHz Nyquist.

I'm sure our more mathematical readers are cringing here and there, but I did promise to focus on acquiring a practical and intuitive feel for the subject, not on a theoretical explication.

To reiterate, this is why it's so important to limit the frequency range being sampled to below Nyquist. Once sampled, there's no way to tell an alias from a real signal.

Note that aliasing applies as much to signal generation as acquisition. Here's a good example: Many function generators today use DDS (Direct Digital Synthesis), where lookup tables (LUTs) are used to store one cycle of the desired waveforms. The tables are read using a pointer, and how much the pointer gets incremented between each sample determines the frequency output.

If the LUT contains a sine wave, we're smiling. Even if we increment the pointer so much between samples that only, say, three points are read per cycle before wrapping back to the beginning of the table, we are well below Nyquist, and the reconstruction filter should be able to recreate the sine in all its glory.

What if the LUT contains a more complex waveform? Now, we need to start thinking about Fourier and Nyquist together, and make sure we don't select a frequency that would place any harmonics contained in the LUT above Nyquist.

What if you select one of those staple waveforms: a square, pulse, triangle, or ramp? Yikes, all of those have an infinite number of harmonics. We're screwed.

The trick here is to fill the LUTs with band-limited versions of those waveshapes. Not a perfect square wave, but one synthesised using, say, only up to the 15th harmonic. That still means we're limited to generating frequencies below 1/15th of Nyquist.

What do commercial units do to solve this problem? I don't know. I do know that some simply have ridiculously low maximum-frequency limits, like one per cent of the sampling frequency! What I would do is to synthesise the waveforms as required. For example, dialling up a 50MHz square wave when f(s)=1GSa/s would cause the LUT to be created on the fly, with harmonics 1, 3, 5, 7, and 9 only (based on the specs, I'm pretty sure some DDS signal generators have special logic for pulse/square generation).

The kitchen sinc
We've mentioned the input anti-aliasing and output reconstruction filters in various contexts. Now let's take a close look at the magic these filters need to pull off in order to enable the whole concept of sampling to work properly.

What exactly are these two LPFs (low-pass filters)? Ideally, both pass no signal at or above Nyquist (half the sampling frequency), yet pass all signals below that – the fabled brick-wall filter. In practice, this is difficult to implement. Well, it's impossible. We do the best we can, often employing high-order elliptical designs. Imagine the challenge the early digital audio engineers faced, needing passband at 20kHz, and -96dB stopband at 22kHz!

1 • 2 Next Page Last Page

Want to more of this to be delivered to you for FREE?

Subscribe to EDN Asia alerts and receive the latest design ideas and product news in your inbox.

Got to make sure you're not a robot. Please enter the code displayed on the right.

Time to activate your subscription - it's easy!

We have sent an activate request to your registerd e-email. Simply click on the link to activate your subscription.

We're doing this to protect your privacy and ensure you successfully receive your e-mail alerts.

Add New Comment
Visitor (To avoid code verification, simply login or register with us. It is fast and free!)
*Verify code:
Tech Impact

Regional Roundup
Control this smart glass with the blink of an eye
K-Glass 2 detects users' eye movements to point the cursor to recognise computer icons or objects in the Internet, and uses winks for commands. The researchers call this interface the "i-Mouse."

GlobalFoundries extends grants to Singapore students
ARM, Tencent Games team up to improve mobile gaming

News | Products | Design Features | Regional Roundup | Tech Impact