Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can absolutely hear the difference between 44.1 and 96 kHz sample rate. Even with typical reproduction filters on the output, sampling at 44.1 kHz prevents you from accurately preserving e.g. a sine tone at above ~6 kHz, and that's even without taking into account all the aliasing problems you're facing when the samples don't align with with the peaks of this or that tone. 44.1 kHz is "good enough", but it's not accurate, and you can definitely tell the difference.

As for anything beyond 16 bits amplitude on line level, no, you cannot hear a difference. For such a low-voltage signal the resolution at 16 bits is so fine that it already drowns in all the natural noise and THD in the cables, in the amplifier, in your speakers/headphones etc.



Please do watch & internally digest the explanatory videos at https://xiph.org/video/

It explains why you’re wrong in easily digestible terms & how a 44kHz sample rate will accurately encode signals right up to the Nyquist limit. The second video is an end to end demo showing the process in action.


> https://xiph.org/video/

Thanks a lot for those videos, they were absolutely excellent. For anyone wondering they're presented by "Monty", the guy behind the ogg container and vorbis codec. I probably understood 10% of what he said but that's still a lot.


> sampling at 44.1 kHz prevents you from accurately preserving e.g. a sine tone at above ~6 kHz

This is mathematically false. A 6kHz or 8kHz or 10kHz or 20kHz signal absolutely can be perfectly preserved with a 44.1kHz sample rate. Not just kind of preserved, but perfectly preserved.


It's perfectly preserved only if your samples are perfect. Imagine instead that we used 4-bit samples. The results would be obviously garbage. 8-bit would be better. 16-bit is better still. But it isn't perfect.


Increasing the bitrate lowers the noise floor. But that 6 or 8kHz signal is still there.

8:43 in the second video, he goes in to showing what increasing the bit depth gets you.

https://xiph.org/video/vid2.shtml


I doesn't look like you understand what sampling is, and how reconstruction filters in DACs work. Your statement is true for some waveforms, depending on their frequency, due to the use of reconstruction filters on the output, but it's not true for any signal and the problem becomes more apparent the higher the frequency of the waveform.


Reconstruction filters in DACs are analog low-pass filters. They don't do a linear interpolation between samples.


You explicitly said a 6 kHz sine wave. Which is pretty much the textbook example of a waveform and frequency which would work perfectly.

Maybe you wanted to say square wave?


If I'm understanding you correctly, you're saying that while a perfect sinc interpolation reconstruction would allow you to capture up to 44.1/2 kHz, in practice since we're limited to FIR reconstruction filters we can't actually get that high? If so it seems like a fair point, although I'd imagine they'd be better than 6khz?

There's also the issue of the input signal not being band-limited which is necessarily true for real world signals given that you sample for a finite duration.


Input signals are ALWAYS band limited for digital systems. If you don't do this and you work for any company designing such circuitry, you'd be fired.


There's no such thing as a finite support band-limited signal.


You should watch this: https://youtu.be/cD7YFUYLpDc?si=rUm6IR3IKXyzcaDB to better understand why high sample rates are a waste of time, instead of just reading about nyquist. "accurately preserving a 6kHz sine wave" sounds a lot like you think that sample points are reproduced 1-1 from the digital to the analog domain.

This just builds on the xiph video someone else linked but essentially

- sine waves are fine as long as you have points for rising and falling edge (nyquist, 44k guarantees 22k sine wave reproduction)

- bit depth only really affects noise floor, so it depends on your audios dynamic range


A 44 kHz sample rate guarantees accurate 22 kHz triangle wave reproduction if a reconstruction filter with linear interpolation is used on the output, and accurate amplitude of same signal if samples happen to align somewhat with the peaks of the waveform.


Wrong. You need to read some more Shannon and Nyquist. https://en.m.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_samp...


That's exactly why linear interpolation is not used.

