1665294120
LTspice.jl provides a julia interface to LTspiceTM. Several interfaces are provided.
LTspice.jl is currently unregistered. It can be installed using Pkg.clone
.
Pkg.clone("https://github.com/cstook/LTspice.jl.git")
The julia documentation section on installing unregistered packages provides more information.
LTspice.jl is compatible with julia 1.0
Import the module.
using LTspice
Create an instance of LTspiceSimulation.
example1 = LTspiceSimulation("example1.asc",tempdir=true)
Access parameters and measurements using their name as the key.
Set a parameter to a new value.
example1["Rload"] = 20.0 # set parameter Rload to 20.0
Read the resulting measurement.
loadpower = example1["Pload"] # run simulation, return Pload
Circuit can be called like a function
loadpower = example1(100.0) # pass Rload, return Pload
Use Optim.jl to perform an optimization on a LTspice simulation
using Optim
result = optimize(rload -> -example1(rload)[1],10.0,100.0)
rload_for_maximum_power = example1["Rload"]
LTspice.jl works on windows and linux with LTspice under wine. Osx is not supported.
Author: cstook
Source Code: https://github.com/cstook/LTspice.jl
License: View license
1665294120
LTspice.jl provides a julia interface to LTspiceTM. Several interfaces are provided.
LTspice.jl is currently unregistered. It can be installed using Pkg.clone
.
Pkg.clone("https://github.com/cstook/LTspice.jl.git")
The julia documentation section on installing unregistered packages provides more information.
LTspice.jl is compatible with julia 1.0
Import the module.
using LTspice
Create an instance of LTspiceSimulation.
example1 = LTspiceSimulation("example1.asc",tempdir=true)
Access parameters and measurements using their name as the key.
Set a parameter to a new value.
example1["Rload"] = 20.0 # set parameter Rload to 20.0
Read the resulting measurement.
loadpower = example1["Pload"] # run simulation, return Pload
Circuit can be called like a function
loadpower = example1(100.0) # pass Rload, return Pload
Use Optim.jl to perform an optimization on a LTspice simulation
using Optim
result = optimize(rload -> -example1(rload)[1],10.0,100.0)
rload_for_maximum_power = example1["Rload"]
LTspice.jl works on windows and linux with LTspice under wine. Osx is not supported.
Author: cstook
Source Code: https://github.com/cstook/LTspice.jl
License: View license
1665258000
LibSndFile.jl is a wrapper for libsndfile, and supports a wide variety of file and sample formats. The package uses the FileIO load
and save
interface to automatically figure out the file type of the file to be opened, and the file contents are represented as a SampleBuf
. For streaming I/O we support FileIO's loadstreaming
and savestreaming
functions as well. The results are represented as SampleSource
(for reading), or SampleSink
(for writing) subtypes. These buffer and stream types are defined in the SampledSignals package.
Note that the load
/save
/etc. interface is exported from FileIO
, and LibSndFile
registers itself when the loaded, so you should bring in both packages. LibSndFile doesn't export any of its own names.
julia> using FileIO: load, save, loadstreaming, savestreaming
julia> import LibSndFile
julia> load("audiofile.wav")
2938384-frame, 1-channel SampleBuf{FixedPointNumbers.Fixed{Int16,15}, 2}
66.63002267573697s sampled at 44100.0Hz
▆▅▆▆▆▆▆▅▆▆▆▇▇▇▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▇▆▆▆▆▆▇▆▇▆▇▆▆▆▅▆▆▆▆▆▆▅▆▆▅▆▅▆▆▇▇▇▇▆▆▆▆▆▆▇▆▆▆▆▆▆▆▇▆▇▂
Read ogg file, write first 1024 samples of the first channel to new wav file
x = load("myfile.ogg")
save("myfile_short.wav", x[1:1024])
Read file, write the first second of all channels to a new file
x = load("myfile.ogg")
save("myfile_short.wav", x[0s..1s, :])
Read stereo file, write mono mix
x = load("myfile.wav")
save("myfile_mono.wav", x[:, 1] + x[:, 2])
Plot the left channel
x = load("myfile.wav")
plot(x[:, 1]) # plots with samples on the x axis
plot(domain(x), x[:, 1]) # plots with time on the x axis
Plot the spectrum of the left channel
x = load("myfile.wav")
f = fft(x) # returns a FrequencySampleBuf
fmin = 0Hz
fmax = 10000Hz
fs = Float32[float(f_i) for f_i in domain(f[fmin..fmax])]
plot(fs, abs.(f[fmin..fmax]).data, xlim=(fs[1],fs[end]), ylim=(0,20000))
Load a long file as a stream and plot the left channel from 2s to 3s
stream = loadstreaming("myfile.ogg")
x = read(stream, 4s)[2s..3s, 1]
close(stream)
plot(domain(x), x)
To handle closing the file automatically (including in the case of unexpected exceptions), we support the do
block syntax
data = loadstreaming("data/never_gonna_give_you_up.ogg") do f
read(f)
end
See the libsndfile homepage for details, but in summary it supports reading and writing:
Note not all file formats support all samplerates and bit depths. Currently LibSndFile.jl supports WAV, Ogg Vorbis, and FLAC files. Please file an issue if support for other formats would be useful.
libopus
and allows you to read and write Opus audio.libsndfile is licensed under the LGPL, which is very permissive providing that libsndfile is dynamically linked. LibSndFile.jl is licensed under the MIT license, allowing you to statically compile the wrapper into your Julia application. Remember that you must still abide by the terms of the libsndfile license when using this wrapper, in terms of whether libsndfile is statically or dynamically linked.
Note that this is to the best of my understanding, but I am not an attorney and this should not be considered legal advice.
Author: JuliaAudio
Source Code: https://github.com/JuliaAudio/LibSndFile.jl
License: MIT license
1659641700
The Tables.jl package provides simple, yet powerful interface functions for working with all kinds tabular data.
Installation: at the Julia REPL, import Pkg; Pkg.add("Tables")
Maintenance: Tables is maintained collectively by the JuliaData collaborators. Responsiveness to pull requests and issues can vary, depending on the availability of key collaborators.
List of packages which support Tables.jl interface can be found in INTEGRATIONS.md.
Please refer to TableOperations.jl for common table operations (select
, filter
, transform
, map
, etc.)
Author: JuliaData
Source Code: https://github.com/JuliaData/Tables.jl
License: MIT license
1668181980
OCCA is a cross platform single-instruction-multiple-data (SIMD) threading library that is retargetable to multiple backends such as pthreads, openmp, opencl, and cuda. OCCA.jl is a Julia interface into OCCA. The main OCCA repository can be found here.
Installation and testing.
Pkg.add("OCCA");
#This takes a minute because no precompiled OCCA binaries exist.
#OCCA will build with no parallel backends by default because
#reliable backend detection is under development.
#To rebuild with e.g. opencl and cuda you would run
using OCCA;
OCCA.rebuildwith!(opencl=true,cuda=true);
#To run tests for all compiled backends, run:
Pkg.test("OCCA");
#If a backend is not compiled, that test will simply pass without doing anything.
#OCCA will default to serial mode if no backend is installed, so the tests
#still provide some information about correctness of the test kernels (ignoring
#parallel issues such as race conditions and deadlocks)
An example script.
kernel void addVectors(const int entries,
const float *a,
const float *b,
float *ab){
for(int group = 0; group < ((entries + 15) / 16); ++group; outer0){
for(int item = 0; item < 16; ++item; inner0){
const int N = (item + (16 * group));
if(N < entries)
ab[N] = a[N] + b[N];
}
}
}
advectors.jl
infostring = "mode = OpenMP , schedule = compact, chunk = 10";
entries = 5
device = OCCA.Device(infostring);
a = Float32[1 - i for i in 1:entries]
b = Float32[i for i in 1:entries]
ab = Array(Float32,(length(a),));
correctvals = [1.0 for i in 1:entries];
o_a = OCCA.malloc(device, a);
o_b = OCCA.malloc(device, b);
o_ab = OCCA.malloc(device, ab);
addvectors = OCCA.buildkernel(device,"addVectors.okl","addVectors")
OCCA.runkernel!(addvectors,entries,o_a,o_b,o_ab)
OCCA.memcpy!(ab, o_ab)
Known issues
-The build script does not work for Windows, this is under development. -If OCCA kernel file uses shared memory and you target OpenCL+CPU, it will crash. This appears to be an OpenCL problem and not an OCCA problem.
Contributing
Contributing code Fork this repository on Github, make desired changes, and submit pull request.
Helping with tests and builds It would be enormously helpful if issues could be opened with any build or test failures, along with the specs of the machines on which the builds or tests failed.
Editor Issues .OKL files have a nearly-C grammar, and so most syntax highlighting modules designed for vanilla C will also do a decent job highlighting .OKL files.
Author: ReidAtcheson
Source Code: https://github.com/ReidAtcheson/OCCA.jl
License: MIT license
1668257400
A Julia interface to ZeroMQ
ZMQ.jl is a Julia interface to ZeroMQ, The Intelligent Transport Layer.
The package can be installed with the Julia package manager. From the Julia REPL, type ]
to enter the Pkg REPL mode and run:
pkg> add ZMQ
Or, equivalently, via the Pkg
API:
julia> import Pkg; Pkg.add("ZMQ")
(This installs its own copy of the ZMQ libraries from the ZMQBuilder repository.)
If you are using Windows and get an error Provider PackageManager failed to satisfy dependency zmq
, you may need to restart Julia and run Pkg.build("ZMQ")
again. See issue 69 for more details.
Usage questions can be posted on the Julia Discourse forum under the zmq
tag, in the #zmq channel of the Julia Slack and/or in the JuliaDocs Gitter chat room.
Contributions are very welcome, as are feature requests and suggestions. Please open an issue if you encounter any problems. The contributing page has a few guidelines that should be followed when opening pull requests and contributing code.
Author: JuliaInterop
Source Code: https://github.com/JuliaInterop/ZMQ.jl
License: View license