In analog communications an AM signal is composed of a message signal with an offset that is mixed/multiplied into a carrier signal of a higher frequency, so that: $$ (V_{DC} + cos(f_m)) *cos(f_c) = V_{DC}*cos(f_c) + cos(f_c + f_m) + cos(f_c - f_m) $$
and this results in our modulated AM Signal where the yellow signal is the message and the blue signal is the resulting AM waveform (From Oscilloscope in lab, 2 kHz message, 100 kHz carrier)
Now in the demodulation process the signal is fed through a diode to give this this waveform
I understand how this works in practice, but I am having problems understanding the math behind the process and I am looking for a mathematical operation that can be explained as throwing away all negative values and keeping positive ones. I realize this looks like taking the absolute value but it is different in that the negative values are lost and do not become positive. Can anyone give me an example of a function or operator that can transform the above AM signal into the resulting signal containing only positive values?
I realize this question could also be asked in both signal processing and electrical engineering, but I am most interested in an answer from a mathematics viewpoint.
If you have some function $f(t):\mathbb{R} \rightarrow \mathbb{R}$ and want to keep the positive values while sending negative values to $0$ you can use $\frac{f(t) + |f(t)|}{2}$. If a value is positive, you add it to itself and divide by $2$ so it remains the same. If a value is negative, adding the absolute value will cancel it out.