How to get positive and negative peaks in real time

i'm working on project i need to record audio. I can record audio from 8 to 48 kHz Real Time.I installed the Arduino bootloader on stm32f103 and I use the Arduino IDE.

But this is my problem I do not know how to use the "DC OFFSET" formula Real time
I can "normalize" after recording but I need 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

I'm a little confused

This is my output

Please do not double post. Continue the old thread.

It’s a nice screen shot, where’s the hardware and software that generated it ?

Is there a way to convert adc values to regular instances, I mean normalization but real time?

What are those?

@Koepel already gave you a perfectly fine solution. What's wrong with it?

This is great, but I need real-time, when I want to get samples instantly I can not use the average, are there ways?

So how about simply outputting the analog signal through a coupling capacitor? You can then reference it to whatever DC component you want in the next stage.

Excuse me Because I'm stupid The problem is that I get the adc value 0 to 4095 and connect the preamplifier to the adc input. it works great , i guess this problem for ADC-value i have to process it .
Can you give me a sample code to better understand it?

this is my problem

I need such a thing in real time. I have an old way. I used the normalization method but it does not work for real time.

By definition, NORMALIZATION cannot be real-time.

Is there another way?