Git Product home page Git Product logo

dsp.rs's Introduction

Digital Signal Processing

Rust Crates.io Crates.io docs.rs

This library is focused in working with block of data not on real time processing.

If you are looking for a realtime processing library then there is already great library for it https://github.com/FutureSDR/FutureSDR

The folder examples contains demo programs which shows how to use this library.

Features

Signal generators

Signals generators are nodes with the state. This allows to generate continuos signal across multiple buffers. Implemented generators:

  • Impulse
  • Step
  • Sinusoid
  • Triangle
  • Square
  • Chirp
  • Noise

Filters

  • Biquad
  • Leaky Integrator (Exponential Smoothing)

Window functions

  • Rectangular
  • Triangular
  • Welch
  • Sine
  • Hann
  • Hamming
  • Blackman

Frequency domain

  • FFT forward and inverse using RustFFT crate.
  • Find peak frequency

Time domain

  • Frequency shifter
  • FM demodulation

License

Licensed under Apache License, Version 2.0

Contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

dsp.rs's People

Contributors

klangner avatar markubiak avatar mh84 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dsp.rs's Issues

Add signal summator

With the possibility to scale each signal.
Maybe as a starting point create universal node which will take any closure as a summary definition?

Reexport num_complex

As far as I can tell, the num-complex crate is not re-exported by dsp. This means that working with complex numbers directly requires tracking dsp's version manually in Cargo.toml.

I would suggest putting pub use num_complex in lib.rs and having the other modules pull it from there.

Add resampling function

To change the sample rate of the signal.
Resampling should require that both signals have the same sample_rate. Otherwise return 0 (Not correlated).

Add FileSource

Load binary data from a file. The format should be compatible with GNURadio

Add vector generator

Generate data from vector.
We can then generate data longer then vector by repeating data from vector

Source node should return information if it has finished reading all data

Some source can have infinite number of samples, same like files are finite.
It would be good to know when all data was read and there are no more samples.
This can be fixed with SourceNode::write_buffer Returning boolean value indicating if source finished generating its data (wrapped as result)

Make dependency on `rand` optional

I noticed that when adding the dsp crate and running cargo build, I got a large number of crates to build. It appears to be primarily transitive dependencies of the rand crate, which is a required dependency in dsp.rs. It is only used in generator.rs.

Is it possible to move the rand dependency to a feature (which may be on by default), so I can turn the feature off and reduce build times?

Notes on features:

https://doc.rust-lang.org/cargo/reference/features.html
https://doc.rust-lang.org/reference/conditional-compilation.html

Add SIMD for node processing

Nodes operate on the frames (buffers). This means that they are good for SIMD optimisation.

Also add benchmarks to measure the speed gain.

Throttle generators

Generators are able to generate data faster then required. For example when the sample rate is set to 512 we should only generate 512 samples per second. This should be optional

Using a linear algebra library

What do you think of relying on an external linear algebra crate for the Vector representations and operations?
In this way, we could benefit from performance optimizations applied to the external crate.
Moreover, I think at a certain point we could face the need for Matrices (I am thinking, for example, to the implementation of the STFT) that for sure would be provided by the library.

Write TCPSource

Read binary data from the socket. The format should be compatible with GNURadio

Create better spectrogram plot

Spectrum is 3D data. And most often is plot with coloraturas as 3rd dimension.
There is example spectrum.rs which only plots line with max frequency. It would be nice to improve the graph used by this example to use colors instead of line.

count zero crossing

Add node to calculate zero crossing in the signal. Remember to calculate it over different buffers

Fix chirp generator

From the spectrogram it looks that there is a problem with the Chirp generator. The end frequency is too high.

Add documentation for Graph and Nodes

The library is designed for creating graph of nodes for frame processing (real-time like).
But it needs better documentation in README.md and rust doc.

Add FileSink

Save binary data into a file. The format should be compatible with GNURadio

Add FFT filter

  • Convert signal into frequency domain
  • Remove given frequencies (make them 0)
  • Convert back to time domain

Add TCPSink

Write binary data into a socket. The format should be compatible with GNURadio

Create multi generator

This generator should be based on defined number of sinusoidal signals.
Ideally it should get list of sine frequencies and list of weights.

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.