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.