Git Product home page Git Product logo

signals.jl's Introduction

Signals

So far it does a couple things. Here are some things it does well (the spacing is a bit messed up thx to github)

julia> using Signals

julia> ss = load("/Users/zcranko/Desktop/walt_djembe_126_02.wav")
Signals.Signal{2,FixedPointNumbers.Fixed{Int32,31},44.1 kHz}  168002 fr (3.81 s)
[ ⣷⣶⣦⣶⣷⣦⣶⣦⣦⣶⣦⣶ ⣦⣄⣤⣤⣤⣤⣦⣄⡀ ⡀⣷⣷⣦⣶⣤⣶⣦⣦⣤⣀⣄⡀⣀⡀⣤⣶⣶⣶⣶⣷⣤⣶⣀⣦⣷⣤⣦⣤⣤⣄⣄⣦⣤⣷⣤⣄⡀⡀⣤⣷⣶⣶⣶⣦⣶⣄⣦⣄⣄⣄⣀⣀ ]
[ ⣷⣶⣦⣶⣷⣤⣶⣦⣦⣶⣤⣶⣀⣦⣤⣤⣤⣄⣤⣦⣄⣄⡀ ⣶⣶⣦⣶⣤⣶⣤⣦⣤⣄⣤ ⣄⣀⣤⣶⣦⣶⣦⣶⣦⣶⡀⣦⣷⣶⣦⣤⣦⣀⣄⣤⣤⣷⣦⣄ ⡀⣤⣶⣶⣶⣶⣦⣦⣄⣦⣄⣤⣄⣀⣄ ]


julia> ss[201:400]
Signals.Signal{2,FixedPointNumbers.Fixed{Int32,31},44.1 kHz}    200 fr (4.51 ms)
[                                                  ⣀⣀⣀⣄⣦⣶⣶⣦⣦⣦⣤⣄⣄⣄⣄⣤⣦⣤ ⡀⣦⣦⣦⣄⣦⣶⣀⣶]
[                                                  ⣀⣀⣀⣄⣦⣶⣶⣦⣦⣦⣤⣄⣄⣄⣄⣤⣦⣤ ⡀⣦⣦⣦⣤⣦⣶⣄⣶]


julia> ss[1s:2s]
Signals.Signal{2,FixedPointNumbers.Fixed{Int32,31},44.1 kHz}   44101 fr (1.00 s)
[ ⣶⣶⣷⣶⣦⣶⣶⣷⣶⣦⣶⣶⣶⣦⣤⣶⣶⣶⣷⣷⣶⣶⣶⣶⣶⣤⣦⣶⣶⣶⣄⣦⣦⣶⣦⣄⣷⣦⣷⣷⣶⣶⣶⣦⣦⣦⣶⣶⣦⣄⣤⣦⣦⣄⣤⣤⣤⣄⣄⣤⣤⣤⣤⣦⣶⣦⣦⣤⣤⣤⣤⣤⣶⣶⣤⣦⣦]
[ ⣦⣶⣷⣶⣤⣶⣶⣶⣶⣤⣶⣶⣶⣦⣤⣶⣶⣶⣷⣷⣦⣦⣶⣶⣦⣤⣦⣶⣶⣦⣄⣦⣦⣶⣦⣄⣷⣦⣷⣷⣦⣦⣶⣦⣦⣄⣶⣶⣦⡀⣄⣦⣦⣤⣤⣤⣤⣄ ⣄⣤⣤⣤⣦⣦⣶⣦ ⣄⣄⣤⣤⣶⣶⣄⣶⣦]


