I got it from comparing the plots. Yeah that is the code I'm using. Does this help in recovering the modulating waveform? To me it looks like a rectified AM waveform. But yeah, I could be wrong...
Ok now you have to try to recover the actual sine wave that was used as the message signal. To do that you'll need some low pass filtering and some offset. How you do that you'll have to figure out, and it has to work with all message frequencies unless you plan to use only one frequency ever.
It might work so you might try it.