PaulS
Well-known member
Recently, while I was testing a Teensy 4.0 with this PCM5102A-based audio board, I noticed second & third harmonics showing from a 1KHz sine wave using a Scarlett 2i2 USB audio interface :
The FFT on my scope shows the same harmonics:
What is strange is that I tested this in january 2021 and that screenshot did not show the harmonics:
Also forummember Rolfdegen tested a PCM5102 board in this thread and that also shows no harmonics.
In my january 2021 post, I wrote that I was "Using Arduino 1.8.13, Teensyduino 1.53, modified output_i2s & output_pt8211 to support TLC."
Well, perhaps the audio library had changed since then, causing the harmonics?
So I reverted to that version of Arduino and Teensyduino by uninstalling my current Arduino 1.8.19 & Teensyduino 1.57 version and installing 1.8.13 & 1.53.
To be sure no remnants were left after uninstalling Arduino, I also deleted C:\Users\Paul\AppData\Local\Arduino15\ and C:\Users\Paul\AppData\Local\Temp\ .
Unfortunately that did not change the situation - still the 2nd & 3rd harmonics are present.
Then I installed the modified output_i2s & output_pt8211 I mentioned - still the 2nd & 3rd harmonics are present.
This is the code I had been using back then and still used today:
What else have I tried after this?
- Arduino 1.8.12, Teensyduino 1.52
- Arduino 2.1.0, Teensyduino 1.58.1
- Teensy 3.2 & Teensy 4.0
- use a different USB audio interface (Motu M2)
- use an older version of TrueRTA
- power the Teensy plus audio board by laptop over USB, by a USB wallcharger and by a 5Vdc lab powersupply
- more PCM5102A-based boards:
All the above did not help getting rid of the harmonics I see today.
I'm out of ideas right now, so any suggestions or otherwise are much appreciated!
Thanks,
Paul
The FFT on my scope shows the same harmonics:
What is strange is that I tested this in january 2021 and that screenshot did not show the harmonics:
Also forummember Rolfdegen tested a PCM5102 board in this thread and that also shows no harmonics.
In my january 2021 post, I wrote that I was "Using Arduino 1.8.13, Teensyduino 1.53, modified output_i2s & output_pt8211 to support TLC."
Well, perhaps the audio library had changed since then, causing the harmonics?
So I reverted to that version of Arduino and Teensyduino by uninstalling my current Arduino 1.8.19 & Teensyduino 1.57 version and installing 1.8.13 & 1.53.
To be sure no remnants were left after uninstalling Arduino, I also deleted C:\Users\Paul\AppData\Local\Arduino15\ and C:\Users\Paul\AppData\Local\Temp\ .
Unfortunately that did not change the situation - still the 2nd & 3rd harmonics are present.
Then I installed the modified output_i2s & output_pt8211 I mentioned - still the 2nd & 3rd harmonics are present.
This is the code I had been using back then and still used today:
Code:
#include <Audio.h>
AudioSynthWaveformSine sine1;
AudioOutputI2S i2s1;
AudioConnection patchCord1(sine1, 0, i2s1, 0);
AudioConnection patchCord2(sine1, 0, i2s1, 1);
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
AudioMemory(2);
sine1.frequency(1000);
sine1.amplitude(0.5); // -6dB
}
void loop() {
}
- Arduino 1.8.12, Teensyduino 1.52
- Arduino 2.1.0, Teensyduino 1.58.1
- Teensy 3.2 & Teensy 4.0
- use a different USB audio interface (Motu M2)
- use an older version of TrueRTA
- power the Teensy plus audio board by laptop over USB, by a USB wallcharger and by a 5Vdc lab powersupply
- more PCM5102A-based boards:
All the above did not help getting rid of the harmonics I see today.
I'm out of ideas right now, so any suggestions or otherwise are much appreciated!
Thanks,
Paul