RMS is by definition non-negative.Hello everyone,
with the AudioLib I get a value range from 0.0 to 1.0 for PEAK and RMS - ok.
But I need the range -1.0 to 1.0.
How do I get this range?
Thanks,
Bruno
RMS is by definition non-negative.
You'd need a modified version of AudioAnalyzePeak for this I think.
I think so too.
I need the negative values for a correlation display and a goniometer.
As a desktop version in C# and NAudio it works fine, but the implementation for the Teensy gives me difficulties.
Unfortunately I wouldn't know how to modify or better extend the AudioAnalyzePeak in my project. Because the original should already remain unchanged.
float read(void) {
__disable_irq();
int min = min_sample;
int max = max_sample;
min_sample = 32767;
max_sample = -32768;
__enable_irq();
min = abs(min);
max = abs(max);
if (min > max) max = min;
return (float)max / 32767.0f;
}
Well the existing read() method in Audio/analyze_peak.h is:
You could add two similar methods called readMax and readMin I'm sure...