Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

design pll and filter

Status
Not open for further replies.

Zardosht

Newbie level 6
Joined
Apr 2, 2012
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Iran
Activity points
1,376
Hi
I want to design a PLL,and i dont know how can i design a first order low pas filter,i cant use matlab functions,and i want to write a filter my self,below i have a matlab code. i want use it as part of a squaring loop block for carrier recovery in ssb modulation,in this structure fc goes to 2fc and a pll use to phase recovery , how can i design filter same following code? what is kp and ki?indexes of filter? i would appreciate if anybody can help me.


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(j*(2*pi*f*t+2*pi*kf*cumsum(msg)));%Modulated carrier
Signal1=exp(j*(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(j*(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;
 

formulae as I recall from the late 70's for Loop filter get complicated for capture range , phase noise reduction of clock or stability .
Modelling is required by trial and error as there is a trade-off between desired capture time and jitter reduction as well as capture range and clock error.
You need to define these parameters before you can choose an optimal design.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top