Prop sound quality question
danielstritt
Posts: 43
I decided to write my own wave playing program on the prop, to learn how to use sound with it. After 12 straight hours, I got it up and running. Problem is, the sound is muddy, like a very low bitrate mp3. But before I put time into fixing it, I need to know if the prop is capable of cd quality sound, or is that the best I can do?
Comments
This will be a non-issue for the Propeller 2 as it has built-in DACs.
Here is my player: http://forums.parallax.com/showthread.php/140767-A-new-topic-for-vga-%28not-only%29-sid-player
Compile with BST with unused method removal or it doesn't fit in 32k.
You can find a sound driver in it, which output noise free sound using ~300 KHz/8 bit sampling with noise shaping filter.
And one more thing: Propeller Demo Board has bad low pass filters (~1.6 kHz @3dB) - I had to modify this on my demo board. This filter makes the sound dull. No high freqs.
...which clearly shows the counters are being setup in DUTY cycle mode (single-ended). This is what I do in my player code, too. That said, when playing in low-frequency, 16-bit WAV file (especially pure tones), unexpected noise will show up without using Chip's stereo_duty cog. The best solution, which I used once, is a high-speed SPI DAC -- but they're expensive.
To compile Propplay with std prop tools, it may be sufficient to remove a "demo" method from the VGA driver.
Are you doing a PWM pulse train?
If so... then (80 MHz / 44.1 KHz) = 1,814 so the bit resolution is about 11 bits then right? I suppose that is enough for good audio. 8-bits is too low.
He also said to use pin 0 of COG 0 because the electrical path was the shortest.
Not with sigma-delta conversion and noise-shaping, no. You can get 24 bit audio happily out using 11 bit PWM, and PWM is orders of magnitude less sensitive
to jitter than NCO mode. Without understanding sigma-delta and noise-shaping it all looks like magic.
A-new-topic-for-vga-not-only -sid-player?
12-bit-audio-using-video-generator-first-working-concept
Return-to-duty-dac-oversampling-noise-shaped-player
A-simple-dithered-wav-player-now-dithers-every-1-microsecond
Post #11 in that last one also has Mark_T's very interesting class D sigma-delta driver. That drives the class D by the phase difference between two counters.
In "real life" only audible noise from a demoboard when using ncowav is its amplifier noise.
Also, I changed demoboard RC filter, shifting 3dB freq from 1.6 to 21 kHz.
We have a 16-bit sample, for example $1280. When output as 8 bit, it will be constant $12. When output after noise shaping filter it will be something like 12-13-12-13-12-13
Average is 12.5 (=>1280) and you have unhearable noise (square wave) @ 150 kHz.
Near all quantization noise goes to the ultrasonic range, and you have noise free sound, The noise is still there, but you can't hear it.
This is a noise shaper, all magic is here:
We have two integrators, i1l and i2l (for the left channel). Top 8 bits from second integrator goes to the output, and then are subtracted from both integrators. So, what is really integrated, is the quantization noise, and when there is more than 8 bit integrated, it is added to the output.