Audio adapter output polarity

Status
Not open for further replies.

lamikam

Active member
I'm using the teensy 3.6 board with the audio adapter and the teensy audio library. Here's the code to generate a sine wave:

AudioMemory(10);
sgtl5000_1.enable();
sgtl5000_1.volume(0.9);
sgtl5000_1.unmuteLineout();
sgtl5000_1.lineOutLevel(13);
waveform1.begin(WAVEFORM_SINE);
waveform1.frequency(100);
waveform1.amplitude(1);

I have a scope on the line out. See picture. The scope is showing the amplitude go negative. Why is that?
Capture.PNG

Also, I fed the output into a stm32-nucleo board (with arduino framework). printed out the analogRead values, and plot looks like this
c2.PNG
Which if the signal went negative, may correlate to the truncated floor values of 0. What am I doing wrong?
 
The Audio adapter board has DC-blocking capacitors on the line inputs and line outputs. Any audio device will handle proper AC
correctly (and some do not like a DC bias at all, for instance a DC-coupled amplifier fed a DC signal will blow speakers up).

Alas the audio adapter doesn't have bleeder resistors on the outputs so the output can have a DC offset that gradually fades with
time.

[ Incidentally for some reason the SGTL5000 has line outputs phase-inverted - the headphone outputs are correct though. This
would need something like a sawtooth wave to see on a 'scope though. ]
 
Status
Not open for further replies.
Back
Top