4 ms·
I've always wondered after reading this: "Sampled signals are often depicted as a rough stairstep (red) that seems a poor approximation of the original signal.
by Veratyr 10y ago
I've always wondered after reading this:
"Sampled signals are often depicted as a rough stairstep (red) that seems a poor approximation of the original signal. However, the representation is mathematically exact and the signal recovers the exact smooth shape of the original (blue) when converted back to analog."
The image attached to this looks basically like a sine wave and it's clear that if you do some basic interpolation on the sampled signal you'll get something that looks the same as the original.
But what happens when the signal you're sampling isn't as simple? What happens when you've got numerous tones overlapping each other out of phase, making the wave uneven and jagged? Will the signal still be accurately reproduced? Can humans distinguish the difference?
- xorcist 10y agoIt will, and this is indeed what Nyquist tells us. Think about the engineering challenges involved in producing an exact staircase output! A stepped signal isn't nearly as beautiful. Most DACs today are also of the delta-sigma variety which produce something much more sinister. But that's all fine, as long as we describe the output signal. There can be overtones high up in the ultrasound for example. The output filters are then what produces the nice signal you listen to. Bad output filters can produce artifacts that sometimes hearable, especially in DACs from the 80s, but if you to stick to the suggested implementation of commercially available DACs today then you should be fine. Quantization errors is more problematic since they can appear anywhere in the post production chain. When you're in the digital domain you can get all sorts of aliasing artifacts just as you get for images. I think this is a common source of when people can hear differences between 44 and 96 kHz signals, where they just downsampled with a linear filter and they hear artifacts of this resampling. A little quantization noise will take care of that, and competent software such as sox and audacity will do this for you.
- dTal 10y agoYes, the original signal will be accurately reproduced, provided it did not contain any frequencies at or above 1/2 the sampling rate (Nyquist). If you're looking for some intuition, the restriction on input frequencies guarantees that the signal doesn't "change too fast" between samples. You don't lose any information simply because you make sure there's nothing in the signal you can't capture. All this assumes infinite measuring precision, which is of course incorrect - in reality, the limited number of discrete levels a signal can take in a digital system introduces noise, or more accurately distortion since the noise is correlated with the signal. We fix this with dither, and it's absolutely essential for a digital audio system - by adding a small amount of random noise, you decorrelate the noise from the signal (you can do even better with "noise shaping"). Here's an illustration from wiki showing how nasty quantization error is [1]. To understand dither, it's interesting to think of the limit case of infinite sampling rate but only two levels, low and high. You could actually still reproduce sound perfectly with this setup, albeit still with a frequency limit. What you do is add "high frequency" (higher than the signal) random noise before you measure "low" or "high". This makes the probability of measuring "low" or "high" depend on the exact signal level, rather than whether it's above or below 50%. With enough samples you get a "pulse density modulated" signal, which lingers on low for low values and vice versa [2]. This is equivalent to a continuous signal summed with some nasty, but high-frequency noise. Filter the high-frequency noise you added back out and voila (your ear will do the filtering in a pinch, which is how you can get analog sound out of digital stuff, like hard drives and GPIO pins). Basically: finite sampling rate, infinite precision - fine, we can squeeze the information into the precision. Infinite sampling rate, finite precision - still fine, we can squeeze the information into the time domain. Finite sampling rate and finite precision, i.e. the real world - there will be some error. [1] https://upload.wikimedia.org/wikipedia/commons/2/22/Quanterr.png https://upload.wikimedia.org/wikipedia/commons/2/22/Quanterr... [2] https://upload.wikimedia.org/wikipedia/commons/e/e7/Pulse_density_modulation.svg https://upload.wikimedia.org/wikipedia/commons/e/e7/Pulse_de...