FM Demodulation
Description
In this lab, you will implement an FM demodulator. You will be provided with a file containing IQ samples represented as complex numbers. [IQSamples File]
You will need to write a program that reads this file and outputs the wav file with the demodulated signal. You should use a polar discriminator to demodulate the sound file.
from pylab import *
import numpy as np
import sounddevice as sd
def main():
#Read in the samples from IQ text file:
### Polar discriminator
pass
def resampleAndPlayAudio(input):
#orginal samples where taken at 200kHZ need to down sample to 44.1kHz
#keep every 4 sample 200kHz /44.1kHz = 4.5
result = input[::4]
sd.play(result, 44100, blocking=True)
#Add code for writing wave file here.
if __name__== "__main__":
main()
Helpful Hints
You might need to pip install some of the libraries.
If the wav file does not play on the default player that comes with your windows machine, you can download finalMediaPlayer or use twistedWav.com/online. To test your audio file.
Mac users should not have a problem playing the wav file that they write.
Submission:
Once you have correctly demodulated the file. Login to Collab select answer that corresponds to words contained in the sound file.
Upload your code along with your submission. Please implement your solution in python.