GithubHelp home page GithubHelp logo

juliatelecom / adalmpluto.jl Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 5.01 MB

Julia Bindings of IIO to monitor ADALM-Pluto SDR from Analog Devices

License: MIT License

Julia 100.00%
julia sdr iio-devices

adalmpluto.jl's Introduction

PlutoSDR

Documentation

The documentation is available on the Github Pages.

Basic usage

Using the radio through USB.

using AdalmPluto;

# Opening the radio with 100MHz carrier frequency, 3MHz sampling rate, and 64dB gain.
radio = openPluto(Int(100e6), Int(3e6), 64; bandwidth=Int(20e6));

# Receive the samples
sig = zeros(ComplexF32, 1024*1024) # 1 MiS buffer
recv!(sig, radio);

# Do some treatment
# ...
# ...

# Close the radio
close(radio);

Running the examples

FM Radio

This example records a few seconds of FM radio as WAV to .../AdalmPluto.jl/examples/samples/fm.wav. The duration and station selection have to be modified by editing .../AdalmPluto.jl/examples/fm.jl.

To launch the example (from the root folder of the project) : julia --startup-file=no --project=./examples ./examples/fm.jl.

Benchmark

The actual sampling rate has been measured using the file benchmark.jl. The full results of the last run is available in bench_results.txt.

The functions timed are :

  • C_iio_buffer_refill alone, which queries samples from the hardware.
  • C_iio_buffer_refill and two C_iio_channel_read for the IQ channels. The read function demultiplexes and converts to host format the data.
  • AdalmPluto.refillJuliaBufferRX which is the same thing as before with reinterpret added to convert the samples to ComplexF32.
  • recv! which calls the previous function and reads from the Julia buffer into the target array.

With julia lauched from the example folder :

julia> include("benchmark.jl");
julia> plot, results = bench_all();
julia> plot # to display a (very) basic unicode plot

This takes quite a while as each results are timed separately and the radio saturates quite quickly.

results

Artifact

The artifact used for the proof of concept is hosted here.

It has been compiled using the following options :

git clone https://github.com/analogdevicesinc/libiio.git
cd libiio
mkdir build
cd build
cmake ../ -DCMAKE_BUILD_TYPE=Release -DWITH_LOCAL_CONFIG=OFF -DINSTALL_UDEV_RULE=OFF -DWITH_USB_BACKEND=YES -DWITH_NETWORK_BACKEND=YES -DWITH_LOCAL_BACKEND=YES -DWITH_XML_BACKEND=YES -DWITH_SERIAL_BACKEND=NO -DWITH_EXAMPLES=YES
make -j$(nproc)
tar cvzf libiio-0.21-custom.tar.gz libiio.so* tests/iio_* iiod/iiod .version

In order to work properly, the artifact needs a udev rule to access the USB peripherals. It is written in a volatile folder, hence the need the input the sudo password after each reboot. The password prompt does not come from Julia and no information about the password goes through julia. See the __init__ in .../AdalmPluto.jl/src/libIIO/libIIO.jl for more details.

adalmpluto.jl's People

Contributors

doune00 avatar rgerzaguet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

adalmpluto.jl's Issues

Precompilation silently fail with Julia 1.6

When using a projet with AdalmPluto (or AbstractSDRs) the command instantiate runs in a deadlock.

This is due to __init__() that try creates the dev rules. It requires root password that is asked to the user. In Julia 1.6 the instantiation does not support such interaction (or not as we think it would be). For the moment the workaround is to interrupt the instantiation and do a using AdalmPluto in the project.

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Improve open with backend auto-discovering

In current version of AdalmPluto, opening a device without specifying the backend and the URI assumes the SDR can be found by USB.
We should improve the internal scan function to allow to find a Pluto in local, USB or IP context. If backend (or address is specified by the user) functioning should remain the same.

Linked to how we want to update scan in AbstractSDRs (JuliaTelecom/AbstractSDRs.jl#10).
In AdalmPluto, scan requires a backend, so we probably update openPluto and add a auto-discover part

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.