?? ook.m
字號:
%********modulation*************
D=[1 0 1 1 0 0 1 0];
N=length(D);%基帶信號符號數目
t=0:0.01:7.99;
y=cos(2*pi*t);
x=ones(1,100);
d0=D;
D0=[];
for k=1:N,
D0=[D0,d0(k)*x];
end%開關信號
z=y.*D0;%ook的表達式
%******demodulation*****************
recos=z.*y;
meg=find(recos>0);%找出大于一的那一位
demo(meg)=1;
meg=find(recos==0);
demo(meg)=0;
%*********drawing********************
subplot(2,1,1);plot(z);grid ;title('OOK modulation');axis([0,800,-2,2]);
subplot(2,1,2);plot(demo);grid ;title('OOK demodulation');axis([0,800,-2,2]);
xlabel('1 0 1 1 0 0 1 0');
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -