asktiaozhi.m

来自「这是一个FSK ASK 升余弦的的调制程序」· M 代码 · 共 30 行

M
30
字号
function z=asktiaozhi(s,f)
t=0:2*pi/99:2*pi;
cp=[];mod=[];bit=[];
for n=1:length(s)
    if s(n)==0;
        cp1=zeros(1,100);
        bit1=zeros(1,100);
    else s(n)==1;
        cp1=ones(1,100);
        bit1=ones(1,100);
    end
    c=sin(f*t);
    cp=[cp cp1];
    mod=[mod c];
    bit=[bit bit1];
end
ask=cp.*mod;
subplot(2,1,1);
plot(bit,'lineWidth',1.5);grid on;
ylabel('Binary Signal');
axis([0 100*length(s) -2.5 2.5]);
subplot(2,1,2);
plot(ask,'lineWidth',1.5);grid on;
ylabel('ASK modulation');
axis([0 100*length(s) -2.5 2.5]);
    
        
        
        
        

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?