How to get positive and negative peaks in real time

I think that question is already answered. Use a fixed offset, or use a low-pass filter as offset: How to get standard positive and negative peak - #2 by Koepel