PT8211 amplitude-dependent distortion - bad part?

kgutwin

New member
I have a PT8211 connected to a Teensy 4.0 on a custom PCB, but wired essentially the same as the PT8211 kit sold by PJRC. While chasing various noise issues, I was able to replicate a very specific issue with the PT8211 audio output. I am seeing an amplitude-dependent higher-order harmonic that appears quite suddenly when the signal peak crosses certain power-of-2 thresholds. These distortions definitely seem digital in nature, in that they appear with only a single bit change in the output level. This is quite noticeable on any audio signal, but is most easily visualized with a sine wave. Apologies for the old-school analog scope snapshots - please magnify to see the details!

The first is showing a sine wave with a maximum amplitude of 0.015625 or (512 / 32768):

IMG_0699.jpg

The second has a maximum amplitude of just one bit higher at (513 / 32768):

IMG_0700.jpg

You can see how the peaks of the sine wave start to get offset down slightly, which looks a bit like clipping, but this signal is definitely much smaller than the maximum output of the part. As the amplitude goes higher, that observed offset continues to be present, and then a new offset appears again on each subsequent multiple of two. The next pair of scope captures are at 1024 and 1025, respectively:

IMG_0701.jpg
IMG_0702.jpg

This continues repeating as the amplitude increases, all the way until the output starts to really clip beyond the maximum signal level.

The code to replicate this is below. This alternates between the two amplitude thresholds with a second of silence in between.

Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

#define MAX_AMP 1024

// GUItool: begin automatically generated code
AudioSynthWaveform       waveform1;      //xy=110,75
AudioOutputPT8211        pt8211_1;          //xy=303,78
AudioConnection          patchCord1(waveform1, 0, pt8211_1, 0);
AudioConnection          patchCord2(waveform1, 0, pt8211_1, 1);
// GUItool: end automatically generated code

void setup() {
  AudioMemory(15);
  waveform1.begin(WAVEFORM_SINE);
  waveform1.frequency(250);
}

void loop() {
  waveform1.amplitude(MAX_AMP / 32768.0);
  delay(1000);
  waveform1.amplitude(0.0);
  delay(1000);
  waveform1.amplitude((MAX_AMP + 1) / 32768.0);
  delay(1000);
  waveform1.amplitude(0.0);
  delay(1000);
}

I'm curious if anyone has seen this behavior, or does it suggest a bad part? I tried fiddling around with the resistor values in an R2R DAC configuration using a circuit simulator and was able to reproduce this sort of behavior, if one of the resistor values is way out compared to the others. The only strange part about that hypothesis is that I see the exact same behavior, with the exact same thresholds, on both stereo channels.

Thanks for any suggestions!
 
Back
Top