Extracting the carrier signal from AM I am new to DSP and leaning about amplitude modulation.

I am trying to demodulate a 5 Hz signal that is modulated by a 50 Hz carrier. I am trying to extract the carrier, not the the 5 Hz signal.

A simple band-pass filter at the desired frequency frequency did not work and I am not sure why. I understand that phase locked loops can also be used.

Are phase locked loops a better approach to extracting the carrier signal? What may be some other useful approaches? I am looking for an approach that makes no assumptions on the carrier and signal frequency.

Thanks

The image below depict the AM signal along with the failed attempt to extract the carrier signal. Below that is the frequency components of the signal (which indicated that the carrier is clearly not suppressed).
To extract only the carrier with a band-pass filter, the filter pass-band has to be narrower than the modulating frequencies, or else some of the envelope modulation will "leak" through the filter.  Also note that a very narrow filter has a long settling time, so you will need a long enough test signal.