Hi again,
Jim:
Yes it appears that PG was looking at the spectrum of the sampled signal but he didnt answer by question regarding that where i wanted to make sure that's what he was talking about.
Jim,PG,All:
The sampled signal if looked at as an output rather than just a sequence of counts looks like a staircase signal that follows the input signal. If the input was a ramp from 0 to 5v then the output would look like a staircase from 0 to 5v where each step would be the voltage measured at each sample period. So if we took samples every 1 seconds and the wave went from 0 to 5 in 5 seconds, we'd see an output sequence (converted back to voltage) of: {0,1,2,3,4,5}.
Now i think the question PG is thinking about is how do we deal with this signal. It's not 'really' a ramp anymore, it's a sequence. The sequence represents the ramp but it's not really a continuous ramp anymore, and this might be the input to the next 'stage' which could be a filter which might be a digital filter inside the microcontroller in code.
For this we would be using a digital filter but i dont see why we could not simply output that sequence right away and then deal with it, for the sake of simplicity. In the real world however we'd use a digital filter and the digital filter would be operating within a digital framework that understands that the signal is a sampled signal already and it's output would in turn be digital.
So for simplicity say we output the signal right away instead of using a digital filter. What we see on the output is a staircase. Within the digital world however it's not a staircase, it's just a set of singular points which means that the signal is not defined anywhere else but at those distinct points. So if we had that sequence and the sample time was 1 second, then the signal is only defined at 0 seconds, 1 seconds, 2 seconds, 3 seconds, 4 seconds, and 5 seconds. It is not defined at say 2.5 seconds, or 3.1 seconds, or 1.9 seconds, or 3.0035 seconds for some examples, because it is not defined between any two samples.
When we output this signal as an ANALOG signal however, then it becomes *easier* to view each sample as a continuous DC value that extends from the start of the sample time period to the end of the time period because that's the only information we have for that entire time period. If we wanted to convert the digital representation to analog in reality what we are doing is storing the digital signal and extending it out over the entire sample period.
Ok, so we see a staircase on the output. That's not the right signal that we need however for analog purposes for say an audio output. There are harmonics which might be heard by the listener so we'd have to filter them out. This is where knowing the spectrum of the signal *in analog terms* comes into play. It's not that hard to understand though, because if we have a certain sample period then the highest amplitude harmonic will be the one that matches the sample clock rate.
What we have is a series of rectangular waves, where only one point at each rectangular top matches the correct signal, and we know that rectangular wave harmonics decrease as the inverse of the harmonic number, so if we use a low pass filter that can effectively reduce the highest harmonic then we know the others will not only be cut more than the lowest, the others are already lower in amplitude to begin with so we end up reducing all the higher harmonics even more than the lowest one which we would call the fundamental.
So the short answer is that when we use a low pass filter on the pseudo sampled signal (the staircase isnt really a sampled signal it's a time extended version which we end up with because our sampling process is not a true sampling process as it does this automatically, and we dont change it because it actually makes it easier to work with anyway once we get back to the analog world) and that filters out the highest amplitude signal as well as the harmonics because the harmonics always get attenuated more plus they are lower to begin with.
This is easy to show with even a simple RC low pass filter.
Also note that the sampling frequency could be chosen so that it is much higher than the highest desirable frequency so with a low pass filter the highest desirable frequency does not get affected much by the filter, only the clock signal and its harmonics get attenuated significantly.