Code covered by the BSD License  

Highlights from
Electromagnetic Waves & Antennas Toolbox

image thumbnail

Electromagnetic Waves & Antennas Toolbox

by

 

06 Feb 2004 (Updated )

Companion Software

ustep(t,tr)
% ustep.m - unit-step or rising unit-step function
%
% Usage: y = ustep(t)           (unit step)
%        y = ustep(t,tr)        (rising unit step, with rise time tr)
%
% t  = any vector 
% tr = rise time (tr=0 corresponds to a unit step)
%
% y = (t/tr)*[u(t)-u(t-tr)] + u(t-tr)
%
%
% see also UPULSE

% S. J. Orfanidis - 1999 - www.ece.rutgers.edu/~orfanidi/ewa

function y = ustep(t,tr)

if nargin==0, help ustep; return; end
if nargin==1, tr=0; end

y = zeros(size(t));

if tr==0,
    y(find(t>=0)) = 1; 
else
    y = (t/tr) .* (ustep(t) - ustep(t-tr)) + ustep(t-tr);
end




Contact us