I'm looking to understand how signal modulation/demodulation works.
My goal is to be able to demodulate a 315 MHz key fob and be able to tell what buttons are being pressed so I can have a Python script perform actions based on the button presses.
From my understanding, the fob first generates the signal (according to some kind of rolling code), encrypts it, modulates it as Pulse Width Modulation, then modulates it as Amplitude Modulation before transmitting the signal. The FCC ID for the fob is CWT-WB1U331 (the dash is to make it easier to search on the FCC website as I have mistakenly included the WB in the manufacturer code).
Using GQRX I have recorded several signals with AM demodulated and then manually demodulated the PWM output into a csv as binary.
The part that is important to the question itself is learning how to write demodulators so I can demodulate in Python. I'm looking to take a complex signal from a RTL-SDR, convert the signal to a wav file with the PWM modulation for debugging purposes and then decode the PWM modulation into a spreadsheet.
The part I'm currently stuck on is figuring out how to write an AM demodulator. I'd say my main struggle is my not understanding math which is more complicated than algebra.
In my Python script, I have successfully tested demodulating FM radio and saving the demodulated output to a wav file by inserting in an existing FM demodulator I stole from https://stackoverflow.com/a/60208259/6828099.
From what I can tell, there are multiple different ways to demodulate AM, such as https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-661-receivers-antennas-and-signals-spring-2003/lecture-notes/lecture17.pdf and hilbert transforms. I also believe FFTs may be relevant to some methods of AM demodulation, such as the hilbert transform, but I may be wrong.
To help show what it is I'm working with, I've created a Github Repo with my signal saving script, the manual decoding of my recording, and the recording in the form of an Audacity project with a label track at https://github.com/ArchivedProjects/dsp-stack-exchange. The recording was made with GQRX, so it's already been demodulated to PWM from AM and is probably irrelevant to this question. I also just added a fully modulated file called no-demod.wav where I press the lock button once just in-case one does not have a SDR and wants to experiment on some data. The 4 different sections in the one signal are the same message being transmitted 4 times.
I'm not expecting the Python function to just be handed to me, as if it was, I'd not learn anything about digital signal processing. I will say, I am very new to DSP, so a lot of concepts are new to me, and I do apologize for not knowing more about how signal processing works before asking this question. I guess the last thing I should mention is, I am far better at understanding conceptually than I am mathematically, so if there is a way to help me understand this conceptually and then bridge the concept to math, I'd greatly appreciate it. Sadly, I don't have a lot of money, so I can't just buy books or enroll in a college course on signal processing.
TLDR: I want to learn how to demodulate signals such as AM and PWM to be able to read binary data transmitted near the 315 MHz frequency.
Edit: Here's some screenshots of plots of the signal. The first screenshot is what the waveform looks like when recorded without demodulation by GQRX and so looks a lot better than my own recording. The second one is how I recorded it. The third one is what the demodulated output looks like.