3 ms·
So, presuming we take this example: http://people.xiph.org/~xiphmont/demo/jaggy2.png http://people.xiph.org/~xiphmont/demo/jaggy2.png The key to reproducing t
by sliverstorm 15y ago
So, presuming we take this example:
http://people.xiph.org/~xiphmont/demo/jaggy2.png http://people.xiph.org/~xiphmont/demo/jaggy2.png
The key to reproducing the original signal from the digital signal is a low-pass filter that rejects everything above the sampling rate, correct?
That is to say, what I am getting at is while the original signal can be reproduced, it requires properly tuned, and probably reasonably high performance, hardware to remove the higher frequency components of that square wave. Can you count on consumer grade hardware to do this well?
- mindslight 15y agoYour question is somewhat amusing. A standard CD player uses 1-bit DAC (it's either on or off) at a yet-higher frequency to achieve better linearity. Filtering is quite easy in the analog world.
- nullc 15y agoYes, thats basically it. They do this _exceptionally_ well in fact. Typically the technique used inside DAC is to digitally upsample the signal (by duplicating samples, often to a few MHz— also allowing them to use a low bit-depth DAC) then it applies a very sharp "perfect" digital filter to cut it right to the proper passband (half the sampling rate). The analog output then contains only a tiny amount of ultrasonic aliasing which is so far out that it's easily rolled off by simple induction in the output. This isn't just theory. Here is a wav file I made at a 1kHz sampling rate, where every other sample is -.25/.25: http://people.xiph.org/~greg/1khz-sampled.wav http://people.xiph.org/~greg/1khz-sampled.wav (so a 500Hz tone, the highest you can represent with 1kHz sampling). Feeding that file to a boring resampler (I used SSRC, but anything should give roughly the same result— a least when not quite so ridiculously close to nyquist, most will attenuate near-nyquist data extensively) and get this: http://people.xiph.org/~greg/1khz-sampled-to-48khz.wav http://people.xiph.org/~greg/1khz-sampled-to-48khz.wav Here are the two signals plotted against each other: http://people.xiph.org/~greg/1khz-to-48khz.png http://people.xiph.org/~greg/1khz-to-48khz.png As you can see— the 500Hz sinewave is reconstructed perfectly. (Of course, a 500Hz square wave would not be (you'd get a sinewave out) but this is because a 500Hz square wave contains energy far beyond the nyquist of 1kHz sampling). Here is a spectrograph of the same signal http://people.xiph.org/~greg/1khz-to-48khz-spec.png http://people.xiph.org/~greg/1khz-to-48khz-spec.png showing that the tone is indeed pure (the faint background noise is the dither the resampler applies when requantizing its high precision intermediate format back to 16 bits).