[PLL][PM]锁相环模拟相位解调
生活随笔
收集整理的這篇文章主要介紹了
[PLL][PM]锁相环模拟相位解调
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
%鎖相環(huán)測試
%模擬相位解調(diào)clear
close all
clcfs=1000; %采樣率
tend=100;
t=0:1/fs:tend;
t(end)=[];
fc=1; %載波頻偏
fb=100; %PM調(diào)制信號頻率
gain=0.2; %鎖相環(huán)輸入增益
EbN0=20;[b,a]=cheby2(3,30,0.2); %切比雪甫濾波器
num=gain*b;
den=conv([1 -1],a)+[num,0];
pole=roots(den);
abs(pole) %計算系統(tǒng)穩(wěn)定性
fvtool(b,a);
lb=length(b);
la=length(a)-1;
bb=zeros(1,lb);
aa=zeros(1,la);cio=cos(2*pi*fc*t+cos(2*pi*fb*t));
cqo=sin(2*pi*fc*t+cos(2*pi*fb*t));
ci=awgn(cio,EbN0,'measured');
cq=awgn(cqo,EbN0,'measured');
cout=complex(zeros(size(ci)),zeros(size(cq)));
phase_out=zeros(size(ci));
phase=0;for k=1:length(cout)cout(k)=exp(1i*phase);err=complex(ci(k),cq(k))*exp(-1i*phase);phase_out(k)=angle(err);err=phase_out(k)*gain;bb=[err,bb(1:lb-1)];err=sum(bb.*b)-sum(aa.*a(2:end));aa=[err,aa(1:la-1)];phase=phase+err;if phase>pi, phase=phase-2*pi;elseif phase<-pi, phase=phase+2*pi;end
endCO=fft(cio);
CO=abs(CO)/length(CO);
CR=fft(real(cout));
CR=abs(CR)/length(CR);
F=linspace(0,fs,length(CR));
N=ceil(length(F)/2);
plot(F(1:N),CO(1:N),'r');
hold on
plot(F(1:N),CR(1:N),'b');
figure
plot(t,phase_out);
PO=fft(phase_out);
PO=abs(PO)/length(PO);
figure
plot(F(1:N),PO(1:N));
總結
以上是生活随笔為你收集整理的[PLL][PM]锁相环模拟相位解调的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: load data详解
- 下一篇: Android--通知之Toast