julia> demux(ss, 1,2, 1:2, [1,1,1,2])
(Signals.Signal{1,FixedPointNumbers.Fixed{Int32,31},44.1 kHz}  168002 fr (3.81 s)
[ ⣷⣶⣦⣶⣷⣦⣶⣦⣦⣶⣦⣶ ⣦⣄⣤⣤⣤⣤⣦⣄⡀ ⡀⣷⣷⣦⣶⣤⣶⣦⣦⣤⣀⣄⡀⣀⡀⣤⣶⣶⣶⣶⣷⣤⣶⣀⣦⣷⣤⣦⣤⣤⣄⣄⣦⣤⣷⣤⣄⡀⡀⣤⣷⣶⣶⣶⣦⣶⣄⣦⣄⣄⣄⣀⣀ ]
, Signals.Signal{1,FixedPointNumbers.Fixed{Int32,31},44.1 kHz}  168002 fr (3.81 s)
[ ⣷⣶⣦⣶⣷⣤⣶⣦⣦⣶⣤⣶⣀⣦⣤⣤⣤⣄⣤⣦⣄⣄⡀ ⣶⣶⣦⣶⣤⣶⣤⣦⣤⣄⣤ ⣄⣀⣤⣶⣦⣶⣦⣶⣦⣶⡀⣦⣷⣶⣦⣤⣦⣀⣄⣤⣤⣷⣦⣄ ⡀⣤⣶⣶⣶⣶⣦⣦⣄⣦⣄⣤⣄⣀⣄ ]
, Signals.Signal{2,FixedPointNumbers.Fixed{Int32,31},44.1 kHz}  168002 fr (3.81 s)
[ ⣷⣶⣦⣶⣷⣦⣶⣦⣦⣶⣦⣶ ⣦⣄⣤⣤⣤⣤⣦⣄⡀ ⡀⣷⣷⣦⣶⣤⣶⣦⣦⣤⣀⣄⡀⣀⡀⣤⣶⣶⣶⣶⣷⣤⣶⣀⣦⣷⣤⣦⣤⣤⣄⣄⣦⣤⣷⣤⣄⡀⡀⣤⣷⣶⣶⣶⣦⣶⣄⣦⣄⣄⣄⣀⣀ ]
[ ⣷⣶⣦⣶⣷⣤⣶⣦⣦⣶⣤⣶⣀⣦⣤⣤⣤⣄⣤⣦⣄⣄⡀ ⣶⣶⣦⣶⣤⣶⣤⣦⣤⣄⣤ ⣄⣀⣤⣶⣦⣶⣦⣶⣦⣶⡀⣦⣷⣶⣦⣤⣦⣀⣄⣤⣤⣷⣦⣄ ⡀⣤⣶⣶⣶⣶⣦⣦⣄⣦⣄⣤⣄⣀⣄ ]
, Signals.Signal{4,FixedPointNumbers.Fixed{Int32,31},44.1 kHz}  168002 fr (3.81 s)
[ ⣷⣶⣦⣶⣷⣦⣶⣦⣦⣶⣦⣶ ⣦⣄⣤⣤⣤⣤⣦⣄⡀ ⡀⣷⣷⣦⣶⣤⣶⣦⣦⣤⣀⣄⡀⣀⡀⣤⣶⣶⣶⣶⣷⣤⣶⣀⣦⣷⣤⣦⣤⣤⣄⣄⣦⣤⣷⣤⣄⡀⡀⣤⣷⣶⣶⣶⣦⣶⣄⣦⣄⣄⣄⣀⣀ ]
[ ⣷⣶⣦⣶⣷⣦⣶⣦⣦⣶⣦⣶ ⣦⣄⣤⣤⣤⣤⣦⣄⡀ ⡀⣷⣷⣦⣶⣤⣶⣦⣦⣤⣀⣄⡀⣀⡀⣤⣶⣶⣶⣶⣷⣤⣶⣀⣦⣷⣤⣦⣤⣤⣄⣄⣦⣤⣷⣤⣄⡀⡀⣤⣷⣶⣶⣶⣦⣶⣄⣦⣄⣄⣄⣀⣀ ]
[ ⣷⣶⣦⣶⣷⣦⣶⣦⣦⣶⣦⣶ ⣦⣄⣤⣤⣤⣤⣦⣄⡀ ⡀⣷⣷⣦⣶⣤⣶⣦⣦⣤⣀⣄⡀⣀⡀⣤⣶⣶⣶⣶⣷⣤⣶⣀⣦⣷⣤⣦⣤⣤⣄⣄⣦⣤⣷⣤⣄⡀⡀⣤⣷⣶⣶⣶⣦⣶⣄⣦⣄⣄⣄⣀⣀ ]
[ ⣷⣶⣦⣶⣷⣤⣶⣦⣦⣶⣤⣶⣀⣦⣤⣤⣤⣄⣤⣦⣄⣄⡀ ⣶⣶⣦⣶⣤⣶⣤⣦⣤⣄⣤ ⣄⣀⣤⣶⣦⣶⣦⣶⣦⣶⡀⣦⣷⣶⣦⣤⣦⣀⣄⣤⣤⣷⣦⣄ ⡀⣤⣶⣶⣶⣶⣦⣦⣄⣦⣄⣤⣄⣀⣄ ]
)

julia> window(ss, 200ms, 1s)
Base.Generator{UnitRange{Int64},Signals.##20#21{Signals.Signal{2,FixedPointNumbers.Fixed{Int32,31},44.1 kHz},Int64,Int64}}(Signals.#20, 1:15)

julia> (window(ss, 200ms, 1s) |> collect)[1:5]
5-element Array{Signals.SubSignal{2,FixedPointNumbers.Fixed{Int32,31},44.1 kHz},1}:
 Signals.SubSignal{2,FixedPointNumbers.Fixed{Int32,31},44.1 kHz} 44101 fr (1.00 s)
(0.00 s)                                                                (1.00 s)
[ ⣶⣶⣷⣶⣦⣶⣶⣷⣶⣦⣶⣶⣶⣦⣤⣶⣶⣶⣷⣷⣶⣶⣶⣶⣶⣤⣦⣶⣶⣶⣄⣦⣦⣶⣦⣄⣷⣦⣷⣷⣶⣶⣶⣦⣦⣦⣶⣶⣦⣄⣤⣦⣦⣄⣤⣤⣤⣄⣄⣤⣤⣤⣤⣦⣶⣦⣦⣤⣤⣤⣤⣤⣶⣶⣤⣦⣦]
[ ⣦⣶⣷⣶⣤⣶⣶⣶⣶⣤⣶⣶⣶⣦⣤⣶⣶⣶⣷⣷⣦⣦⣶⣶⣦⣤⣦⣶⣶⣦⣄⣦⣦⣶⣦⣄⣷⣦⣷⣷⣦⣦⣶⣦⣦⣄⣶⣶⣦⡀⣄⣦⣦⣤⣤⣤⣤⣄ ⣄⣤⣤⣤⣦⣦⣶⣦ ⣄⣄⣤⣤⣶⣶⣄⣶⣦]

 Signals.SubSignal{2,FixedPointNumbers.Fixed{Int32,31},44.1 kHz} 44101 fr (1.00 s)
(200.02 ms)                                                             (1.20 s)
[⣦⣦⣶⣶⣷⣶⣦⣤⣶⣶⣶⣦⣤⣶⣶⣶⣦⣤⣦⣶⣦⣦⣷⣷⣷⡀⣷⣶⣦⣤⣦⣦⣦⣶⣦⣄⣤⣦⣦⣤⣄⣤⣤⣤⣀⣄⣤⣄⣤⣤⣦⣦⣦⣤⣄⣄⣤⣤⣤⣶⣦⣄⣤⣤⣤⣀⣄⣄ ⣄⣄⡀⣀⣄⡀  ⣶]
[⣦⣦⣶⣦⣷⣶⣶⣦⣶⣶⣶⣦⣄⣶⣶⣶⣤⣤⣦⣶⣦⣦⣷⣷⣷⣶⣶⣶⣶⣦⣦⣤⣶⣦⣦⣄⣀⣦⣦⣤ ⣤⣤⣤⣄⣀⣤⣀⣤⣄⣤⣦⣦⡀⡀⣀⣤⣤⣤⣶⣦⣦⣦⣦⣤⣄⣀⣄⣄⣄⣀⡀ ⡀ ⡀ ⣶]

 Signals.SubSignal{2,FixedPointNumbers.Fixed{Int32,31},44.1 kHz} 44101 fr (1.00 s)
(400.05 ms)                                                             (1.40 s)
[⣶⣦⣤⣦⣦⣦⣶⣶⣷⣦⣶⣶⣦⣄⣦⣤⣄⣶⣦⣦⣤⣤⣤⣦⣤⣤⣤⣤⣤⣄⣀⣤⣄⣦⣤ ⣦⣦⣄⣄⣄⣤⣤⣤⣶⣦⣦⣦⣄⣤⣄⣤⣄⡀⣀⣄⡀⣄⣄⡀ ⣷⣷⣦⣷⣷⣷⣄⣶⣷⣷⣶⣤⣶⣶⣶⣶⣤]
[⣶⣦⣤⣦⣦⣦⣶⣶⣷⣤⣤⣶⣶⣦⣶⣤⣄⣦⣦⣦⣦⣀⣤⣦⣤⣤⣀⣤⣤⣤⣀⣄⣤⣦⣄⣤⣤⣦⣤⣄⣀⣄⣤⣤⣶⣦⣄⣦ ⣤⣤⣤⣄⣄⣀⣀⡀⡀⣀  ⣷⣷⣦⣷⣶⣶⣦⣦⣶⣷⣶⣄⣶⣶⣶⣦⣦]

 Signals.SubSignal{2,FixedPointNumbers.Fixed{Int32,31},44.1 kHz} 44101 fr (1.00 s)
(600.07 ms)                                                             (1.60 s)
[⣤⣦⣦⣤⣦⣤⡀⣄⣦⣤⣦⣀⣤⣤⣤⣀⣄⣄⣦⣦⣤⣤⣦⣄⡀⣀⣤⣷⣶⣤⣶⣦⣤⣀⣤⣀⣤⣀ ⣀⣀⡀⣀⣀ ⡀⣶⣶⣶⣶⣶⣷⣶⣦⣷⣷⣶⣦⣦⣶⣶⣶⣦⣦⣶⣶⣶⣄⣦⣶⣶⣦⣀⣦⣦⣦⣤⣄]
[⣤⣦⣤⣤⣦⣦⣄⣄⣦⣦⣦⣄⣤⣤⣤⣄⡀⣀⣤⣦⣤⣤⣤⣄⣄⣄⣄⣷⣶⣤⣶⣦⣤⣄⣤⣄⣤⣄⣀⣀⣀⡀ ⡀ ⡀⣶⣶⣶⣶⣶⣶⣦⣦⣶⣷⣶⣤⣶⣶⣶⣶⣀⣦⣶⣶⣦⣄⣦⣶⣦⣤⣤⣦⣦⣦⣀⣤]

 Signals.SubSignal{2,FixedPointNumbers.Fixed{Int32,31},44.1 kHz} 44101 fr (1.00 s)
(800.09 ms)                                                             (1.80 s)
[⣄⣶⣤⣦⣦⣤⣤⣤⣄⣤⣄⣄⣤⣤⣦⣦⡀⣤⡀⣤⡀⣄⣀⣄ ⣀     ⣷⣷⣶⣷⣷⣷⣶⣦⣶⣷⣷⣶⣀⣶⣶⣶⣶⣄⣶⣶⣶⣦⣤⣶⣶⣦⣤⣤⣦⣦⣦⣀⣤⣦⣤⣤⣀⣤⣤⣄⣀⣀⣄⣄⣀ ⣀]
[⣤⣶⣀⣦⣦⣦⣀⣤⣄⣤⣤⡀⣤⣤⣦⣶⣦⣀⣄⣄⣄⣄⣀⣀⡀⣀ ⡀⡀  ⣷⣷⣶⣷⣶⣶⣶⣤⣦⣷⣶⣦⣦⣶⣶⣶⣦⣤⣶⣶⣦⣤⣦⣶⣶⣦⣀⣦⣦⣦⣤⣄⣦⣦⣤⣄⣄⣤⣤⣤⣀⣄⣤⣄⣄ ⣀]


julia> generate_sine(20s, 1Hz)
Signals.Signal{1,Float32,44.1 kHz}                           882001 fr (20.00 s)
[ ⣷⣦⣷⣶⣷⣶⣷⣷⣷⣷⣷⣷⣷⣷⣷⣷⣷⣷⣶⣷⣶⣷⣦⣷⣤⣷⣦⣷⣶⣷⣶⣷⣷⣷⣷⣷⣷⣷⣷⣷⣷⣷⣷⣷⣷⣶⣷⣶⣷⣦⣷⣤⣷⣦⣷⣶⣷⣶⣷⣷⣷⣷⣷⣷⣷⣷⣷⣷⣷⣷⣶⣷⣶⣷⣦⣷ ]

signals.jl's People

Contributors

zaccranko avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.