How digital sampling works? - Page 1
Forum section: electronics / beginners

author: Sevalecan
author_rank: Newbie
timestamp: March 02, 2016, 09:57:01 pm
content: So, if anyone remembers taking communications classes and discussing signals, maybe you'll understand where I'm getting confused. We're discussing sampling methods such as ideal sampling and natural sampling. To me, ideal sampling makes perfect sense as it represents what gets stored in a computer, a bunch of impulses with a single value for that particular instance in time. Natural sampling, on the other hand, is an analog signal multiplied by a pulse.With natural sampling, we've taken an analog signal and made it zero for certain periods of time. I fail to see how analyzing such a signal mathematically is useful, because it does not seem to correspond to what gets stored in a computer. I can generate a natural sampling output waveform by using a multiplier and a some form of square wave. Is this output waveform used in an ADC somehow? I guess I'm failing to understand the significance of some of these things we discuss entirely in theory because I fail to see where such a thing comes into play practically. This bothers me a lot, and it seems to be one of those questions where I end up confusing anyone who looks at it because they don't understand what I'm asking.We have a chopped up signal from natural sampling. We analyze it mathematically. Does it actually get used, say, in any implementation of an analog to digital converter(aka does it help me digitize a signal in real life, if so how)? If not, why do we even talk about it?

author: AndyC_772
author_rank: Super Contributor
timestamp: March 02, 2016, 10:28:37 pm
content: Quote from: Sevalecan on March 02, 2016, 09:57:01 pmNot zero, undefined.When you sample a waveform, you measure and record its value at regular intervals. You know what value the wave had at the instants it was sampled, but you have no information whatsoever about its value in between.There's certainly no application in which the value of a sampled signal is presumed to be zero in between samples, because it isn't - though if you draw a 'lamp post' diagram of a sampled waveform, it might look that way.Possibly the most important thing to really understand about a sampled signal, is how to reconstruct the wave shape given that its value is only known at the sample instants. Here's where you'll no doubt learn all about Nyquist, sample rates, the need for low pass filtering and so on.There's a good video here:

author: ade
author_rank: Unknown
timestamp: March 02, 2016, 10:37:35 pm
content: Ideal and natural sampling are conceptually the same.Ideal sampling requires infinitely thin pulses (zero-width samples), so it is not feasible in real life.Natural sampling is a practical approximation of Ideal sampling. Instead of using infinitely thin pulses, we use non-zero width samples. We basically segment ("chop up") the original signal into periodic equal-width samples.Flat-top sampling is another approximation, using square-wave pulses.

author: Sevalecan
author_rank: Newbie
timestamp: March 02, 2016, 11:16:05 pm
content: Quote from: AndyC_772 on March 02, 2016, 10:28:37 pmAh, that's starting to help clear some things up on the definition. So essentially, we don't care about the time in between?Quote from: AndyC_772 on March 02, 2016, 10:28:37 pmI actually watched most of this video earlier when a friend linked me to it for this same subject (and just finished watching the rest now). It also kind of demonstrates what my problem is. In the computer, we treat the data as discrete, 0-width sample points. Natural sampling is not that, but is instead a non-zero width continuous and possibly non-flat sample that I cannot store directly in a computer. One can reconstruct a signal with continuously time-varying properties(which he does in the video when it gets output, and the signal looks just like the original), but I cannot store it as such, can I?Essentially what I'm doing is looking at these methods and asking what is gained by looking at the signal as a naturally sampled signal, since it appears to be neither the starting point nor the ending point of a typical operation of taking a signal in, and then reconstructing it again at the output. Where in an application is this natural sample going to show up?

author: pmbrunelle
author_rank: Regular Contributor
timestamp: March 03, 2016, 12:49:00 am
content: Quote from: Sevalecan on March 02, 2016, 11:16:05 pmIf you wanted to know what happened between samples, you should have sampled at a higher frequency.However, if you know for a fact that the signal is band-limited, then you can (at least theoretically) infer what happened between samples. When we say band-limited, this means that the signal does not change too rapidly; the curve between the points is smooth and slowly-changing; it is not jagged. It is because the curve changes slowly that we can infer what is happening between points. A random spike between points is not possible according to the assumption we made that the signal was band-limited.When you sample for real, such as with a sample-and-hold capacitor, the value you record is equal to an average voltage (maybe more weight to the voltage at the end of the sample) over some short time span. Then, the voltage is measured in counts, and the number of counts is stored in an array, in sequence.So if you take the series of numbers in RAM and send them in order to a DAC, now you have a quasi-stairstep function. So this signal may be directly useable the way it is.If you can't tolerate a stair-steppy function, then you want to draw the lines through the points. This is the role of the analog reconstruction filter. Its output cannot change rapidly (because it's designed that way), so it works as the smoothly-moving pen drawing through the points.However, you can store a (mostly) reconstructed version of the signal in a computer. Previously, we said that the samples were stored in sequence in RAM. Now, imagine that you stored the samples at every 10th address in RAM. Now, you would have 9 empty spots between each valid sample.Again, with the assumption of a smooth function through the points, the computer can fill in the blanks! So you could store an almost-smooth representation! It could be as simple as linear interpolation to figure what's going on between the points. It always comes down to a weighted average of the neighboring points. Better approximations will use more neighboring points. The mother-of-all weighted averages is the sin cardinal function.The advantage of having the computer fill in the blanks between the samples is that the analog reconstruction filter need not be as good. It just needs to round off the edges some.When information-theory types talk about perfect reconstruction and such, just remember the following assumptions:Infinite bit depthZero sampling timeBrick wall anti-aliasing filtersSin cardinal reconstruction (brick-wall)

author: AndyC_772
author_rank: Super Contributor
timestamp: March 03, 2016, 07:25:01 am
content: Quote from: Sevalecan on March 02, 2016, 11:16:05 pmWe certainly do care, but since we only have samples at certain intervals, we have to reconstruct the behaviour of the signal in between sample points using the available information we have.The slightly counter-intuitive thing is that wedohave enough information to do this, even though our sample points each represent the value of the signal at a precisely defined, zero-width point in time.This is where the requirement (or assumption!) comes in, that the original signal is bandwidth limited, and that our sample rate is at least 2x the highest frequency that's present. Provided this condition is met, there is exactly one curve which can be drawn through all the sample points, which contains no frequencies above Fs/2. This curve is, theoretically, the exact original signal.You mention "natural sampling" as being the effect of multiplying the analogue signal by a train of pulses, and maybe that's where the confusion is creeping in. Are you sure it's not defined as multiplying the signal by a train ofimpulses? Mathematically, an "impulse" is a function defined as being equal to 0 at all times other than t=0, and with a value at t=0 such that the area under the graph is equal to 1. This is, of course, a limiting case of a function which is a very narrow and tall 'square' pulse.The impulse is a mathematical tool, you won't find it in any circuit, because it has effectively infinite amplitude.