Electronic – MCP4921 audio: removing output DC Bias

audiobiasdac

I've seen a number of posts out there concerning adding/removing DC biases, and I can't seem to find one that has been directly applicable to my problem.

Question: How do I remove the 1.5V DC step that occurs when the MCP4921 outputs audio?

Problem: When I play sound, there is a clicking noise that occurs at the start and end of the audio sample. I am sure that I have removed any transients in my original samples by adding fade in/fade out, and the hex files that I have generated from these samples do not contain any transients at the beginning or end, either, as they begin and end with 0x00's. Other background information, such as my audio driver code, can be found here: Audio Noise: ATMEGA328P, MCP4921, and LM386

I have tried the following two possible solutions from different posts, with no change in the output characteristic:

  • Adding a 1.5V DC Bias to the MCP4921 output, using the topology of the first answer from this post: DC biasing audio signal
  • Adding two diodes between the output (after the AC coupling cap) and 5V power supply, to get an equivalent diode voltage drop to the step I am seeing

See attached for screenshot of the oscilloscope, with the probe being on the MCP4921 output (after the AC coupling cap). Also attached is the schematic. The schematic does not show the two possible solutions which I mentioned above. The purpose of the V_REF Resistors is to make a voltage divider that will give 0.25V at the V_Ref of the MCP4921. This was done so that the default gain of the amplifier, 20, will produce a 5Vp-p signal at the speaker.

Oscilloscope Output, Yellow is output of the MCP4921, past the AC Coupling cap, and Blue is at the speaker

EAGLE Schematic for Audio Module

Thank You,

Best Answer

You need to change your software so that between outputs of the audio you set the DAC to the mean voltage of the audio - presumably half-scale (0x80).

Then the audio will not be on a pedestal.

Most of these types of DACs use unsigned binary coding. To use it for audio you need to offer the audio by half-full scale so that you can go either positive or negative relative to the zero level.

Between audio clips you need to set your DAC to hat same level.

It doesn't look like you need any hardware changes.