diff --git a/.travis.yml b/.travis.yml index a9b54be..6ede6be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,3 +13,5 @@ script: - cargo check --target thumbv7em-none-eabihf --no-default-features --features "microfft-complex" - cargo check --target thumbv7em-none-eabihf --no-default-features --features "microfft-real" + # examples + - cargo run --release --example mp3-samples diff --git a/CHANGELOG.md b/CHANGELOG.md index f17d192..9f3d5d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## v0.4.0 +- MSRV is now Rust 1.51 (sorry but that's the only way I can make it `no_std`-compatible) +- This crate is now really `no_std` +- you can choose between three FFT implementations at compile time via Cargo features. + The new default feature is `rustfft-complex` (which is still `std`) but there are also + the two new `no_std`-compatible targets `microfft-complex` (more accurate, like rustfft) + and `microfft-real` (faster, less accurate) +- several small improvements and fixes, see: https://github.com/phip1611/spectrum-analyzer/milestone/3?closed=1 + ## v0.3.0 - `FrequencySpectrum::min()` and `FrequencySpectrum::max()` now return tuples/pairs (issue #6) diff --git a/Cargo.toml b/Cargo.toml index 656eb91..959f661 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ description = """ A simple and fast `no_std` library to get the frequency spectrum of a digital signal (e.g. audio) using FFT. It follows the KISS principle and consists of simple building blocks/optional features. """ -version = "0.3.0" +version = "0.4.0" authors = ["Philipp Schuster "] edition = "2018" keywords = ["fft", "spectrum", "frequencies", "audio", "dsp"] diff --git a/EDUCATIONAL.md b/EDUCATIONAL.md new file mode 100644 index 0000000..e247a73 --- /dev/null +++ b/EDUCATIONAL.md @@ -0,0 +1,23 @@ +## How to use FFT to get a frequency spectrum? + +This library is full of additional and useful links and comments about how an FFT result +can be used to get a frequency spectrum. In this document I want to give a short introduction +where inside the code you can find specific things. + +**TL;DR:** Although this crate has 1400 lines of code, **the part which gets the frequency and +their values from the FFT is small and simple**. Most of the code is related to my convenient +abstraction over the FFT result including several getters, transform/scaling functions, and +tests. + +**I don't explain how FFT works but how you use the result!** +If you want to understand that too: + +- check out all links provided [at the end of README.md](/README.md) +- look into `lib.rs` (**probalby gives you 90 percent of the things you want to know**) + and the comments over the FFT abstraction in `src/fft/mod.rs` and + `src/fft/rustfft-complex/mod.rs`. + + +This is everything important you need. Everything inside + `spectrum.rs` and the other files is just convenient stuff + tests for when you +want to use this crate in your program. diff --git a/README.md b/README.md index cb5a087..8653f0c 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,9 @@ via Cargo features. **The MSRV (minimum supported Rust version) is 1.51 Stable because this crate needs the "resolver" feature of Cargo to cope with build problems occurring in `microfft`-crate.** +## I want to understand how FFT can be used to get a spectrum +Please see file [/EDUCATIONAL.md](/EDUCATIONAL.md). + ## How to use (including `no_std`-environments) Most tips and comments are located inside the code, so please check out the repository on Github! Anyway, the most basic usage looks like this: diff --git a/check-build.sh b/check-build.sh index 67fd36a..ecb2e1e 100644 --- a/check-build.sh +++ b/check-build.sh @@ -6,3 +6,7 @@ cargo test --all-targets rustup target add thumbv7em-none-eabihf cargo check --target thumbv7em-none-eabihf --no-default-features --features "microfft-complex" cargo check --target thumbv7em-none-eabihf --no-default-features --features "microfft-real" + + +# run examples +cargo run --release --example mp3-samples