Skip to content

gjunqueira-sys/MySignalProcessing.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MySignalProcessing

Stable Dev Build Status Coverage Code Style: Blue ColPrac: Contributor's Guide on Collaborative Practices for Community Packages

Jupyter Notebook

For completed examples, pls see provided Jupyter notebook.

Installation

This package is not yet release, so pls clone this repository:

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/

Creating a signal (Constructors)

  • 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])

UNIT SAMPLE SEQUENCE

  • 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)

Imp. Sequence

UNIT STEP SEQUENCE

  • 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)

Step  Sequence

Signal Shift

  • 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))

Imp. Shifted

About

Basic signal processing functions (DSP) in Julia language

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published