[Bruce Land] switched his microprocessor programming class over from Atmel parts to Microchip’s PIC32 series, and that means that he’s got a slightly different set of peripherals to play with. One thing that both chips lack, however is a digital-to-analog converter (DAC). Or do they? (Dun-dun-dun-duuuuhnnnn!)
The PIC part has a programmable, sixteen-level voltage reference. And what is a Vref
if not a calibrated DAC? With that in mind, [Bruce] took to documenting its performance and starting to push it far beyond the manufacturer’s intentions. Turns out that the Vref
has around 200 kHz of bandwidth. (Who would update a voltage reference 200,000 times per second?)
Anyway, [Bruce] being [Bruce], he noticed that the bits weren’t changing very often in anything more than the least significant bit: audio waveforms, sampled fast enough, are fairly continuous. This suggests using a differential PCM encoding, which knocks the bitrate down by 50% and saves a lot on storage. (Links to all the code for this experiment is inline with his writeup.)
The audio hacks that come out of [Bruce]’s Cornell ECE classes are always a treat. From the lock that you have to sing to open, to chiptunes programmed into an FPGA, there’s something for music fans of all inclinations.
It’s 4 bit, not 16 bit.
By the way, at 200kHz one can push a lot of the quantization noise beyond of the audible frequencies.
Could you please elaborate? <– interested
It’s still 4-bit, however it can “simulate” more levels by use of dithering.
It is like dithering in picture – if you get far enough from the picture, the dithered pixels merge into a continuous picture which looks like a picture using more colors. This happens because the spatial bandwidth of the picture exceeds spatial bandwidth of your eyes.
The same applies to sound – dither at such a high frequency that most of the noise lies in non-audible part of spectrum and et voilá, you have something that may sound like 16-bit audio. And if the oversample ratio is high enough, it even may be a 16-bit audio.
For more clear explanation, see “Oversampling” on Wiki— errh some encyclopedia of your choice.
Hackaday recently ran an article on Delta-sigma converters by Bil Herd. That explains the concept of oversampling and noise-shaping. Search for those keywords if interested
He didn’t say 4 bit, he said 16 values.
The title says “16-Bit Audio”
The title is fixed. Sorry about that, y’all!
16-bit output from 16 analog levels? I think you mean 4-bit
No, using PWM you can get a lot more that 4 levels.
The project page on hackaday.io says 4-bit. So, nothing fancy is being done
*cough* Resistor ladder *cough*
Indeed. Parallel port “sound card”, anyone?
Yup, yup, this was the commercial version that led to driver support for the hacked up version..
https://en.wikipedia.org/wiki/Covox_Speech_Thing
This was the reason I made mine back in the day…
http://www.awe.com/mark/dev/modplay.html
Even his project says 4bit.
Might wanna check how calibrated that vref is.
Pwm and multi order LPF makes a lot more sense
I wonder if [Bruce] has ever seen Roman Black’s “BTc Sound Compression Algorithm”. It goes a step further than dithering, simulates closed-loop operation by modelling the time constant of your low-pass filter at time of compression. I’d expect [Bruce] could get a noticeable improvement in quality using this technique.
Wow do you remember it too! I was amazed the first time i saw it. It was around 15-20 years ago, using a modest PIC using only digital pins
Elliot – always enjoy your Hackaday articles (and the resulting comments). Thank you for another interesting one.