Fluora's weird custom DSP toolbox.
Go to file
Fluora 4b44b54250 add LICENSE 2021-06-15 13:33:59 -05:00
src initial commit! going to pretend it's presentable 2021-06-15 13:11:13 -05:00
.gitignore initial commit! going to pretend it's presentable 2021-06-15 13:11:13 -05:00
LICENSE add LICENSE 2021-06-15 13:33:59 -05:00
README.md add LICENSE 2021-06-15 13:33:59 -05:00
build.sh fix build script 2021-06-15 13:21:44 -05:00

README.md

Fluora's Miscellaneous Digital Signal Toolbox

Fluora - 2019 onwards - CC0


What's this?

I've made (and continue to keep making) a bunch of little Rust programs for debugging DSP projects and simulating potential techniques. They all have a few things in common:

  • They're really bad and have no real error handling.
  • They operate exclusively on 32-bit big-endian floating-point samples, and don't expect to find headers.
  • They do about one thing each, usually by reading a file and writing to another, but sometimes by writing back to the same file.
  • They're very inefficient code, and only intended to be run on small files.
  • They have very little documentation and I'm really sorry.
  • None of them depend on anything. There are no crates here.

What should I use these for?

You shouldn't use it at all. If you want to anyway, I can't stop you, but you should probably find a saner DSP toolbox if you want to actually get work done.

How do I compile them all at once?

You can run the build.sh script I included, which will try to compile everything in ./src/ that ends in ".rs", and put all the resulting binaries in ./target/.

Why Rust?

I like Rust.

What do they do?

Here's the fast version, covering everything included so far:

  • addmix adds two signals, producing a combined output.
  • mulmix multiplies two signals (like an RF mixer or ring modulator), generating harmonics at the sum and difference of frequencies.
  • bomp is a plotter that generates simple images of signals that you can look at.
  • termplot is another, worse plotter, which does something similar using rows of block characters in the terminal.
  • correlate takes the correlation of two signals (multiply-sum for all possible time offsets).
  • correlate_cyclic does the same, but makes the signals periodic.
  • fsinechirp generates chirps (rising or falling tones) with linear change in frequency.
  • tsinechirp generates chirps with linear change in period.
  • squarechirp generates chirps using square waves.
  • normalize multiplies signals by a constant value such that the maximum value becomes 1.
  • rectify takes the absolute value of a signal, flipping negative values into positive values.
  • peakdetect zeroes out all samples that are not local maxima.
  • splitbits extracts the sign from samples, producing an output whose values are only 1 or -1.
  • upsample increases the sample rate of a signal by an integer factor with linear interpolation.
  • gfilter applies a gaussian low-pass filter.
  • sfilter applies a sinc low-pass filter.
  • swindow applies a sinc low-pass and high-pass filter, forming a rectangular bandpass filter.
  • worsen adds a variable amount of random noise to a signal.
  • skew simulates mismatches in sampling frequency and phase.
  • sft is a naĩve, slow (O(n²)) implementation of a discrete Fourier transform. It's like an FFT, but instead of fast, it's slow.
  • waterfall generates 2D frequency/time spectrum images with repeated Fourier transforms.
  • zadoffchu generates Zadoff-Chu sequences, which are low-autocorrelation functions used in telecom.
  • unitvex generates a sequence of complex unit vectors, using input data to set their angles.
  • vecsum takes two signals and combines them with the Pythagorean theorem, e.g. to produce a power spectrum from a complex DFT.
  • dcst simultaneously takes the discrete cosine transform (DCT) and discrete sine transform (DST) of a signal.
  • pad adds arbitrary amounts of silence before and after a signal.
  • integrate takes the integral of a signal.
  • differentiate takes the derivative of a signal.
  • orthosine generates orthogonal waveforms on an interval, i.e. OFDM carriers.
  • echospace simulates reflections in a 3D volume.