For completed examples, pls see provided Jupyter notebook.
git clone, cd to project directory and run the following commands:
pkg> activate .
pkg> instantiate
For Applications examples, pls see:
https://gjunqueira-sys.github.io/J-J-Engineering-Blog/
- signal(A::Real, start::Int, stop::Int)
using MySignalProcessing
signal(1.5, -5, 7) # creates a signal with 1.5 amplitude at range n = -5 to 7
signal(Real[1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5], Real[-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7])
- signal(A::Real, n::Int)
s = signal(2.0, 10) # creates a signal with 2.0 amplitude and n samples starting at n=0
signal(Real[2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0], Real[0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
- signal(A::Vector, n::Vector)
s - signal([1.0, 2.0, 2.1], [-1, 0, 1]) # creates a signal from amplitude vector and n sample vector
signal(Real[1.5, 2.0, 3.0], Real[-1, 0, 1])
- impseq(start::Int, stop::Int)
using MySignalProcessing
using Plots
s = impseq(-10, 10); # creates a unit sample sequence from -10 to 10
plot(s.n, s.A, line =:stem, marker=:o)
- stepseq(start::Int, stop::Int)
s = stepseq(-10, 10); # creates a unit step sequence from -10 to 10
plot(s.n, s.A, line =:stem, marker=:o)
- sigshift(n₀::Int)
s = impseq(-10, 10);
sshifted = s |> sigshift(5) # generate impulse signal then pipe it to sigshift(5) , to shift it by 5 samples
p1 = plot(s.n, s.A, line =:stem, marker=:o)
p2 = plot(sshifted.n, sshifted.A, line =:stem, marker=:o)
plot(p1,p2, layout=(1,2))