📄 ask.m
字号:
n=[1:(2^13)];
x1=cos(n.*1e9*2*pi/4e9);
X2=rm2;
x2=X2';
x=x1.*X2;
b=0.42+0.5*cos(2*pi*(n-(2^12))/(2^13))+0.08*...
cos(4*pi*(n-(2^12))/(2^13));
X=b.*x;
x3=[ones(1,64) zeros(1,8128)];
y1=X(1:(2^13));
y4=x1.*x3;
Y1=fft(y1,(2^13));
magY1=abs(Y1(1:1:(2^12)+1))/(200);
Y4=fft(y4,(2^13));
magY4=abs(Y4(1:1:(2^12)+1))/(40);
k1=0:(2^12);
w1=(2*pi/(2^13))*k1;
u=(2*w1/pi)*1e9;
figure(1)
subplot(2,1,1);
plot(u,magY1,'b',u,magY4,'r');
grid;
title('ASKr');
axis([4e8,1.6e9,0,1.1]);
X2=b.*X2;
y2=X2(1:(2^13));
Y2=fft(y2,(2^13));
magY2=abs(Y2(1:1:(2^12)+1))/(200);
k1=0:(2^12);
w1=(2*pi/(2^13))*k1;
u=(2*w1/pi)*1e9;
Y3=fft(x3,(2^13));
magY3=abs(Y3(1:1:(2^12)+1))/(40);
subplot(2,1,2);
semilogy(u,magY2,'b',u,magY3,'r');
grid
title('ASKr-modulation');
axis([0,1.2e9,3e-4,3]);
figure(2)
subplot(2,1,1);
plot(n,x2);
axis([0,3250,-0.2,1.2]);
subplot(2,1,2);
plot(n,x);
axis([0,50,-1.2,1.2]);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -