MartinStokroos / TrueRMS

Average, RMS, Power and Energy measurement library for Arduino.
MIT License
64 stars 29 forks source link

Frequency range #2

Closed classic-audio closed 4 years ago

classic-audio commented 5 years ago

By using the TrueRMS lib. I have some problems measuring frequences above 4kHz. This is a problem for me. I am using the TrueRMS measuring sine signals on power audio amplifiers. What can I do to be able to measure up to at least 20kHz?

MartinStokroos commented 4 years ago

Hi classic-audio, With the base-line restoring option switched off, the Rms update routine takes about 30 micro-seconds at maximum on the Arduino-UNO. Assume we execute the update function each 40us (at the sample frequency of 25kHz). For accurate measurements multiple samples per period are necessary. So indeed we end up in a few kHz maximum. I always check the duration of my functions and code with an oscilloscope by toggling I/O-pins to prevent from overruns. This library was developed with the purpose of power converter systems working at the grid frequency. If you want to use it for audio, I would recommend you to:

Best Regards, Martin