logo

Schematic diagram of Phase locked loop

   

Added on  2023-01-18

4 Pages724 Words57 Views
Schematic diagram of Phase locked loop:
The ideal multiplier work as phase detector which measures the difference between the input
signal and VCO output signal and a voltage proportional to phase difference is generated.
The low pass filter removes high frequency component of the error signal. The error signal is
fed to VCO oscillator which slowly moves to steady state frequency. The Voltage Controlled
Oscillator produces high frequency output signal but the frequency is unstable as it changes
with temperature. When employed with phased locked loop the VCO cab produce stable high
frequency signal.
MATLAB code:
clc
clear
ref_freq=1e6; % refrence input signal frequency in Hz
pref=0; % Phase of reference signal is assumed to be zero Radians
VCOf=1.1e6; % the free running oscilating frequency of VCO in Hz which is the oscillating
frequency of VCO when input signal is not present
gVCO=.5e6; % VCO gain = Hz/volt transfer coefficient
sfreq=100e6; % frequency of sampling in Hz
snum=1e4; % total number of samples in simulation
fcl=.2e6; % low-pass filter cut-off frequency
lpfcoeffnum=100; % LPF filter coeffcient
% constructing LPF and time array
lpf = fir1(lpfcoeffnum,fcl/(sfreq/2)); % lpf design by Finite impulse response filter

sp=1/sfreq;
time=0:sp:(snum-1)*sp; % time array in between 0 to 10 msec.
VCOsig=zeros(1,snum); % initializing VCO signal with zeros to increase computation speed.
phi=zeros(1,snum); % initializing VCO phase in Rads with zeros to increase computation
speed.
reference=sin(2*pi*ref_freq*time+pref); % input reference signal is assumed to be sinusoidal
with zero phase deviation
for i=2:snum
t=(i-2)*sp; % Starting time is 0 secs
mult_error(i)=reference(i)*VCOsig(i-1);% obtaining error signal by multiplication of VCO
signal and input signal
%%%Passing the error signal through LPF filter
for j=1:length(lpf)
if i-j+1>=1
errorvec(j)=mult_error(i-j+1);
else
errorvec(j)=0;
end
end
finalerror(i)=sum(errorvec.*(lpf)); % summing the error with filtered signal. This is
working of Phase detector
%%%
phi(i)=phi(i-1)+2*pi*finalerror(i)*gVCO*sp; % updating Phase of VCO in sample points
VCOsig(i)=sin(2*pi*VCOf*t+phi(i)); % VCO signal construction based on current phase
end

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Signal Down-sampling and Up-sampling in MATLAB
|30
|3489
|56

MATLAB Homework Assignment Report
|13
|1310
|15

Signal Processing
|26
|1929
|326

Designing a High Pass Elliptic Filter for Desklib
|16
|1796
|386

Control Systems Signals and Systems Review
|8
|1305
|66

Transfer Function and Response Analysis
|5
|1192
|89