• Please use real names.

    Greetings to all who have registered to OPF and those guests taking a look around. Please use real names. Registrations with fictitious names will not be processed. REAL NAMES ONLY will be processed

    Firstname Lastname

    Register

    We are a courteous and supportive community. No need to hide behind an alia. If you have a genuine need for privacy/secrecy then let me know!
  • Welcome to the new site. Here's a thread about the update where you can post your feedback, ask questions or spot those nasty bugs!

Sampling, reconstruction, and the sampling aperture

Doug Kerr

Well-known member
This morning will will first review the concept of the representation of a continuous phenomenon by sampling, and the reconstruction of the original phenomenon from those samples.

Our illustrations will show the sampling of a waveform, rather than an image. The reason is that the waveform is one-dimensional, and the principles can be seen most clearly here. The principles apply equally well to the sampling of an image, which is two-dimensional, but they are less clearly seen there.

Here is the battle zone:

Aperture-11.gif

In panel a we see, in black, our waveform. It is a sine wave, and as such comprises only one frequency. We can, if we wish, think of it as one component of a more generalized waveform.

We will sample it at a pitch p (which, if this were an actual electrical waveform, would be in seconds). We know that the Nyquist frequency for this situation would be 1/(2p). The vertical black lines represent the sampling instants.

We of course can only capture, by sampling, components of the phenomenon whose frequencies are less than the Nyquist frequency. I have shown here a waveform for which this is true (its frequency is actually 80% of the Nyquist frequency).

Sampling here is "instantaneous"—that is, the process captures the value of the waveform at the sampling instant. The purple arrows represent the "sampling agent" at this work.

In panel b we see the results of the sampling, a set of numbers which we represent as little red bars. (Where the value is zero, I show a little red dot.)

Note that so far nothing here is digital (there will in fact be nothing digital in the entire presentation).

Note also that we dare not assume that these numbers are captured with limited precision (that is, are rounded). They are precise representations of the value of the waveform at the respective sampling instant.

Sampling theory tells us that this suite of numbers completely and exactly describes the subject waveform.

If that is so (and it is!), then from that suite of numbers we should be able to reconstruct, completely and exactly, the original waveform. Let's do that in a fanciful way.

In panel c, we have plotted (as little green dots) the values of the samples.

In panel d, we draw a smooth curve (shown in blue) through all the green dots, but subject to an important restriction: the curve must contain no frequencies at or above the Nyquist frequency. (That will certainly be so for the reconstructed waveform if it indeed identical to the original waveform, since we stipulated it was so for the original waveform.)

It turns out that there is only one curve that can be drawn through the green dots and follow that restriction: a curve identical to the original waveform!

And thus the blue curve represents a complete and exact duplicate of the original waveform, reconstructed from only the suite of numbers seen (graphically) in panel b.

This is truly wondrous, and if of course the key to all digital representation of audio waveforms, video waveforms, and photographic images.

Time for breakfast. Next: Finite window sampling.

Best regards,

Doug
 

Doug Kerr

Well-known member
When we apply the sampling principle to an optical image formed by our lens, to fulfill the tidy concept of instantaneous sampling we would have to have the window into each photodetector be of infinitesimal size. That's hard to do, and has a bad side effect: there would be only an infinitesimal amount of light energy admitted to the photodetector during the exposure. This of course is antithetical to our need for a robust result with good immunity to noise.

So in fact we arrange for the "window" into each photodetector (the sampling aperture) to be as large as we can.

How does that affect the sampling and reconstruction principles we saw before?

We'll look into that, in the comforting and simplifying context of sampling a waveform, in this figure:

Aperture-12.gif

The subject here is the same waveform as before. Here, however, rather than capturing the value of the waveform at each sampling instant, we capture the average of its value over a finite period (then sampling aperture) centered on the sampling instant. We fancifully represent that in panel a with the magenta "windows". Their width (w) is 75% of the sampling pitch (p).

The suite of numerical values resulting from this process are shown in panel b, again as red bars that graphically represent those numbers.

The rest of the story plays out in panels c and d just as before. The result is the blue waveform.

It is identical to the original waveform except that it is reduced in amplitude.

The degree of reduction depends on two factors:

• The frequency of the waveform. The greater its frequency, the greater the degree of reduction in amplitude.

• The width of the sampling aperture (relative to the sampling pitch). The greater the width, the more rapid is the decline in amplitude with increasing frequency.

In the optical image situation, the overall effect is that there is a frequency response curve (an MTF) associated with the sampling process, its shape dependent on the relative width of the sampling aperture.

In an electrical system, we can compensate for this "aperture droop" in frequency response with an equalizing filter (which might itself be digital in nature). In the case of sampling an optical image, again we have the prospect of applying equalization digitally to the reconstructed image. [Thanks to Jerome for reminding me of this latter.]

On the other hand, in the optical situation, we are often in need of an optical low-pass filter (ahead of the sampling" to avert aliasing. The MTF associated with the finite sampling aperture can contribute to that need. The frequency response is far from optimal for that purpose, but hey—it's free.

Best regards,

Doug
 
Last edited:

Doug Kerr

Well-known member
Here we get to see aliasing actually happening, using the same "blackboard" approach as in the above two sections of this series.

Aperture-13.gif

Here, our sampling pitch is as before, and thus we have the same Nyquist frequency. But our subject waveform has a frequency of 1.2 times the Nyquist frequency—it is not a qualified passenger for this form of transport.

In panel b we see the set of sample values. In panel c, we see (as green dots) the "plotting" of those sample values in the workspace of the reconstruction engine.

As before, the reconstruction engine tries to draw a curve though those points, again subject to the constraint that the curve contain no frequencies at or above the Nyquist frequency.

It must work under that constraint in order to do its job as we saw earlier. If that constraint were removed or relaxed, the engine could not draw a unique curve through all the green points—there are an infinity of curves that would pass through those points.​
In panel d, we see that the reconstruction engine has in fact drawn a curve through the green points whose frequency is not at or above the Nyquist frequency (the only such curve that there is).

But it is not a duplicate of the original waveform. Notably, its frequency is 0.8 times the Nyquist frequency, whereas the original waveform had a frequency of 1.2 times the Nyquist frequency. (It also has a different time phase.) This is the manifestation of the phenomenon of aliasing.

The reproduced component has a frequency that is as far beneath the Nyquist frequency as the original component's frequency was above the Nyquist frequency.​
Of course, if this was a component of a more complicated audio waveform, the entire reconstructed waveform would not be the same as the original entire waveform, and would not sound like it (which we describe as aliasing distortion).

If this was a component of the variation in illuminance across an optical image, the reconstructed image would be different from the original image. Typically, the visual manifestation would be through the appearance of moiré patterns.

The term aliasing comes from this outlook: a component with a frequency of 1.2 fN travels as a suite of sample values that seem to describe a component with a frequency of 0.8 fN—it travels under a "false name".

Best regards,

Doug
 

Doug Kerr

Well-known member
Hi, Jerome,

Why would it be so?
As near as I know, we do not have an easy ability to construct filters of an arbitrary MTF. (If we did, we would probably have better antialising filters!)

An ideal aperture rolloff equalizer would have an MTF that was the inverse of a sinc function.

And there is the further complication of different functions needed in the x/y and diagonal directions.

But maybe we are better off in that regard than I think. (I really don't work in that field.)

Best regards,

Doug
 
Top