Pm demodulation using phase locked loop
时间:04-07
整理:3721RD
点击:
Hello everyone! I have a problem. I would like to perform phase demodulation using PLL. I have some matlab code that do that in the case of FM. Here is the code:
%This m-file demonstrates a PLL which tracks and demodulates an FM carrier.
clear all;
close all;
f=1000;%Carrier frequency
fs=100000;%Sample frequency
N=5000;%Number of samples
Ts=1/fs;
t=(0:Ts:(N*Ts)- Ts);
%Create the message signal
f1=100;%Modulating frequency
msg=sin(2*pi*f1*t);
kf=.0628;%Modulation index
%Create the real and imaginary parts of a CW modulated carrier to be tracked.
%Signal=exp(1j*(2*pi*f*t+kf*msg));%Modulated carrier
Signal=exp(1j*(2*pi*f*t+2*pi*kf*cumsum(msg)));%Mod ulated carrier
Signal1=exp(1j*(2*pi*f*t));%Unmodulated carrier
%Initilize PLL Loop
phi_hat(1)=30;
e(1)=0;
phd_output(1)=0;
vco(1)=0;
%Define Loop Filter parameters(Sets damping)
kp=0.15; %Proportional constant
ki=0.1; %Integrator constant
%PLL implementation
for n=2:length(Signal)
vco(n)=conj(exp(1j*(2*pi*n*f/fs+phi_hat(n-1))));%Compute VCO
phd_output(n)=imag(Signal(n)*vco(n));%Complex multiply VCO x Signal input
e(n)=e(n-1)+(kp+ki)*phd_output(n)-ki*phd_output(n-1);%Filter integrator
phi_hat(n)=phi_hat(n-1)+e(n);%Update VCO
end;
I would like to modify this code to perform Phase demodulation. Does anyone can help me? Moreover,
does anyone know how to design the dimension of the different parameters like the phase detector gain,
the vco gain etc..
Thank you very much!
%This m-file demonstrates a PLL which tracks and demodulates an FM carrier.
clear all;
close all;
f=1000;%Carrier frequency
fs=100000;%Sample frequency
N=5000;%Number of samples
Ts=1/fs;
t=(0:Ts:(N*Ts)- Ts);
%Create the message signal
f1=100;%Modulating frequency
msg=sin(2*pi*f1*t);
kf=.0628;%Modulation index
%Create the real and imaginary parts of a CW modulated carrier to be tracked.
%Signal=exp(1j*(2*pi*f*t+kf*msg));%Modulated carrier
Signal=exp(1j*(2*pi*f*t+2*pi*kf*cumsum(msg)));%Mod ulated carrier
Signal1=exp(1j*(2*pi*f*t));%Unmodulated carrier
%Initilize PLL Loop
phi_hat(1)=30;
e(1)=0;
phd_output(1)=0;
vco(1)=0;
%Define Loop Filter parameters(Sets damping)
kp=0.15; %Proportional constant
ki=0.1; %Integrator constant
%PLL implementation
for n=2:length(Signal)
vco(n)=conj(exp(1j*(2*pi*n*f/fs+phi_hat(n-1))));%Compute VCO
phd_output(n)=imag(Signal(n)*vco(n));%Complex multiply VCO x Signal input
e(n)=e(n-1)+(kp+ki)*phd_output(n)-ki*phd_output(n-1);%Filter integrator
phi_hat(n)=phi_hat(n-1)+e(n);%Update VCO
end;
I would like to modify this code to perform Phase demodulation. Does anyone can help me? Moreover,
does anyone know how to design the dimension of the different parameters like the phase detector gain,
the vco gain etc..
Thank you very much!