DIYLAB
Well-known member
Teensy 4.0, AudioShield, Teensyduino 1.53
Hi all,
a simple, basic question about RMS from the Audioshield:
Shouldn't this program actually give a value of 1.0 at 1V sine Vrms (1KHz)?
Displayed is only 0.89.
The value 1.0 is never reached, not even at 3V Vrms, then it is 0.95
Since I do not understand this, I ask you for enlightenment - thank you very much!
Hi all,
a simple, basic question about RMS from the Audioshield:
Shouldn't this program actually give a value of 1.0 at 1V sine Vrms (1KHz)?
Code:
#include <Wire.h>
#include <Audio.h>
// GUItool: begin automatically generated code
AudioInputI2S i2s1; //xy=372,361
AudioAnalyzePeak peak1; //xy=717,293
AudioAnalyzeRMS rms1; //xy=717,337
AudioAnalyzeRMS rms2; //xy=719,383
AudioAnalyzePeak peak2; //xy=720,426
AudioConnection patchCord1(i2s1, 0, peak1, 0);
AudioConnection patchCord2(i2s1, 0, rms1, 0);
AudioConnection patchCord3(i2s1, 1, rms2, 0);
AudioConnection patchCord4(i2s1, 1, peak2, 0);
AudioControlSGTL5000 sgtl5000_1; //xy=322,466
// GUItool: end automatically generated code
elapsedMillis fps = 0;
void setup() {
// Audio
AudioMemory(6);
sgtl5000_1.enable();
sgtl5000_1.inputSelect(AUDIO_INPUT_LINEIN);
}
void loop() {
if (rms1.available()) {
if (fps > 24) {
fps = 0;
float raw = rms1.read();
Serial.println(raw, 2);
}
}
}
Displayed is only 0.89.
The value 1.0 is never reached, not even at 3V Vrms, then it is 0.95
Since I do not understand this, I ask you for enlightenment - thank you very much!