Hacker News new | past | comments | ask | show | jobs | submit login

As someone who has spent a fair deal of time in the audio world both professionally and independently I'm pretty confused by this post.

The primary reason to oversample in the audio world is two fold:

1) To avoid aliasing, which is a somewhat different issue from graphical aliasing. ADC conversion creates aliases of the primary signal lower in the frequency band. For example if we sample at 40khz we can resolve signals up to 20khz. If the input contains content higher than this frequency it will alias into the pass band.

For example a 24khz tone on the input would appear as a 16 khz tone, a 28khz tone would appear as a 12khz tone, all higher frequency content will mirror around the Nyquist-Shannon point. Now if it were possible to build a "brick wall" filter, that is. completely block anything above the Nyquist-Shannon point and completely pass everything under this point, there would be no issue. But, in practice, this type of filtering isn't possible. As a result if your sampling at 48khz and you want to accurately convert all content up to 20khz you have to play a balancing act. You either provided flat response to 20khz and accept that some aliasing will make it through, or deal with some reduced level(roll off) at the higher end of your desired spectrum and block all audible aliasing.

This is really the primary reason for oversampling for high fidelity content as we can push the anti-aliasing filter well above the audible spectrum, allowing us to get both flat response to 20khz and block all audible aliasing. It should also be said that this issue is becoming less and less and issue as ADC/DACs are now implementing digital filters which can get far closer to the ideal 'brick wall' than is reasonable with analog filtering.

2) At a deeper level, oversampling increases resolution. Note that resolution here means actual resolution, that is bit depth, which is in opposition to the use of the term in the parent post. An example would be modern Sigma-Delta ADC/DACs.

Its common to use a low resolution part, maybe only 1-4 bits and oversample at a higher rate. For example, if your target output is 48khz @ 24 bits, you can use a 20 bit ADC and sample at ~12.28Mhz and downsample (internally within the ADC/DAC, really just averaging) to get your desired output. In practice a part may only operate on 1-4 bits but sample, much, much faster to get the desired resolution.

As for upsampling for the purpose of signal processing, there are a limited number of algorithms where this is useful and upsampling in and of itself introduces issues that have to be dealt with. The reason for upsampling tends to have more to do with processing accuracy limitations created by computation than anything else. For example bi-quad filter coefficients at very low frequency, say 5-8hz can exhaust the available resolution of a 32bit float at 48khz where as it may be completely fine at 192khz. This can be an issue with a sub-sonic filter in a subwoofer for instance.




You're right; I was being imprecise (or sloppy, perhaps). Graphical aliasing isn't the same as signal aliasing, though it's easy to equate the two conceptually.

I understand the value of using 96KHz instead of 48KHz so you can have a gentler filter, at least in the days before digital filters (as you say), but don't you agree that there's no further advantage to 192KHz in that respect? Maybe I'm justifying 192KHz by saying that it's for cleaner processing, when the real reason is It's A Bigger Number.

I've never heard anyone use "resolution" to mean bit depth; in fact, I've always heard it used to specifically mean sample rate - e.g. 96KHz resolution, 24 bits. But I've never studied DSP programming - I have a plumber's understanding, not a fluid mechanics engineer's.


How is graphical aliasing not signal aliasing? I've always thought it was, but then all my signal processing knowledge comes from image processing and not EE courses.


It is. The difference is that in audio it's generally associated with periodic waveforms, whereas onscreen it is more often problematic with isolated peaks. Where you have periodic, aliased structures onscreen, it's often called a Moiré pattern, but it's all the same effect.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: