5 ms·
That's an amazing claim. Try drawing what would appear to be a perfect square wave in a digital wave. Up, flat, down, flat. Guess what: you've just introduce
by SeanLuke 6y ago
That's an amazing claim.
Try drawing what would appear to be a perfect square wave in a digital wave. Up, flat, down, flat. Guess what: you've just introduced enormous amounts of aliasing.
- exmadscientist 6y agoIt's not possible to get aliasing without a reference signal or reference frequency. A single purely digital signal, perhaps clocked or perhaps not, has nothing to alias against. So the claim has something to it! Once you introduce a master clock, especially one clocking an ADC, then aliasing can and does indeed show up.
- TheOtherHobbes 6y agoIn the digital domain Nyquist is a normalised ratio. It is not tied to a specific hardware clock rate. So it's perfectly possible - in fact dangerously easy - to generate waveforms with components that are >Nyquist. It doesn't matter if the hardware runs at gigahertz frequencies or subsonic frequencies. In fact it doesn't matter if there's never any hardware at all. Because there is always an implied sample rate of 1 x fs, and any signal which generates components of more than 0.5 x fs will alias.
- exmadscientist 6y agoI don't consider a "digital signal" to have any sort of implied clock or sample rate whatsoever. This appears to be a terminology mismatch between audio people and electrical engineers, if the rest of this thread is any guide. Here is my view of things: along the time axis, signals can be either continuous-time or discretized/discrete-time. Along the intensity axis, for example voltage, signals can be either continuously-variable or discretized/discrete-valued. I consider an "analog signal" to be one that's continuous in time and in value. I consider a "digital signal" to be one that's continuous in time but discrete in value; for instance, the output of a (asynchronous) logic gate. Your definition of "digital domain" seems to be discrete-time, discrete-valued signals; for example, the readings out of an ADC or commands into a DAC. The difference between the two would nicely explain a lot of the confusion here.
- ohazi 6y agoThat's not what aliasing means. "Lollypop" sampling vs. real DAC output: https://mk0soundguyshosprmrt.kinstacdn.com/wp-content/uploads/2019/07/Quantization-Stairs-vs-Stems.jpg https://mk0soundguyshosprmrt.kinstacdn.com/wp-content/upload... As you've observed, the output of a real digital circuit includes the flat parts, unlike the infinitely thin "lollypops" that you see in DSP textbooks. But the jaggies themselves are not aliasing, they're actually the result of anti-aliasing. The sample-and-hold reconstruction filter that practically every DAC uses is an anti-aliasing filter, albeit a crude one, but if you've chosen your sampling frequency correctly, the harmonics from the jaggies exist entirely outside of your passband. A simple RC filter removes them almost perfectly. This is aliasing: https://upload.wikimedia.org/wikipedia/commons/thumb/2/28/AliasingSines.svg/1920px-AliasingSines.svg.png https://upload.wikimedia.org/wikipedia/commons/thumb/2/28/Al... Digitally sampling an analog input signal is usually where you need to actually put some design effort into the AA filter, because you don't necessarily know whether the analog signal at your input has a lot of energy just outside your passband. Such an input can cause you to see an alias that's comparable to or louder than your signal of interest, and there's no way to get around that with direct sampling except for arbitrarily sharp AA filters. But with a DAC, you know exactly what you're putting into your AA filter (your sampled signal convolved with a box), and you can easily arrange things so that the AA filter both works perfectly (sampling > nyquist) and is easy to design (sampling >> nyquist).
- cageface 6y agoAn ideal square or saw wave contains infinitely high frequencies because of the discontinuities. When you represent an ideal square or saw wave as a series of digital values you are effectively sampling it at a much lower sampling rate than the infinite rate required for a perfectly sharp square wave. This introduces aliasing is why a naive implementation of a square or saw wave will sound terrible. There are a whole bunch of techniques you can use to solve this problem without excessive CPU usage but they are non-trivial.
- ohazi 6y agoA list of things that don't respond to infinitely high frequencies: Your ears Your speakers The op-amps in your fancypants analog synthesizers -- More critically, signals having high frequency components is. not. aliasing. Neither is distortion. Out-of-band signals being erroneously remapped into the passband via the sampling process is aliasing. That's why it's called an alias. The remapped out-of-band signal is indistinguishable from a different in-band signal.
- willis936 6y agoAliasing only appears when you try to make an analog signal. A digital signal is not beholden to channels. It is a pure mathematical entity.
- SeanLuke 6y agoAll right, mister fancypants. I decide to create a sawtooth signal by repeatedly drawing a diagonal line, then a vertical line in my digital PCM sample array. It looks like a sawtooth when I plot it, but the sound that comes out doesn't sound like a sawtooth: it has lots of reflected harmonics caused by those sharp corners. What is your term for the artifact that I had unintentionally introduced?
- willis936 6y agoAliasing. That isn’t a digital signal.
- SeanLuke 6y agoOf course it's a digital signal. It's a PCM array. If what you mean is "the artifact isn't 'aliasing' until it finally goes through the DAC", my answer to you is: that's a useless and counterproductive distinction. I inadvertently introduced an artifact into my digital signal that I cannot easily remove. That this artifact magically gains a label only once it passes through the DAC is pedantic nonsense that helps no one.
- willis936 6y agoThis is not some useless academic distinction. You are measuring an analog signal. You do not worry about aliasing in all digital systems, even if they are representing something you might typically make into an analog signal. Why would you want a digital square wave? Who knows. But aliasing is not in the digital signal.