ASK

套积分的不要管
clc;
close all
x=[ 1 0 0 1 1 0 1];
bp=0.1;
bit=[];
for n=1:1:length(x)
if x(n)==1;
se=ones(1,100);
else x(n)==0;
se=zeros(1,100);
end
bit=[bit se];
end
t1=bp/100:bp/100:length(x)bp;
figure(1)
plot(t1,bit);
axis([ 0 bp
length(x) -.5 1.5]);
ylabel(‘amplitude(volt)’);
xlabel(’ time(sec)’);
title(‘digital signal’);
A1=10;
A2=0;
br=1/bp;
f=br10;
t2=bp/99:bp/99:bp;
ss=length(t2);
m=[];
for (i=1:1:length(x))
if (x(i)==1)
y=A1
sin(2pift2);
else
y=A2
sin(2pift2);
end
m=[m y];
end
t3=bp/99:bp/99:bp
length(x);
figure(2)
plot(t3,m);
xlabel(‘time(sec)’);
ylabel(‘amplitude(volt)’);
title(‘waveform for binary ASK modulation’);
mn=[];
for n=ss:ss:length(m)
t=bp/99:bp/99:bp;
y=sin(2pif*t);
mm=y.m((n-(ss-1)):n);
t4=bp/99:bp/99:bp;
z=trapz(t4,mm)
zz=round((2
z/bp))
if(zz>7.5)
a=1;
else
a=0;
end
mn=[mn a];
end
bit=[];
for n=1:length(mn);
if mn(n)==1;
se=ones(1,100);
else mn(n)==0;
se=zeros(1,100);
end
bit=[bit se];
end
t4=bp/100:bp/100:length(mn)bp;
figure(3)
plot(t4,bit);
axis([ 0 bp
length(mn) -.5 1.5]);
ylabel(‘amplitude(volt)’);
xlabel(’ time(sec)’);
title(‘recived information as digital signal demodulation’);

上一篇:Codeforces Round #695 (Div. 2)


下一篇:求解组成最大最小周长三角形