frequency demodulation via phase locked loop

The following code was written by Paul Sand, a graduate student at Northern Illinois University in Dekalb, IL. This Matlab code demodulates an FM signal using a phase locked loop.




How to use it: Simply copy the 3 files to a Matlab path directory and type "test". The test.m file produces a 500 hz signal which is modulated onto a 10 kHz carrier with a call to fmod.m. It then recovers the 500 Hz signal using a call to spll.m. The output of the LPF is the recovered signal.

phase locked loop simulation

simulation code

The following is the Phase-Locked Loop simulation code and has been tested with MATLAB version 7.0.0. The goal of the PLL is to lock to a reference frequency fref within a certain amount of time (settling time). By using this code we can study the PLL system from the unlocked state to locked state in a nonlinear case.



How to use it: Download and store the files in the same directory. Readers can use the simulator to evalutate behaviour of the PLL in terms of stability and locking to specified frequencies. "PLLmain.m"- This script is main file of the simulator. It allows the user to run it for different simualation scenarios based on the user-designed parameters. It also displays plots of the simulation results. "PLL.m"- This function is called by the simulator. It is the central part of this program and actually implements the PLL mechanism.

simulation report