How Could I extract the signal in the below Image 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.
Normally you could do some valley detection. Scipy does this (https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.find_peaks.html) but this requires knowing a chunk of the signal in advance so you couldn't do it real time.

For real time maybe you could look at the derivative of the signal and notice when it goes from negative to positive, it would find valleys although it may not be as smooth as your black line. Maybe also check out this: https://stackoverflow.com/questions/22583391/peak-signal-detection-in-realtime-timeseries-data