Can I use not
as a discrete dirac delta function in Matlab?
The definition for the discrete dirac delta function is that
for argument 0 it returns 1, and otherwise it returns 0.
But that is exactly what the not
function does in Matlab also!
Do you see any problems if I use not
instead of writing my own
dirac delta function? I am aware that Matlab has a dirac
function, but that one is the continuous version - it returns infinity
for 0 instead of 1.
Description. d = dirac( x ) represents the Dirac delta function of x . d = dirac( n , x ) represents the n th derivative of the Dirac delta function at x .
The Dirac delta function, often referred to as the unit impulse or delta function, is the function that defines the idea of a unit impulse in continuous-time. Informally, this function is one that is infinitesimally narrow, infinitely tall, yet integrates to one.
The Dirac delta is not truly a function, at least not a usual one with domain and range in real numbers. For example, the objects f(x) = δ(x) and g(x) = 0 are equal everywhere except at x = 0 yet have integrals that are different.
I think it's OK, but note that the output of not
is an array of logical
s:
Example:
a = [0, 1, pi]
b = not(a)
c = double(b)
whos
Output:
a =
0.00000 1.00000 3.14159
b =
1 0 0
c =
1 0 0
Variables in the current scope:
Attr Name Size Bytes Class
==== ==== ==== ===== =====
a 1x3 24 double
b 1x3 3 logical
c 1x3 24 double
Total is 9 elements using 51 bytes
So if the inputs are double
s, I would define the discrete Dirac delta function this way:
ddirac = @(x) double(not(x));
or
function y = ddelta(x)
y = double(not(x));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With