The Nyquist-Shannon sampling theorem says that you can perfectly reconstruct any sampled signal as long as the input signal was bandlimited to 1/2 the sampling rate. Using a low-pass filter to bandlimit your 22 kHz triangle wave will remove all the (inaudible) overtones, leaving you with a single 22 kHz sine wave as input to your ADC. The reconstruction filter on the output DAC will then output a perfect 22 kHz sine wave, with the correct amplitude too!


Yep, as Monty showed in the 2nd xiph video a square wave will have issues with a low nquist frequency (at for eg 44khz sampling).


There are no "issues" with the square wave at 44kHz. Yes, a square wave sampled at 44kHz and converted back to analog does have visible ringing on an oscilloscope, but that's because you're looking at a perfect reconstruction of a band-limited square wave. Before sampling, the square wave is filtered to remove all of the overtones above 22kHz, which are not audible (as that's above the upper limit of human hearing) and would cause aliasing issues in the sampled signal.

In other words, the ringing is an artifact of low-pass-filtering on the square wave, not the sampling process itself. A purely analog system with a 22kHz low-pass filter would have the same "ringing", and your ears couldn't tell either way because they can't detect information above 15-20 kHz. It's not even possible to have a "perfect" square wave in the real world because that would require the speaker cone, air molecules, and your eardrum to teleport instantly from one spot to another -- so you will always have some low-pass filtering, and therefore ringing, on any real-world approximation of a square wave.


Thank you for your detailed comment. Disclaimer, I don't think I fully understand this topic or your comment in entirety.

When you say

> Before sampling, the square wave is filtered to remove all of the overtones above 22kHz, which are not audible (as that's above the upper limit of human hearing) and would cause aliasing issues in the sampled signal.

Do you mean that the human ear "hears" (for lack of a better word) in sine waves because of fourier transforms? So, a pure squarewave signal (cut off above 20khz due to human ear limits) sounds identical to an "imperfect"/wavey sq.wave made from harmonics lacking higher frequency parts?


A perfect square wave has infinite bandwidth. The phase change from high to low theoretically happens instantaneously. Practically nothing moves that fast in the real world. Voltages take time to go up and down because of inductance and what not in the circuit, the cone of the speaker needs to start accelerating to move, etc. A speaker cone doesn't move instantaneously from its high point in the wave to the low point in the wave, it takes time for it to move and actually push the air around. Plus, the air itself is kind of springy, so even if the speaker did move instantaneously (which it can't, it would have to move at infinite acceleration) the resulting pressure wave wouldn't be nearly as sharp of a transition.

Your ears don't experience pure square waves. They can't. They'll get the approximation of a square wave as close as they can experience them, but your ear drum doesn't immediately warp from one point to another. It gradually moves. The fluid in your ear has its own springiness. The hairs which do the final detection don't just instantly move either, they're being vibrated by the motion of the fluid in your ear.

And yeah, technically your eardrums can be moved by waves higher than 20kHz. But its not just the motion of your ear drums that give you hearing, its lots of tiny hairs in your inner ear that resonate at different frequencies that gives you the detection of certain audio frequencies that are present. Normal humans (read: practically everyone) tend to only have the equipment to accurately sense up to ~20kHz pressure waves with our ears as sound. As you age the areas which detect higher frequency sounds get less sensitive first, so you start losing the ability to hear those higher frequency sounds first.

It does seem like you're missing a bit of knowledge about signal theory though. That would really help you understand what I mean when I say a real square wave has infinite bandwidth. A very rough and basic idea to help here is that a wave can be thought of as a sum of fundamental sine waves. So a square wave is essentially the sum of all the component fundamentals, each fundamental gets sharper and sharper edges of the square. But the only way for the sine wave to have a truly vertical edge is to be infinite frequency, right? And what are the edges of a square wave? Vertical lines. So to keep adding these fundamentals together to achieve a square output, you'd need to add an infinite sum of sines together to make an actually perfect square. Monty touches on this in that video a bit, but it goes pretty quick.


Thanks again for your detailed comment. I think I understand it now. The only thing slightly puzzling me is why waves are broken up (be it Fourier or in our ears) into sine waves, and not say sawtooth (or some other, like a semicircle as in https://math.stackexchange.com/questions/1019005/what-kind-o...) waveform.

I understand how a squarewave needs infinite bandwidth for decomposing into sine waves, but a wave like the semicircle one has a vertical tangent and would not need an infinite bandwidth. Btw you're right, I've never had any signal theory classes (studied mech engg).


I'm mostly just an amateur myself, so I totally get where you're coming from.

FWIW, the graph at the top of that article (as mentioned in the comments) does not have vertical tangents. They're not true semicircles. Most of the answers given to make actual semicircles become non-continuous signals (y >= 0 if ... answer) or infinite sum. The one which doesn't just says they look like semicircles. I don't really have the time (or immediate knowledge, I'm admittedly bad at math) to dig all the math but my gut instinct suggests those aren't true semicircles and don't truly have vertical tangents.

And this is kind of how a signal generator can get away making square waves and sawtooths and what not; internally its not always truly "discrete" signals its just quickly flipping a switch from one thing to another. It flips from the high state to the low state fast enough that for your 50MHz oscope it looks pretty continuous, and its probably designed to try and draw a connected line.

This all kind of makes some sense when you get into how we actually make electrical signals. We're normally just modulating the electric "vibrations" of some crystal or accelerating some magnet through a loop back and fourth. These things move in continuous waves. As mentioned, things don't have infinite acceleration they take time to shift between states. So you're never going to get something that goes from high to low in zero time. And most home owners will tell you there's no such thing as a right angle.

I'd like to mention though, you're imaging the wave as being "broken up" into sine waves, which IMO isn't quite the right way to be looking at it. Its not "breaking up" the signal into sine waves, the signals were always sine waves. Remember my comment, truly square waves don't really exist. We can have things that kinda look square-ish when you squint your eyes, but they're not really square waves. A truly square wave in reality requires infinite acceleration or its not continuous. Fill a bathtub and try to make square waves. Its just not going to happen.

I know I'm not fully answering your question, I don't fully know the answer myself. So far in my stumbling around the closest thing I can answer is because that's just how nature and waves are, at least as much as our monkey brains can reason about them. Think about a string in a guitar or a wave in the water or throwing a ball. They all moves in ways which can be described by sine waves. Its just like the nature of how things accelerate and move, changing between states. Why do we see the golden ratio in so many places? Why are circles so special? Good luck on digging for more truth.


sorry, I misused "discrete" in this comment, should say "continuous".


It's been a long time since my DSP classes at uni, but I don't think this is true. 44.1kHz sampling is enough to reproduce up to 22.05kHz sound accurately without aliasing. Unless there is another type of distortion you might be picking up. This stuff is pretty far out of my realm these days.

https://en.wikipedia.org/wiki/Nyquist_frequency


It's true for a triangle wave and a square wave, depending on if the output has a reconstruction filter doing linear interpolations between samples. You cannot accurately sample a 22.05 kHz sine wave (or any other "complex" waveform) with a 44.1 kHz sample rate.


You're incorrect. A 44.1kHz sample rate can recreate a 22.05kHz sine wave. Your mental model for a digital signal isn't correct. It's not making stair steps nor is it making triangular waves.

https://youtu.be/cD7YFUYLpDc?si=rUm6IR3IKXyzcaDB


Yeah this is the "stairstep vs. lollipop" thing again.


Everyone complaining with "but stairstepping" fails to recognize that the final stage of a DAC is a reconstruction filter. The steps are gone after that filter is applied. You aren't analyzing the full DAC performance if you look in front of the filter. This is most dramatic in class-D amplifiers where the raw waveform feeding into the speakers is square wave hash that gets filtered out by the speakers themselves.


The filters do linear interpolation between samples. This bridges some shortcomings of a sample rate too low to capture complex waveform at high frequency, but it's not a silver bullet.


They don't. Analog low-pass filters don't do linear interpolation between samples.


Yes and no. Reconstruction filters are part of the problem (and part of the solution) but it's not all about them.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: