Hacker News new | ask | show | jobs
by mlyle 582 days ago
Anything close to N/2 is going to have varying magnitude that requires filtering and likely oversampling to remove.

How close to the Nyquist bandwidth you can get depends upon the quality of your filtering.

44.1KHz is a reasonable compromise for a 20KHz passband. 48KHz is arguably better now that bits are cheap-- get a sliver more than 20KHz and be less demanding on your filter. Garbage has to be way up above 28KHz before it starts to fold over into the audible region, too.

1 comments

> Garbage has to be way up above 28KHz before it starts to fold over into the audible region, too.

You brick-wall everything at 20 kHz (with an analogue filter) before you sample it; that's part of the CD standard, and generally also what all other digital CD-quality audio assumes. This ensures there simply is no 28 kHz garbage to fold. The stuff between 20 and 28 in your reconstructed signal then is a known-silent guard band, where your filter is free to do whatever it wants—which in turn means that you can design it only for maximum flatness (and ideally, zero phase) below 20 kHz and maximum dampening above 28 kHz (where you will be seeing the start of your signal's mirror image after digital-to-audio conversion), not worrying about the 20–28 kHz region.

Your comment is mutually contradictory-- what is it, a brick wall (impossible) analog filter or a more gentle rolloff as things fold over?

What you really do, these days, is you sample at a higher frequency; you can have an exceptionally gentle analog filter (which will help you make it linear, too). E.g. if you sample at 96KHz, you just need to roll to near zero by 75KHz. Then you can digitally downsample/decimate to 44.1KHz or 48KHz.

Also note for CD audio, it's more like 24KHz where you get worried, not 28KHz.

You're mixing up the two filters. The pre-sample filter (before ADC) is defined to be a brickwall (of course impossible in practice, so in reality, it will have to start going off a bit before 20 kHz); the reconstruction filter (after DAC) has a roll-off.
I've not been talking about the reconstruction filter at all during any step of this discussion. Reading your comment more carefully, it seems you were trying to.

I'm saying that if you oversample, it's easier to get appropriate rejection from your pre-sampling filter and it's easier to make it appropriately flat as well.

E.g. sample at 384KHz; you need to reject stuff over 360KHz. You probably have negligible energy up there to begin with. A 3rd-order filter with -3dB at 30KHz might get the job done. It's pretty easy to make this flat in phase and amplitude up to 20KHz, and things like capacitor nonlinearity are much less of a concern.

In turn, filtering down to 20KHz and rejecting from 22050 and up is easy in the digital domain. 512 taps gets me a filter flat to 0.15dB up to 20KHz and >63dB rejection over 22KHz.

My point was, this is a little better at 48KHz, because we can choose to e.g. pass 21KHz and have a wider guard band (14% vs 10%). With 384 taps, numbers are more like flat to 0.1dB and -67dB, benefitting both from the wider guard band and 48KHz being a factor of 384KHz.

Sure, you can implement the pre-sampling filter as a multistage filter, of which some of the stages are digital, if you wish. (I don't know where you get “rejecting from 22050 and up” from, though. For the pre-sample filter, you should reject from 20000 and up, and for the reconstruction filter, you should either reject from 24100 and up or 28000 and up, depending on whether you ended up sampling in 44.1 or 48.) But I don't think your argument makes much sense; if you're already in a domain where you have enough resources to sample at 384 kHz and run a 384-tap FIR filter over it, then surely you're high-end enough that you can't say “nah, who cares about the most common sample rate out there”.
When sampling:

You should pass all below 20KHz, as flat as possible. You definitely should stop 24.1KHz and up. How bad 22.05KHz to 24.1KHz is, is debatable.

> then surely you're high-end enough that you can't say “nah, who cares about the most common sample rate out there”.

I didn't say "don't support 44.1KHz" -- I'm saying there's good reasons to prefer 48KHz.

All being equal (same number of filter taps, etc)-- just a slightly higher sample rate offers a lot more performance because you can get a bit more frequency response and a lot flatter passband.