Skip to content

Commit

Permalink
Merge pull request #21 from quartiq/hbf
Browse files Browse the repository at this point in the history
hbf
  • Loading branch information
jordens authored Sep 15, 2023
2 parents e244de8 + c4618b6 commit 0e9a2bf
Show file tree
Hide file tree
Showing 6 changed files with 649 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Added

* `hbf` FIRs, symmetric FIRs, half band filters, HBF decimators and interpolators

## [0.10.0](https://github.com/quartiq/idsp/compare/v0.9.2..v0.10.0) - 2023-07-20

### Changed
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "idsp"
version = "0.10.0"
resolver = "2"
edition = "2018"
edition = "2021"
authors = ["Robert Jördens <[email protected]>"]
license = "MIT OR Apache-2.0"
description = "DSP algorithms for embedded, mostly integer math"
Expand All @@ -19,6 +19,7 @@ num-traits = { version = "0.2.14", features = ["libm"], default-features = false
easybench = "1.0"
rand = "0.8"
ndarray = "0.15"
rustfft = "6.1.0"

[[bench]]
name = "micro"
Expand Down
16 changes: 8 additions & 8 deletions benches/micro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use core::f32::consts::PI;

use easybench::bench_env;

use idsp::{atan2, cossin, iir, iir_int, Lowpass, PLL, RPLL};
use idsp::{atan2, cossin, iir, iir_int, Filter, Lowpass, PLL, RPLL};

fn atan2_bench() {
let xi = (10 << 16) as i32;
Expand Down Expand Up @@ -44,11 +44,11 @@ fn pll_bench() {
let mut dut = PLL::default();
println!(
"PLL::update(Some(t), 12, 12): {}",
bench_env(Some(0x241), |x| dut.update(*x, 12, 12))
bench_env(Some(0x241), |x| dut.update(*x, 12))
);
println!(
"PLL::update(Some(t), sf, sp): {}",
bench_env((Some(0x241), 21, 20), |(x, p, q)| dut.update(*x, *p, *q))
bench_env((Some(0x241), 21), |(x, p)| dut.update(*x, *p))
);
}

Expand Down Expand Up @@ -80,14 +80,14 @@ fn iir_f64_bench() {
}

fn lowpass_bench() {
let mut dut = Lowpass::<4>::default();
let mut dut = Lowpass::<1>::default();
println!(
"Lowpass::<4>::update(x, k): {}",
bench_env((0x32421, 14), |(x, k)| dut.update(*x, *k))
"Lowpass::<1>::update(x, k): {}",
bench_env((0x32421, 14), |(x, k)| dut.update(*x, &[*k]))
);
println!(
"Lowpass::<4>::update(x, 14): {}",
bench_env(0x32421, |x| dut.update(*x, 14))
"Lowpass::<1>::update(x, 14): {}",
bench_env(0x32421, |x| dut.update(*x, &[14]))
);
}

Expand Down
Loading

0 comments on commit 0e9a2bf

Please sign in to comment.