News for hackers. Stuff that matters.
Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by taeric on Tuesday December 09, 2014 @09:54PM (#8727434)
More people really need to watch this video. http://xiph.org/video/vid2.shtml
Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by robert_tweed on Wednesday December 10, 2014 @03:53AM (#8728291)
This is such an awesome video. I really hope there's a follow-up at some point, because as someone with a decent amount of experience with computer graphics, but only a fairly general understanding of sampling theorem, the stuff that would naturally come next is what most interests me, namely:

- What happens when you start combining waves together to create more complex signals? This is pretty important, since any real instrument produces hundreds of harmonics with complex attack and decay properties, so decomposition of the fundamental frequencies won't be as accurate as with toy examples.

- Following on from that: the effects of aliasing. It definitely exists and I have a very good understanding of aliasing with respect to computer graphics, but what effect does aliasing really have on an audio signal? In CG it's something that's talked about all the time and there are tons of papers about it, but it seems (from the outside at least) that audio guys only ever talk about aliasing in very hand-wavy terms.

- Although we can't hear sounds (much) above 20KHz, we can detect artefacts such as "beats" produced when harmonics are slightly mismatched. Is is possible to show that such information either isn't lost, or that what is lost is either below the noise floor or outside the audible frequency range? This particular one is a fairly common complaint made by audiophiles about 44KHz/Nyquist, so it would be nice to see it addressed head-on.

FWIW, I'm a bit of an audiophile myself, but not one of those people who thinks they can hear a difference between 192kbps MP3 and uncompressed, let alone 16/44 vs 24/192. Generally the noise floor in the original recording is too high to tell the difference, even if you could hear a difference in artificially constructed pathological cases. But I am interested in really understanding what information is lost, what isn't, and why that may or may not make any difference. In other words, what are those pathological cases? This video is a really good start and clears up a lot, but in some ways it only scratches the surface.

Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by jeffwass on Wednesday December 10, 2014 @08:18AM (#8728975)
Not entirely related to your question on audio aliasing, but many moons ago I was an EE on a team using electro-optics to design a much better Analog-to Digital converter than you could buy commercially. The signals we sampled were in hundreds of MHz but the concepts are exactly the same as in audio frequencies.

What we effectively did was use a pulsed fiber laser, which produces _very_ short pulse widths of light. Connecting this to an electro-optical modulator, we can effectively capture a very fast snapshot of the electrical signal. Use some analog circuitry to hold that level constant for the slower analog-to-digital conversion, and we had an AD converter that while sampling relatively slowly, see's only a tiny portion of the signal for it's actually sample.

What was amazing about this was that the laser pulses were so short, and the 'timing jitter' of the pulses so low that we could cleanly see the expected aliased sampling frequency when saming a sine wave signal at large multiples of our sample frequency (iirc up to the 40's). Eg, inputting a sine wave around 10 GHZ and we'd see only a single sine wave in the sampled signal at it's row sampled frequency with minimal artifacts.

So if you are wondering how aliasing affects audio samping, draw a sine wave and see what happens if you sample it at a much lower frequency. You'll get a lower frequency sine wave. Without filtering the input signal, it's impossible to tell if this is a real low-frequency sine wave or something above Nyquist that has been down sampled.

N.B. If you're wondering why our AD converter was better than a commercial one, we also added optical demultiexing to get an extra order of magnitude improvement in sample rate. This is possible using our electro optical setup due to the laser's low jitter and the ability to hold the signal steady, a purely electronic version will have difficulty with the timing to see much actual improvement in SNR.

Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by fnordfnordfnord on Wednesday December 10, 2014 @07:36AM (#8728839)
There is an Episode 1. http://xiph.org/video/

See also http://xiph.org/~xiphmont/demo/neil-young.html which was posted here a week ago and received 441 comments. https://news.ycombinator.com/item?id=8689231

Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by rspeer on Wednesday December 10, 2014 @04:11AM (#8728356)
I can point you to a follow-up on one of those: An example on Wikipedia [1] lets you hear the effect of aliasing on a sawtooth wave.

When audio is aliased, the high harmonics will wrap around the Nyquist frequency and come back as audible, inharmonic tones. Aliased audio really sounds quite bad, in a way that would make any listener say "oh god make that horrible noise stop".

This is probably why it's easier to recognize the effects of aliasing in video than in audio -- you're not hearing much aliased audio. Aliased video is fairly common and seen as acceptable in some contexts, while anyone who produces aliased audio is going to fix their mistake before inflicting it on listeners.

[1] https://en.wikipedia.org/wiki/Aliasing#Online_audio_example

Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by robert_tweed on Wednesday December 10, 2014 @06:22AM (#8728666)
Presumably though the effects of aliasing will also also produce distortions at a smaller scale, which might not be as obvious. That would result in a loss of information, but would not be quite so easy to spot and filter out. The pathological case is really just a good illustration of what happens and why, whereas what's trickier is understanding the true impact it has on real-world data.

For instance, you won't notice Moiré patterns in photos very often, but it's easy to construct a test image that demonstrates the problem. The underlying issue of sampling error hasn't gone away in the photo: it just gets lost in the background noise or among smooth-shaded surfaces without hard edges, which makes it harder to see. But maybe now and then you'll have a sharp edge in a real-world image where the effect is noticeable. Depending on how close it is to the pathological case, it might not jump out and make itself immediately obvious.

I mention Moiré patterns because these are (I believe) precisely the same effect as the given audio aliasing example. Moiré patterns aren't a form of sampling error per se, but they can be caused by uniform sampling (which is how digital quantisation typically works for both audio and images).

Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by aidenn0 on Wednesday December 10, 2014 @12:43PM (#8730481)
Moiré patterns are the same thing, but if you put your video signal through an analog low-pass filter before sampling, then you wouldn't get Moiré patterns. Audio is typically low-passed before sampling for this reason.
Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by gaze on Wednesday December 10, 2014 @05:40PM (#8732176)
"Presumably though the effects of aliasing will also also produce distortions at a smaller scale, which might not be as obvious"

Why? What do you mean? What scale? What do you mean by distortion? The only only only thing sampling does is move frequencies beyond the nyquest frequency into the sampled signal by taking the signal at f, and sending it to f mod f_n where f_n is the nyquist frequency.

Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by keenerd on Wednesday December 10, 2014 @08:22AM (#8728987)
Aliasing on a triangle wave can sound quite beautiful:

http://kmkeen.com/awk-music/

Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by dmicah on Wednesday December 10, 2014 @10:14AM (#8729536)
With respect to aliasing, an analog to digital converter contains an analog low-pass filter which reduces the amplitude of the signal content above the Nyquist frequency prior to digitization. This effectively eliminates alsiasing in the digitized signal.

In terms of more complex signals, or frequency "beats", the same principles apply. If two high frequency (above-20kHz) signals interact in such a way to create an audible (below-20kHz) beating, the beating will be accurately recorded by the ADC.

Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by ArkyBeagle on Saturday December 13, 2014 @05:18PM (#8746670)
Bit depth and sample rate are completely separable. If you are recording something important, it may well be worth the higher SR just in case some technology comes along that can exploit it. But the 20-20kHz bandlimit is a pretty well-entrenched thing. People are working in it. It's tough sledding.

So the rule of thumb is that each bit gives -6dB more noise floor. This gives us a rough digital noise floor of -96dB for 16 bit or -144dB for 24 bit. But you can add dither to randomize the digital noise, and turn it into "white noise" or the like.

Aliasing is taken care of by the "reconstruction filter" ( named for the "reconstruction" part of the Shannon-Nyquist theorem). This has been a solved problem for some time now. There's a super-high speed digital filter in the DAC phase that can be measured to eliminate all aliasing products. Implementation quality varies, but even cheap stuff now does a good job of it.

Yes; it's unusual to have a room for recording that gets to -70dB much less -96dB. -40 to -50 is much more typical for, say acoustic guitar. Noise doesn't add like you'd think; the dominant noise wins, basically.

Combined waveforms make for another waveform. They add brilliantly and this isn't lossy at all. There are pathological cases, but they're not likely found in nature.

Transducers - headphones, speakers, microphones - all impart much more error than the electronics in the middle.

Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by gaze on Wednesday December 10, 2014 @05:27PM (#8732115)
> What happens when you start combining waves together to create more complex signals

Aliasing is a linear effect. If L is an operator that aliases at some frequency, L(Aa(t) + Bb(t))=AL(a(t))+BL(b(t)). Aliasing is in fact multiplicative! Any time you wish to understand aliasing, you really want write the signal multiplied by a dirac comb (a train of equally spaced infinitely narrow pulses). If you wish to understand nonfinite sampling widths, it's effectively convolution with the shape of sampling pulse... which looks like low-pass filtering. Ya dig? This is the frequency on your scope that's stupidly above the sampling rate. Why's my scope have a bazillion ghz bandwidth when it only samples at 4 samples oer week? It's because it's real good at getting you that signal, aliased down into the sampled signal.

> what effect does aliasing really have on an audio signal

PRECISELY the same effect it does on video, except in one dimension, and you haven't understood aliasing until you've understood it in one dimension.

> Is is possible to show that such information either isn't lost

It's lost. Completely... if done properly. First you need to understand Whittaker-shannon interpolation. The result of which is that a CONTINUOUS BAND LIMITED signal is PERFECTLY represented by a train of discrete samples. This is WEIRD. Really weird. Prove it to yourself. It's VERY important in sampling. Say you then perfectly sample a signal with harmonic content ALL over the place. EVERYTHING gets mirrored down into your view, if the dirac comb has infinitely narrow pulses. So at the least you lose frequency information! You only know the original frequencies modulo the nyquist frequency! If you sample CORRECTLY, you band pass filter your incoming signal so there's NOTHING above the nyquist frequency, then you have a perfect digital representation of your original signal.

If you wanna understand signal processing, you really can't use your intuition. Practice understanding things in the frequency domain and time domain, and generally there's only one proper basis to understand a phenomenon. Filtering is best understood in the frequency domain, for instance. If you try to understand filtering in the time domain, you might begin to think that it bounds the speed at which the signal can vary but that's not a useful intuition. Aliasing is best understood in the frequency domain, since it moves stuff down in frequency mod the nyquist frequency. If you try to build an intuition in the time domain, you'll think that there's some signal lost when you multiply by zero between pulses... and you'll guess at what it was and think "distortion" or whatever but what's lost is just WHERE each frequency is... so be very careful about what basis you choose!

Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by thunderbong on Wednesday December 10, 2014 @01:21AM (#8727943)
Wow! Just amazing! I can't believe the amount of confusing science this video dispelled for me. This should be seen by everybody who think they know what a digital signal is.
Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by drcode on Tuesday December 09, 2014 @11:27PM (#8727695)
Wow, I haven't learned that much in 20 minutes in years! Too bad this new found wisdom has such limited application for anything I'm actively involved with.
Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by logicallee on Wednesday December 10, 2014 @02:03AM (#8728023)
What technologies do you work with, and of these, what would you enjoy a ten minute enlightenment on?
Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by imaginenore on Tuesday December 09, 2014 @10:34PM (#8727541)
Wow, that video is awesome. It definitely corrected a few misconceptions I had in my head.
Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by gfody on Wednesday December 10, 2014 @04:03AM (#8728325)
The argument for mainstream 24bit dynamic range shouldn't be for higher fidelity reproduction for audiophiles. It should be for enabling more sophistication in our playback devices. In the YouTube era not every recording is perfectly mastered by audio engineers to fill the available range. And I could be listening on high end home theater equipment or the tiny speaker in my smart phone.
Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by laxatives on Wednesday December 10, 2014 @11:15AM (#8729903)
What about 24 bit enables "more sophistication in our playback devices". Doesn't sufficiently high fidelity mean you can already listen on your high end equipment?
Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by gfody on Wednesday December 10, 2014 @10:12PM (#8732996)
It would allow our playback devices to correct poor quality source material without introducing distortions or clipping. All the same reasons why 24bit is preferred in the studio. Basically studio-quality post processing would be possible on any mainstream content resulting in higher fidelity ultimately. Also, if you consider mashup style content where people are producing derivatives based on already mastered material it would generally increase the quality of that material.
Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by Demiurge on Tuesday December 09, 2014 @11:48PM (#8727739)
I learned more from this about digital/analogue conversion than from my EE class that covered this topic!
Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by iLoch on Wednesday December 10, 2014 @02:47AM (#8728136)
I watched the full 20 minutes and have absolutely no idea what he was talking about for most of it. I did have that misconception about the stepping in digital signals though - so I did learn something!
Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by nitrogen on Wednesday December 10, 2014 @03:06AM (#8728187)
Try watching his other videos; I think there's one that is more introductory.
Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by lisper on Wednesday December 10, 2014 @02:22AM (#8728075)
Is it just me, or is anyone else hearing something that sounds like wind noise over the narration? (It goes away when he plays sample sounds, and other audio on my system sounds normal.)
Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by vanderZwan on Wednesday December 10, 2014 @02:41AM (#8728119)
You mean the "noisy fan" (as Monty calls it) of the signal generator?
Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by lisper on Wednesday December 10, 2014 @02:43AM (#8728127)
Oh, is that what that is? Makes sense. Thanks.
Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by falfour on Wednesday December 10, 2014 @12:09PM (#8730249)
That was an awesome video, resulting in some follow up questions. Is it correct to say that lowering the bits increased the ground noise level, then why, (basically is quantization on the amplitude of the wave??)?

If lowering the number bits still produces the same output wave as input wave what and where is the lower limit that changes the sound?

Finally how is this 24 bit 16 bit related to my 128kbps mp3s?

Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by aidenn0 on Wednesday December 10, 2014 @12:36PM (#8730443)
With proper dithering, lowering the bits raises the noise floor. This is because dithering is approximately equal to changing the quantization error from something regular to something random.

If you don't dither, then the quantization error will likely be something harmonic rather than the hiss you hear in that video. This is much more noticeable[1].

Lowering the number of bits produces the same wave, but with more error. Dithering ensures that the error is random noise, which is why you hear "tape hiss" in that video as the bits gets lowered. With a tone frequency chosen to maximize the harmonic quantization error and no dithering you would start to hear it.

Lastly, 24 and 16 bit are largely unrelated to mp3s. In practice, mp3s are decoded to 16 bit audio, but they don't store the audio as PCM, but (roughly) rather as frequency/amplitude pairs which could in theory be decoded at any sample size. In any event, the absolute magnitude of error introduced by encoding a 128kbps mp3 is way, way, way larger than 16 bit quantization error, and the goal of the mp3 encoder is to find a way that is as inaudible as possible.

MP3 is an old format at this point, so it does have audible defects in some types of music at even the maximum bitrate (certain percussive instruments are an issue). Vorbis and AAC work in some ways similar to mp3 but are strict improvements (though for the love of music, don't use the FAAC decoder, it's generally considered horrible).

1: Still not noticeable at 16-bit audio, as a similar test to the one in the article was done with no dithering on the 24 -> 16 bit conversion. at somewhere between 12 to 14 bits it would start to be discernible.

Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by falfour on Thursday December 11, 2014 @07:13AM (#8734306)
Ahh, a lots been cleared up but I don't understand "Lowering the number of bits produces the same wave, but with more error" If the wave is the same how can there be more error? and is quantization error caused by quantizing the steps in amplitude?
Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by aidenn0 on Thursday December 11, 2014 @11:37AM (#8735660)
If you dither properly, then if you use a small number of bits you'll have a sine wave with noise and with more bits you'll have a sine wave with less noise.

If you dither improperly, then you'll end up with a sine wave plus some noise (less than if you had dithered) plus some harmonic distortion.

When talking about audio, one typically doesn't compare in the time domain, since that's not even remotely how ears work. One compares in the frequency domain, and until your quantization error is very large compared to the signal, there will still be some of the original content in the result.

This isn't a great analogy, as eyes and ears operate quite differently, but it does sort of get to the issue. Look at this image: http://en.wikipedia.org/wiki/Dither#mediaviewer/File:1_bit.p...

If you consider the original to have been an unquantized, but already sampled grayscale image, then essentially all of the pixels have large quantization error (since they were originally some shade of gray, but now they are all either black or white), so in one sense the original image is gone. But in another sense what you see is the original image, plus some noise.

Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by agumonkey on Wednesday December 10, 2014 @02:48AM (#8728140)
xiph.org is like a MOOC without the name, spectacular pedagogical quality.
Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by ehPReth on Wednesday December 10, 2014 @12:59AM (#8727893)
That video player is amazing! What is it?
Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by Hytosys on Wednesday December 10, 2014 @01:21AM (#8727944)
Seems to just be a browser-native <video> tag with an overlay that pretty simply controls the quality/time/subtitles. The logic for the controls is at video.js[1] and the logic for the subtitles is at subtitles.js[2] (check the `playSubtitles` function for VTT[3] decoding). All of the sources (the videos for each quality, and the VTT files for each subtitles track) are specified as HTML attributes in vid2.shtml, the linked page.

In short, it was seemingly made in-house.

[1] http://xiph.org/video/video.js

[2] http://xiph.org/video/subtitles.js

[3] http://dev.w3.org/html5/webvtt/

Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by q_no on Wednesday December 10, 2014 @04:10AM (#8728352)
Thanks for sharing! I really enjoyed the video, though I didn't understand everything (english is not my mothertongue).
Re:24-Bit vs. 16-Bit Audio Test – Part II: Results and Concl... by gcb0 on Tuesday December 23, 2014 @06:59PM (#8790889)
caveat: xiph works mainly promoting digital codecs. so...

there is a reason they like you to think DAC (digital to analog converter) is a moot problem.