Integral of a signal using delay buffer: how to get the last X samples from a delay~ buffer?
Julia Merino
Apr 13 2023 | 12:27 pm
Hi, I am implementing a patch to calculate the loudness of an incoming signal for an interactive live performance system. This system will have a parameter to change the duration of the sliding window between 1 and 30 seconds. My first approach was to use average~ however this doesn't work when suddenly changing the time interval from 1s to 10s for instance as I guess the buffer doesn't have access to the samples of the last 10s. For this reason, I've thought of implementing the average calculation by always storing in a delay buffer the last 30 seconds and from there get the last T time samples to calculate the accumulation (integral) and then divide that between T-time samples to get the average.
My question is how to get the last X samples from a delay~ buffer?
Thanks a lot for you help!