Skip to content

Commit

Permalink
prepare v1.4 including README and doc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
phip1611 committed Mar 4, 2023
1 parent a1a3b45 commit 3a659f8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 16 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,15 @@ jobs:
- name: Install required Linux packages for "audio-visualizer"/cpal/minifb
run: sudo apt update && sudo apt -y install libasound2-dev libxkbcommon-dev

# build with all features/fft implementations
- run: cargo build --all-targets

# run tests with all features/fft implementations
- run: cargo test --all-targets

# run benchmark: right now, there is no reporting or so from the results
- run: cargo bench

# test `no_std`-build with all features/fft implementations
- run: rustup target add thumbv7em-none-eabihf
- run: cargo build --target thumbv7em-none-eabihf

# run examples with all features/fft implementations
- run: cargo run --release --example mp3-samples

style_checks:
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# 1.4.0 (2023-03-04)
- dropped all optional FFT features (`microfft-complex`, `microfft-real`,
`rustfft-complex`) and made `microfft::real` the default FFT implementation.
This is breaking but only for a small percentage of users.
This is breaking but only for a small percentage of users. There was no
benefit from that feature and `microfft::real`, the default, was already the
fastest for no_std as well as std targets.
- dependency updates

## 1.3.0 (2023-03-04)
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description = """
An easy to use and fast `no_std` library (with `alloc`) to get the frequency
spectrum of a digital signal (e.g. audio) using FFT.
"""
version = "1.3.0"
version = "1.4.0"
authors = ["Philipp Schuster <phip1611@gmail.com>"]
edition = "2021"
keywords = ["fft", "spectrum", "frequencies", "audio", "dsp"]
Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,10 @@ The **MSRV** (minimum supported Rust version) is `1.61.0`.
## 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)
## How to use (including `no_std`-contexts)
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:

### FFT implementation as compile time configuration via Cargo features
By default, this crate uses the `real`-module from the great `microfft`-crate.
It's the fastest implementation and as of version `v0.5.0` there should be no
valid reason why you should ever change this. The multiple features are there
mainly for educational reasons and to support me during programming/testing.

### Cargo.toml
```toml
Expand Down Expand Up @@ -59,7 +54,8 @@ fn main() {
*Measurements taken on i7-1165G7 @ 2.80GHz (Single-threaded) with optimized build*

I've tested multiple FFT implementations. Below you can find out why I decided
to use `microfft`.
to use `microfft::real`. It is not only the fastest, but also works in `no_std`
contexts.

| Operation | Time |
|---------------------------------------------------------| ------:|
Expand Down
3 changes: 1 addition & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ pub enum SpectrumAnalyzerError {
InfinityValuesNotSupported,
/// See [`crate::limit::FrequencyLimitError`].
InvalidFrequencyLimit(FrequencyLimitError),
/// The number of samples must be a power of two in order for the FFT
/// to be fast and, depending on the used FFT implementation, to work at all.
/// The number of samples must be a power of two in order for the FFT.
SamplesLengthNotAPowerOfTwo,
/// After applying the scaling function on a specific item, the returned value is either
/// infinity or NaN, according to IEEE-754. This is invalid. Check
Expand Down

0 comments on commit 3a659f8

Please sign in to comment.