Electronic – Get clean line-level audio signal from a sound generator chip that is designed to drive a transistor as amplifier

analogaudio

(I removed both of the two old questions since they are going wild and off-topic, but the main concept is the same, just as title states. Also some details are clarified and informations are appended.)

I need to record the output of two sound generator chips with a Sony PCM recorder.

The recorder does not specify the maximum input level, the only technical specification on manual is

Microphone/External input jack (minijack, stereo)Input for plug in power, minimum input level 1.0 mV

To make sure the recorded audio does not become distorted, I need to keep the input below 0dB. After many trying, it seems like when the VU meter shows 0dB, the input voltage is about 0.5V. I am not sure how to measure the exact voltage for 0dB, which seems like has many definitions (0.6V, 0.775V, 1V, etc).

Both chip are designed to simply drive an NPN transistor as amplifier, and drive a speaker with it:

enter image description here
enter image description here

And the datasheet both have this entry about output current, but not voltage (I am not sure what does the VOH and VDS mean), and when I measured the voltage of the output pin when the chip is working (a song being played), the voltage is about the same as VCC:

enter image description here
enter image description here

So I tried various ways to capture the highest quality of audio from them. I have found that I will need a resistor from AUD (the output pin) to ground, to provide the chip a load and make sure that the output voltage is correct. But how do I determine the value of that resistor? For example, I used a potentiometer to try many times on the HT3894, and seems like the optimal value which I am getting max audio level without peaking (which from the measurement above, should be around 0.5V maximum) is ~390Ω. But I assume there will be some mathematical way to get this value from the specs the datasheets provide, since it won't be random?

enter image description here

Also when I used the method stated above to capture the output, it sounds nothing wrong when played back and heard by ear, but when I examine the waveform in DAW, I saw something unusual:

enter image description here
enter image description here

The waveform has a downward peak, which I assume it's some DC thing in the output. To prove this, I tried to connect a low voltage DC source to the audio input and record it, and sure enough:

enter image description here

So the second question is, is it possible to eliminate this DC signal mixed in the output of the chip? How to? I tried to connect a capacitor in between, but the sound just becomes hoarse, and the downward "bulges" in the waveform are still there.

Also I have found a recording sample of the same song done by others (bottom image), which does not have the "bulges". After comparing the two, I found out that my recording (top image) is more of a square wave variation, looks like some sort of PWM signal.

enter image description here

Here are the datasheets if you ever need other information:

HT3894

M994A

Best Answer

You're looking at the low frequency response of your soundcard input : both the waviness and the response to a DC step. The flat top squares on your waveform (last plot) are trapezoids in the "other" recording : this just says your recording has better bass response.

If it sounds fine on playback, don't worry about it. If you want poorer bass response, either AC couple into the soundcard, or simpler, use the sound editor facilities to cut the bass. Which is probably all they did on the other recording.