Hi everyone! (my first post)

I'm teaching myself some DSP by building the original Rich Heslip Teensy_SDR by incremental degrees. (See https://github.com/rheslip/Teensy_SDR). He notes in the code that his AGC.cpp code is "probably broken with the new audio library", and while it compiles for me, the best I can get it to do leads to a crash (solid tone out of the audio board) after a few minutes of listening. I have had to comment out the AGC part of the code, as that locks up the Teensy entirely, so for now I am currently just trying to get the S-meter code to work. In evaluating Rich's code, I'm trying to work out why it's broken. I suspect that something might be leading to excessive values being fed into the variables -- although there doesn't seem to be much in the way of distortion products in the output.

HARDWARE: Teensy 4.0 + Audio Board (for the Teensy 4.0)

One key thing is relating the result of calling AudioAnalysePeak::read() to what's happening with the signal when it goes into LINE-IN -- reading both Paul's library code and the SGTL5000 datasheet suggests that when the return value of the function reaches the maximum value of 1.0, that corresponds to a 1v RMS input signal at the analog LINE-IN port. (Assuming the pre-ADC analog gain is set to 0dB).

Am I right?

Thanks for any help.
Paul Roberts, G0OER.