This is my first post so sorry if I make any mistake.
The entire signal length in the screen shot below is 10 second. I ran a first order low pass filter (digital) at 10Hz cut-off frequency, and I obtained the orange/yellow line in the picture. Please ignore the red and the blue line for now.
I wonder if there is an algorithm that I can extract all of the lowest values of the green plot in real-time and reconstruct/interpolate data along the way like the black line that is shown below?
The green signal (50Hz) is the DFT result of a raw 1kHz sine data that is sampled at 10kHz. I really hope that we can find a light-weight algorithm for the filter, since the entire code has to run on a microcontroller.
I would love to hear your suggestions. And let me know if anything is needed for clarification.