Applications

Other

Heaviside Unit Step Function

The
unit step function (also known as the Heaviside function) is
a
discontinuous function whose value is zero for negative arguments and
one for positive arguments. The Heaviside function is the integral of
the Dirac delta function.

This concept can be mathematically expressed as:

Our current intention is not to deal with all
the formal details. In this brief article we're going to deal
with it in an informal way, in order to just operate
with
it and create some plots in Matlab.

This
function is commonly utilized in control theory or digital
signal
processing (dsp) to represent a signal that switches on at a
specified time and remains switched on indefinitely.

The
function depends on real input parameters.

We can
define the function having a scalar number as an input. For
example,

let’s
create a discrete plot without using any special toolbox in
Matlab.

%
We change our output to 1 if the argument is greater
% than or equal to 0if n >=
0y
= 1;end

If we want to
get a plot from there, we have to iterate utilizing real numbers. If
the input is an integer, then the function will be a discrete one. To
stress the fact that we're working with discrete functions
here,
we'll use 'stem' instead of 'plot'.

Now,
let’s say that we have a vector (not a scalar) as an input. We want to
calculate the Heaviside function for all of the values
included in the vector.
We can create another function to considerate this approach:

We can
see that every integer in the domain of the
function counts to add to the final result, and that
happens
when the argument is zero for each term. The first term, 4H(n),
adds a height of 4 (coefficient) at n
= 0; the second term, 3H(n-2),
adds a magnitude of 3 at n = 2.