Joe Crawford wrote on Mon, 13 June 2005 16:16 |
Dan – Your explanation of sampling theory and Nyquist makes total sense as long as you consider the samples as “dots” (I think the normal term is “point”, which is defined as infinitely small). But, as Nick Dellos’s diagram shows, when you include the inaccuracies of both sample rate and bit depth, those sample “dots” become rectangles of noticeable size....
Joe Crawford Stony Mountain Studio Shanks, WV 26761
|
I am not sure what Nick did. Practical implementation does matter so bits are important and so is jitter, but a proper simulation will not show you a visual wave difference between the original and the sampled wave. In fact the outcome at only 12 bits is 4096 points on a screen (or on a printer page) and a nanosecond of jitter have little visuall consequences. The visual presentation is much more forgiving than the audio which demands much better accuracy. The eye is “a 1% instrument”, the ear is “a 0.001%” instrument.
But here are a few comments to keep in mind:
A. When doing a computer simulations, you can not really reconstruct an analog wave form (like a DA). A computer is always a digital machine. You can APPROXIMATE an analog outcome by having a simulation happen at very high over sampling rate. I have done many such simulations, and it is “good enough” for papers and presentations, but I always make sure to state clearly that the computer is providing an approximation.
B. One should not do a single cycle simulation. You can choose to show a single cycle, one out of many simulated cycles, but the simulation should extend to include having many cycles both before and after what you observe. A single cycle is really a “gated function”. A single sine wave cycle contains energy at frequencies extending all the way to infinity, therefore a single cycle violates Nyquist and will bring about alias distortions. One CAN simulate a single cycle AFTER making sure that all the high frequency (above Nyquist) is removed. I often "pre run" my signals through an anti alias filter simulation.
C. As I pointed out in my papers “Sampling Theory” and “Sampling, Oversampling, Imaging and aliasing”, the reconstruction of a DA signal without some over sampling will suffer from some sinc curve ( sine(X)/X ) attenuation – the high frequencies drop off in amplitude. The difference between viewing sampling as "DOTS" and "RECTANGLES" is referred to as RZ and NRZ sampling. RZ describes the dot case - you take a sample value at a dot and Return to Zero (thus RZ). Th NRZ case means you take a sample and hold it's value - Not Return to Zero (NRZ) until the next sample changes the value. Practical signals are NRZ, and therefore they suffer from the sinc problem (high frequency loss. Therefore up-sampling (or other form of compensation) is required, or one has to be able to tell that there is a sinc attenuation.
One way to check frequency response is to use FFT plots. But again, doing just an FFT of say one and a half cycle (or so) test tone is not going to work, because of high frequency content due to the gating. That IS why people use windows on the signal pripr to the FFT processes. The window serves to overcome the high frequency content due to a “sudden” start or stop, such as in the case of a single cycle simulation. That unwanted high frequency at the "sudden" start and stop of the signal is called "leakage". The FFT window filters that leakage.
So, if can make sure to account for the facts that:
A. A computer is a digital sampler machine, and a computer simulation of a DA calls for some up-sampling.
B. Make sure to have the computer pre-filter (anti aliasing filter) your signal, or find a way to make sure there is no energy above Nyquist in the AD part of the simulation
C. Up-sample your data prior to the simulation back to DA signal
Doing the above listed, the signal going in and the signal coming out will yield the same plot. I have done it many times, including the plots in my paper “Sampling Theory”.
Regards
Dan Lavry
www.lavryengineering.com