>> x=0:0.01:8;
>> y = fsk(x,0.001,64,1,2000,5000);
>> plot(y)
>> y = msk(x,0.001,64,1,1000);
>> plot(y)
>> y = msk(x,0.001,64,1,2000);
>> plot(y)
>> y = msk(x,0.001,64,1,1000);
>> plot(y)
>> help fsk
digital为输入码流,T为码元周期,n为每个码元内正弦波抽样点数,
A为载波幅度,f1,f2为两个载波的角频率,f1对应0,f2对应1>> help msk
digital为输入码流,T为码元周期,n为每个码元内正弦波抽样点数(须为偶数),
A为载波幅度,f为载波的中心频率
关于FSK的
ction y = fsk(digital,T,t,n,A,f1,f2)
%digital为输入码流,T为码元周期,n为每个码元内正弦波抽样点数,
%A为载波幅度,f1,f2为两个载波的角频率,f1对应0,f2对应1
t = (0 : (n*length(digital)-1))*(T/n);
analog = kron(digital,ones(1,n));
y = A*(cos(2*pi*f1*t).*~analog + cos(2*pi*f2*t).*analog);
关于MSK的
ction y = msk(digital,T,n,A,f)
%digital为输入码流,T为码元周期,n为每个码元内正弦波抽样点数(须为偶数),
%A为载波幅度,f为载波的中心频率
di = digital(1:2:end)*2-1;
dq = digital(2:2:end)*2-1;
ai_tmp = kron(di,ones(1,2*n));
aq_tmp = kron(dq,ones(1,2*n));
if mod(length(digital),2) == 0
ai = ai_tmp((n+1):end);
aq = aq_tmp(1:(n*length(digital)-n));
t = (0 : (n*length(digital)-n-1))*(T/n);
else
ai = ai_tmp((n+1):(n*length(digital)));
aq = aq_tmp;
t = (0 : (n*length(digital)-n-1))*(T/n);
end
yi = ai.*cos(pi*t/2/T).*cos(2*pi*f*t);
yq = aq.*sin(pi*t/2/T).*sin(2*pi*f*t);
y = A*(yi + yq);
比较长,请懂的帮我看看,非常感谢