Waveplayer output very quiet, how to debug?

19 Apr 2010 . Edited: 19 Apr 2010

My Billy Bass project is now working fine, except for the sound output volume/quality.

I use the Waveplayer code listed on this site, and the wave files play so quitely that I have to amplify the signal very much. This brings a really annoying buzz with the sound. In fact, the buzz can be heard all the time (even if the mbed isn't playing anything). I have tried with different power sources (ac-dc adapter, aa batteries, lead acid battery), but to no help.

When I measure the output voltage during playback it shows only about 0.05 volts (and about 0.03 volts when idle). I then tried the analogout demo (sawtooth wave) in the handbook and it plays significantly louder, giving an output voltage on about 1.5 volts on my digital multimeter. With this demo I can bring down the amplifiers so much that the buzz can't be heard anymore.

How can I get the wave files to play louder too? Where do I start investigating this?

20 Apr 2010

I think there's scope to simply mulitply the DAC output. In the void dac_out() function I think I multiplied the DACout.write statemet by x40 to boost the analogue out value i.e.

DACout.write_u16(40*DAC_fifo[DAC_rptr]);

the output is still offset with a dc component though, so that might need filtering out too.

 

27 Apr 2010

Rob Toulson wrote:

I think there's scope to simply mulitply the DAC output. In the void dac_out() function I think I multiplied the DACout.write statemet by x40 to boost the analogue out value i.e.

DACout.write_u16(40*DAC_fifo[DAC_rptr]);

the output is still offset with a dc component though, so that might need filtering out too.

 

Thousand thanks for that tip, it really did the trick! Now I can amplify the sound less, and the annoying buzz can't be heard anymore.