⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pulsegen.m

📁 数字通信第四版原书的例程
💻 M
字号:
function [sys,x0] = pulsegen(t,x,u,flag,height,width,dt)
%PULSEGEN generates perfect pulse for communication toolbox.

%       Wes Wang
%       Copyright (c) 1995-96 by The MathWorks, Inc.

if flag == 2     %refresh states
    sys(1) = rem(x(1)+1,2);
 if (sys(1)==1)
          sys(2) = 1;
             sys(3) = width;
 else
            sys(2) = 0;
             sys(3) = dt - width;
    end;
elseif flag == 3 %output calculation
        sys = x(2);
elseif flag == 4 %
   sys = t + x(3);
elseif flag == 0 %initial condition
      sys = [0;3;1;0;0;1];
    x0 = [0,0,width]; %phase, pulse value, dt;
      if dt<width
             error('The pulse width cannot be larger than sampling time')
    end;
else
        sys = [];
end;

⌨️ 快捷键说明

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