Skip to content

Add configurable time weighting initial state#49

Merged
jmrplens merged 7 commits into
mainfrom
feature/time-weighting-initial-state
May 9, 2026
Merged

Add configurable time weighting initial state#49
jmrplens merged 7 commits into
mainfrom
feature/time-weighting-initial-state

Conversation

@jmrplens
Copy link
Copy Markdown
Owner

@jmrplens jmrplens commented May 9, 2026

Adds optional initial-state control to time_weighting and prepares the package for the next tagged release.

Summary:

  • Add initial_state support for FAST/SLOW and impulse time weighting while preserving the existing zero-state default.
  • Document the new time-weighting behavior in the README.
  • Centralize package version in src/pyoctaveband/_version.py and bump it to 1.2.2.
  • Change the release workflow to publish from v* tags instead of pushes to main, validating that the tag matches the package version.
  • Move the former test_coverage_fix.py cases into semantic test modules.

Validation:

  • python -m build --outdir <tmpdir>
  • python -m twine check <tmpdir>/*
  • python -m pytest tests/ (117 passed, one existing detrending warning)
  • python -m ruff check .
  • python -m mypy src
  • actionlint .github/workflows/release.yml
  • git diff --check

Refs #38

Summary by Sourcery

Add configurable initial state handling for time weighting, centralize and expose the package version, and adjust release and tests to support the new behavior and coverage.

New Features:

  • Allow specifying an initial_state for fast, slow, and impulse time_weighting to support non-zero and block-continuous operation.

Bug Fixes:

  • Ensure weighting_filter and time_weighting handle multichannel inputs and Z-weighting bypass with validated constructor arguments.
  • Validate invalid configuration inputs such as unsupported time_weighting initial_state names, calculate_level modes, and normalized frequency fractions.

Enhancements:

  • Document the new time_weighting initial_state behavior and initial conditions in the README.
  • Expose version at the package root and derive the project version dynamically from a dedicated _version module.
  • Extend tests to cover weighting filter shapes and class usage, frequency utilities, octave filter bank behavior, filter design helpers, and internal resampling utilities.
  • Refine OctaveFilterBank repr and processing behaviors validation via additional tests.

Build:

  • Switch pyproject.toml to use a dynamic version sourced from pyoctaveband._version.version.

CI:

  • Change the release workflow to trigger on version tags, validate that the tag matches the package version, run twine checks, and create GitHub releases using the validated tag.

Summary by CodeRabbit

  • New Features

    • Added initial_state parameter to time weighting for flexible exponential integrator initialization across signal segments
  • Documentation

    • Extended API reference with time weighting parameter details, initialization modes, and block-processing guidance
  • Chores

    • Updated package version to 1.2.2 with improved version management configuration

Review Change Stack

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 9, 2026

Reviewer's Guide

Adds configurable initial-state handling for time_weighting (including multichannel and impulse modes), centralizes and exposes the package version, improves filter/utility coverage, and switches the release workflow to tag-based publishing with version validation.

Class diagram for updated time_weighting API and version handling

classDiagram
    class parametric_filters {
      +time_weighting(x, fs, mode, initial_state) np.ndarray
      +weighting_filter(x, fs, curve) np.ndarray
      +linkwitz_riley(x, fs, freq, order) tuple
    }

    class time_weighting_function {
      +time_weighting(x, fs, mode, initial_state) np.ndarray
    }

    class prepare_time_weighting_initial_state_function {
      +_prepare_time_weighting_initial_state(x_sq, initial_state) np.ndarray
    }

    class apply_impulse_kernel_function {
      +_apply_impulse_kernel(x_t, alpha_rise, alpha_fall, initial_state) np.ndarray
    }

    class _version_module {
      +__version__ : str
    }

    class package_init_module {
      +__version__ : str
      +__all__ : list
    }

    parametric_filters ..> time_weighting_function : defines
    parametric_filters ..> prepare_time_weighting_initial_state_function : defines
    parametric_filters ..> apply_impulse_kernel_function : defines

    time_weighting_function --> prepare_time_weighting_initial_state_function : uses
    time_weighting_function --> apply_impulse_kernel_function : uses for_impulse_mode

    package_init_module --> _version_module : imports __version__

    class fast_slow_time_weighting_behavior {
      +alpha : float
      +zi : np.ndarray
      +y : np.ndarray
    }

    class impulse_time_weighting_behavior {
      +alpha_rise : float
      +alpha_fall : float
      +x_t : np.ndarray
      +y_t : np.ndarray
      +initial_kernel : np.ndarray
    }

    time_weighting_function --> fast_slow_time_weighting_behavior : configures for_fast_slow
    time_weighting_function --> impulse_time_weighting_behavior : configures_for_impulse

    class initial_state_handling {
      +initial_state : str|float|np.ndarray|None
      +state_shape : tuple
      +state : np.ndarray
    }

    prepare_time_weighting_initial_state_function --> initial_state_handling : implements_rules

    class setuptools_dynamic_version {
      +pyproject_dynamic_version
    }

    setuptools_dynamic_version --> _version_module : reads_attr
    setuptools_dynamic_version --> package_init_module : aligned_with
Loading

File-Level Changes

Change Details Files
Add configurable initial-state handling to time_weighting, including impulse mode support and multichannel-safe initialization.
  • Introduce _prepare_time_weighting_initial_state helper to normalize/validate initial_state into a previous output state matching the input spatial shape.
  • Extend time_weighting signature with initial_state parameter and thread it through the fast/slow lfilter path using zi based on the provided state.
  • Update the impulse mode path to accept an initial_state array, ensure it is contiguous, and pass it into the Numba _apply_impulse_kernel, which now starts from the provided state instead of zeros.
  • Add tests covering initial_state='first', scalar/array states, multichannel handling, invalid initial_state strings, and impulse mode with initial_state in both 1D and multichannel cases.
src/pyoctaveband/parametric_filters.py
tests/test_parametric_filters.py
README.md
Centralize package version management and expose version at the top-level package, updating packaging metadata accordingly.
  • Add src/pyoctaveband/_version.py defining version='1.2.2' and import it from init to expose it via the public API.
  • Remove the hardcoded version string from init and include 'version' in all so downstream users can rely on PyOctaveBand.version.
  • Configure pyproject.toml to use dynamic versioning via setuptools, reading pyoctaveband._version.version instead of a static version field.
  • Add a regression test ensuring pyoctaveband.version matches the internal version constant.
src/pyoctaveband/_version.py
src/pyoctaveband/__init__.py
pyproject.toml
tests/test_basic.py
Switch the release workflow to tag-based publishing with package-version validation and simpler permissions.
  • Change the GitHub release workflow trigger from pushes to main to v* tags, removing the manual workflow_dispatch trigger and commit-skip logic.
  • Replace the auto-bump/version-commit steps with a Python script that reads version from src/pyoctaveband/_version.py and validates that it matches the tag name stripped of the leading 'v'.
  • Add an explicit twine check step after building and before publishing, and adjust the GitHub release step to use the validated tag/version outputs.
  • Simplify authentication by using the default GITHUB_TOKEN instead of a custom TOKEN_GH secret and stop pushing commits/tags from the workflow.
.github/workflows/release.yml
Improve coverage and robustness of filter, frequency, and utility helpers, and reorganize legacy coverage tests into targeted modules.
  • Add tests for WeightingFilter direct usage, including shape preservation, Z-curve passthrough, and constructor validation, as well as weighting_filter output shape.
  • Introduce tests for filter design helpers _design_sos_filter and _showfilter, covering all supported architectures and plotting branches (save, show, no-op).
  • Add tests for OctaveFilterBank repr, octavefilter limits=None combined with getansifrequencies, invalid level modes, and internal band processing without level calculation.
  • Add tests for normalizedfreq behavior for fraction=1 and invalid fractions, plus utility coverage for _resample_to_length padding/trimming on 1D and 2D inputs; remove the old test_coverage_fix.py in favor of these semantic test modules.
  • Ensure imports of newly tested internal helpers (filter_design, utils, frequencies) are wired correctly in tests.
tests/test_parametric_filters.py
tests/test_filter_design.py
tests/test_errors_and_edge_cases.py
tests/test_nominal_frequencies.py
tests/test_utils.py
tests/test_coverage_fix.py
Update README to document the new time_weighting initial_state behavior and clarify initial conditions.
  • Extend the API table entry for time_weighting to include the initial_state parameter and its accepted values.
  • Document the default integrator initial condition (y[-1]=0) and show how to start from the first sample energy using initial_state='first'.
  • Add guidance on block processing by passing the last output value into the next call's initial_state, and clarify usage in the mathematical description section.
README.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 9, 2026

Warning

Rate limit exceeded

@jmrplens has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 33 minutes and 55 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 387799ea-6b20-4f52-badd-4bc30f208cb6

📥 Commits

Reviewing files that changed from the base of the PR and between 0c111f1 and c88a153.

📒 Files selected for processing (17)
  • .github/dependabot.yml
  • .gitignore
  • README.md
  • issues_final.json
  • issues_final_check.json
  • pyproject.toml
  • requirements-dev.txt
  • requirements.txt
  • src/pyoctaveband/__init__.py
  • src/pyoctaveband/_version.py
  • src/pyoctaveband/parametric_filters.py
  • src/pyoctaveband/utils.py
  • tests/test_errors_and_edge_cases.py
  • tests/test_nominal_frequencies.py
  • tests/test_parametric_filters.py
  • tests/test_stateful_weighting_filter.py
  • tests/test_utils.py
📝 Walkthrough

Walkthrough

Package version management is centralized from inline constants to a dedicated _version.py module with dynamic resolution in pyproject.toml. The release workflow is refactored to trigger only on tag pushes matching v*, validate tag-to-version consistency, and use standard authentication. A new initial_state parameter is added to time_weighting for controlling exponential integrator starting conditions. Tests are reorganized into specialized modules with comprehensive coverage for the new feature.

Changes

Version Management & Time-weighting Feature

Layer / File(s) Summary
Version Definition & Module Import
src/pyoctaveband/_version.py, src/pyoctaveband/__init__.py
__version__ = "1.2.2" is defined in new _version.py module; __init__.py imports and re-exports it.
Build Configuration
pyproject.toml
version changes from static "1.2.1" to dynamic resolution via pyoctaveband._version.__version__ using [tool.setuptools.dynamic].
Release Workflow
.github/workflows/release.yml
Workflow triggers only on v* tag pushes, validates tag matches __version__ from _version.py, replaces version-bumping logic with tag validation and twine check, uses secrets.GITHUB_TOKEN for release authentication.
Time-weighting Feature
src/pyoctaveband/parametric_filters.py
time_weighting() signature adds initial_state parameter; new _prepare_time_weighting_initial_state() normalizes inputs (None/"zero", "first", scalar, array); _apply_impulse_kernel() accepts and initializes from computed state; both lfilter and impulse code paths use initial state for zi or kernel start instead of zero.
Documentation
README.md
Extends time_weighting API reference with initial_state parameter docs and usage example; explains default zero-rest initialization, "first" mode, and block-processing continuity.
Tests
tests/test_basic.py, tests/test_parametric_filters.py, tests/test_filter_design.py, tests/test_errors_and_edge_cases.py, tests/test_nominal_frequencies.py, tests/test_utils.py
Redistributes 160 lines of tests from test_coverage_fix.py across five specialized modules; adds new tests for version constant, initial_state modes (fast/slow/impulse with "first"/scalar/multichannel), weighting filter shape/behavior, filter design (_showfilter, _design_sos_filter), normalizedfreq validation, and utility resampling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

version-management, time-weighting, release-automation, test-refactoring

Poem

🐰 A version hops from module deep,
While releases grow automated and neat,
Time-weighting learns where to begin,
Tests scattered find homes once again,
PyOctaveBand bounces with pride!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding configurable initial state support to the time_weighting function.
Docstring Coverage ✅ Passed Docstring coverage is 90.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/time-weighting-initial-state

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/pyoctaveband/parametric_filters.py" line_range="233-234" />
<code_context>
         a = [1, -(1 - alpha)]
         # We apply the weighting to the squared signal to get the Mean Square value
-        return cast(np.ndarray, signal.lfilter(b, a, x_sq, axis=-1))
+        zi = np.expand_dims((1 - alpha) * initial, axis=-1)
+        y, _ = signal.lfilter(b, a, x_sq, axis=-1, zi=zi)
+        return cast(np.ndarray, y)

</code_context>
<issue_to_address>
**issue (bug_risk):** The `zi` shape for `signal.lfilter` is likely incorrect for multi-dimensional inputs and may lead to misaligned state or runtime errors.

For `lfilter`, `zi` must have shape `(max(len(a), len(b)) - 1, ...)`, with the leading dimension for filter state and the remaining dimensions matching `x` with the filtering axis removed. With `x_sq` shaped `(*state_shape, time)` and `axis=-1`, and a first-order IIR (`len(a) == 2`, `len(b) == 1`), `zi` should be `(1, *state_shape)`. Using `np.expand_dims(..., axis=-1)` instead yields `(*state_shape, 1)`, putting the state dimension in the wrong position for multi-dimensional inputs. Please construct `zi` as `((1 - alpha) * initial)[None, ...]` (or equivalent) so the state dimension is leading and the remaining dimensions align with `x_sq` minus the time axis.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +233 to +234
zi = np.expand_dims((1 - alpha) * initial, axis=-1)
y, _ = signal.lfilter(b, a, x_sq, axis=-1, zi=zi)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): The zi shape for signal.lfilter is likely incorrect for multi-dimensional inputs and may lead to misaligned state or runtime errors.

For lfilter, zi must have shape (max(len(a), len(b)) - 1, ...), with the leading dimension for filter state and the remaining dimensions matching x with the filtering axis removed. With x_sq shaped (*state_shape, time) and axis=-1, and a first-order IIR (len(a) == 2, len(b) == 1), zi should be (1, *state_shape). Using np.expand_dims(..., axis=-1) instead yields (*state_shape, 1), putting the state dimension in the wrong position for multi-dimensional inputs. Please construct zi as ((1 - alpha) * initial)[None, ...] (or equivalent) so the state dimension is leading and the remaining dimensions align with x_sq minus the time axis.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces an initial_state parameter to the time_weighting function, enabling support for block processing and custom initialization of the exponential integrator. Additionally, the package versioning has been moved to a dynamic configuration, and the test suite was significantly restructured and expanded to improve coverage. A high-severity issue was identified regarding the shape of initial conditions for multichannel signals in time_weighting, which would cause a runtime error.

a = [1, -(1 - alpha)]
# We apply the weighting to the squared signal to get the Mean Square value
return cast(np.ndarray, signal.lfilter(b, a, x_sq, axis=-1))
zi = np.expand_dims((1 - alpha) * initial, axis=-1)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The initial conditions zi for scipy.signal.lfilter are incorrectly shaped for multichannel signals. When filtering along the last dimension (axis=-1), lfilter expects zi to have the shape (order, *remaining_dims). Currently, np.expand_dims(..., axis=-1) results in (*remaining_dims, order), which will cause a ValueError during execution for any input with more than one channel (e.g., stereo audio). Changing the axis to 0 ensures the order dimension is correctly placed at the beginning.

Suggested change
zi = np.expand_dims((1 - alpha) * initial, axis=-1)
zi = np.expand_dims((1 - alpha) * initial, axis=0)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

CI Results 🚀

Test Summary

Python Version Tests Failures Coverage Status
macos-latest-3.13 117 0 98.4% ✅ Passed
ubuntu-latest-3.13 117 0 98.4% ✅ Passed
windows-latest-3.13 117 0 98.4% ✅ Passed

Technical Benchmark Summary

📊 View Benchmark Details

PyOctaveBand: Technical Benchmark Report

Generated: 2026-05-09 12:33:17

1. Test Signal Parameters

  • Sample Rate: 96.0 kHz
  • Duration: 10.0 seconds
  • Signal Types: White Noise (Stability) / Pure Sine (Precision)
  • Precision: 64-bit Floating Point

2. Crossover (Linkwitz-Riley)

Crossover

  • Flatness Error: 0.000000 dB (Target < 0.01)

3. Precision & Isolation

Precision

Type Error (dB) Isolation Ripple GD Std (ms)
butter 2.46e-03 31.3 dB 0.2705 dB 2847.826
cheby1 3.38e-03 40.5 dB 0.1000 dB 3551.677
cheby2 3.26e-03 57.8 dB 29.4187 dB 4790.013
ellip 9.41e-03 54.2 dB 0.1000 dB 4700.881
bessel 5.20e-01 32.5 dB 5.9845 dB 1380.212

4. Performance

Performance

Channels Exec Time (s) Speedup
1 0.639 1.00x
2 1.238 1.03x
4 2.450 1.04x
8 4.858 1.05x
16 9.680 1.06x

View Full Artifacts

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Line 93: Update the README entry for time_weighting to clarify that the
returned envelope "env" preserves the input shape (i.e., is aligned with x and
supports multichannel inputs), not always a 1D array; mention it returns an
array with the same number of channels as x (or same shape as x) and give the
existing call signature time_weighting(x, fs, mode='fast') and symbol env so
readers know which function and return value you mean.

In `@src/pyoctaveband/parametric_filters.py`:
- Around line 221-223: Guard against non-positive sampling rates by validating
the fs parameter at the start of the function that uses it (the function that
calls _typesignal, computes x_sq and calls
_prepare_time_weighting_initial_state). If fs <= 0 raise a ValueError with a
clear message, or return an appropriate error path consistent with other module
APIs; do this before any computation of integration/constants that depend on fs
so downstream math (e.g., integration constants, filter coefficients) never sees
invalid values. Update the function containing x_proc = _typesignal(x), x_sq =
x_proc**2, initial = _prepare_time_weighting_initial_state(...) to perform this
check early.
- Around line 166-168: The branch handling initial_state == "first" currently
assumes x_sq has at least one sample and will IndexError on empty input; update
the block (the code referencing state_name and x_sq and using np.take(..., 0,
axis=-1)) to first check whether the input has any samples along the last axis
(e.g., if x_sq.shape[-1] == 0 or x_sq.size == 0) and if empty raise the same
ValueError("initial_state must be None, 'zero', 'first', a scalar, or an array")
instead of indexing; otherwise proceed to return the first-sample array as
before.

In `@tests/test_utils.py`:
- Around line 11-27: The test uses plain np.ones so it can miss
ordering/selection bugs; replace the inputs with distinct sequences (e.g.,
np.arange or row-wise ranges) and assert exact value preservation/trimming and
zero padding. For padding cases (calls to _resample_to_length with target 12),
assert y[:10] equals the original sequence and y[10:] are zeros; for the 2D case
assert each row's first 10 columns equal the corresponding input row and columns
10: are zeros. For trimming cases (target 8), assert y equals the input's first
8 samples (and for 2D, first 8 columns per row) to ensure correct order and
content are preserved.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 634d7fd5-1d66-49da-966a-b857004ae0c7

📥 Commits

Reviewing files that changed from the base of the PR and between bc50b21 and 0c111f1.

📒 Files selected for processing (13)
  • .github/workflows/release.yml
  • README.md
  • pyproject.toml
  • src/pyoctaveband/__init__.py
  • src/pyoctaveband/_version.py
  • src/pyoctaveband/parametric_filters.py
  • tests/test_basic.py
  • tests/test_coverage_fix.py
  • tests/test_errors_and_edge_cases.py
  • tests/test_filter_design.py
  • tests/test_nominal_frequencies.py
  • tests/test_parametric_filters.py
  • tests/test_utils.py
💤 Files with no reviewable changes (1)
  • tests/test_coverage_fix.py

Comment thread README.md Outdated
Comment thread src/pyoctaveband/parametric_filters.py Outdated
Comment thread src/pyoctaveband/parametric_filters.py
Comment thread tests/test_utils.py Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

CI Results 🚀

Test Summary

Python Version Tests Failures Coverage Status
macos-latest-3.13 117 0 98.4% ✅ Passed
ubuntu-latest-3.13 117 0 98.4% ✅ Passed
windows-latest-3.13 117 0 98.4% ✅ Passed

Technical Benchmark Summary

📊 View Benchmark Details

PyOctaveBand: Technical Benchmark Report

Generated: 2026-05-09 12:43:33

1. Test Signal Parameters

  • Sample Rate: 96.0 kHz
  • Duration: 10.0 seconds
  • Signal Types: White Noise (Stability) / Pure Sine (Precision)
  • Precision: 64-bit Floating Point

2. Crossover (Linkwitz-Riley)

Crossover

  • Flatness Error: 0.000000 dB (Target < 0.01)

3. Precision & Isolation

Precision

Type Error (dB) Isolation Ripple GD Std (ms)
butter 2.46e-03 31.3 dB 0.2705 dB 2847.826
cheby1 3.38e-03 40.5 dB 0.1000 dB 3551.677
cheby2 3.26e-03 57.8 dB 29.4187 dB 4790.013
ellip 9.41e-03 54.2 dB 0.1000 dB 4700.881
bessel 5.20e-01 32.5 dB 5.9845 dB 1380.212

4. Performance

Performance

Channels Exec Time (s) Speedup
1 0.634 1.00x
2 1.241 1.02x
4 2.447 1.04x
8 4.861 1.04x
16 9.692 1.05x

View Full Artifacts

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

CI Results 🚀

Test Summary

Python Version Tests Failures Coverage Status
macos-latest-3.13 117 0 98.4% ✅ Passed
ubuntu-latest-3.13 117 0 98.4% ✅ Passed
windows-latest-3.13 117 0 98.4% ✅ Passed

Technical Benchmark Summary

📊 View Benchmark Details

PyOctaveBand: Technical Benchmark Report

Generated: 2026-05-09 12:46:25

1. Test Signal Parameters

  • Sample Rate: 96.0 kHz
  • Duration: 10.0 seconds
  • Signal Types: White Noise (Stability) / Pure Sine (Precision)
  • Precision: 64-bit Floating Point

2. Crossover (Linkwitz-Riley)

Crossover

  • Flatness Error: 0.000000 dB (Target < 0.01)

3. Precision & Isolation

Precision

Type Error (dB) Isolation Ripple GD Std (ms)
butter 2.46e-03 31.3 dB 0.2705 dB 2847.826
cheby1 3.38e-03 40.5 dB 0.1000 dB 3551.677
cheby2 3.26e-03 57.8 dB 29.4187 dB 4790.013
ellip 9.41e-03 54.2 dB 0.1000 dB 4700.881
bessel 5.20e-01 32.5 dB 5.9845 dB 1380.212

4. Performance

Performance

Channels Exec Time (s) Speedup
1 0.625 1.00x
2 1.228 1.02x
4 2.434 1.03x
8 4.847 1.03x
16 9.671 1.03x

View Full Artifacts

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

CI Results 🚀

Test Summary

Python Version Tests Failures Coverage Status
macos-latest-3.13 117 0 98.4% ✅ Passed
ubuntu-latest-3.13 117 0 98.4% ✅ Passed
windows-latest-3.13 117 0 98.4% ✅ Passed

Technical Benchmark Summary

📊 View Benchmark Details

PyOctaveBand: Technical Benchmark Report

Generated: 2026-05-09 12:50:38

1. Test Signal Parameters

  • Sample Rate: 96.0 kHz
  • Duration: 10.0 seconds
  • Signal Types: White Noise (Stability) / Pure Sine (Precision)
  • Precision: 64-bit Floating Point

2. Crossover (Linkwitz-Riley)

Crossover

  • Flatness Error: 0.000000 dB (Target < 0.01)

3. Precision & Isolation

Precision

Type Error (dB) Isolation Ripple GD Std (ms)
butter 2.46e-03 31.3 dB 0.2705 dB 2847.826
cheby1 3.38e-03 40.5 dB 0.1000 dB 3551.677
cheby2 3.26e-03 57.8 dB 29.4187 dB 4790.013
ellip 9.41e-03 54.2 dB 0.1000 dB 4700.881
bessel 5.20e-01 32.5 dB 5.9845 dB 1380.212

4. Performance

Performance

Channels Exec Time (s) Speedup
1 0.769 1.00x
2 1.512 1.02x
4 2.995 1.03x
8 5.987 1.03x
16 11.972 1.03x

View Full Artifacts

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

CI Results 🚀

Test Summary

Python Version Tests Failures Coverage Status
macos-latest-3.13 117 0 98.4% ✅ Passed
ubuntu-latest-3.13 117 0 98.4% ✅ Passed
windows-latest-3.13 117 0 98.4% ✅ Passed

Technical Benchmark Summary

📊 View Benchmark Details

PyOctaveBand: Technical Benchmark Report

Generated: 2026-05-09 12:51:59

1. Test Signal Parameters

  • Sample Rate: 96.0 kHz
  • Duration: 10.0 seconds
  • Signal Types: White Noise (Stability) / Pure Sine (Precision)
  • Precision: 64-bit Floating Point

2. Crossover (Linkwitz-Riley)

Crossover

  • Flatness Error: 0.000000 dB (Target < 0.01)

3. Precision & Isolation

Precision

Type Error (dB) Isolation Ripple GD Std (ms)
butter 2.46e-03 31.3 dB 0.2705 dB 2847.826
cheby1 3.38e-03 40.5 dB 0.1000 dB 3551.677
cheby2 3.26e-03 57.8 dB 29.4187 dB 4790.013
ellip 9.41e-03 54.2 dB 0.1000 dB 4700.881
bessel 5.20e-01 32.5 dB 5.9845 dB 1380.212

4. Performance

Performance

Channels Exec Time (s) Speedup
1 0.628 1.00x
2 1.233 1.02x
4 2.445 1.03x
8 4.858 1.03x
16 9.684 1.04x

View Full Artifacts

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

CI Results 🚀

Test Summary

Python Version Tests Failures Coverage Status
macos-latest-3.13 117 0 98.4% ✅ Passed
ubuntu-latest-3.13 117 0 98.4% ✅ Passed
windows-latest-3.13 117 0 98.4% ✅ Passed

Technical Benchmark Summary

📊 View Benchmark Details

PyOctaveBand: Technical Benchmark Report

Generated: 2026-05-09 12:55:22

1. Test Signal Parameters

  • Sample Rate: 96.0 kHz
  • Duration: 10.0 seconds
  • Signal Types: White Noise (Stability) / Pure Sine (Precision)
  • Precision: 64-bit Floating Point

2. Crossover (Linkwitz-Riley)

Crossover

  • Flatness Error: 0.000000 dB (Target < 0.01)

3. Precision & Isolation

Precision

Type Error (dB) Isolation Ripple GD Std (ms)
butter 2.46e-03 31.3 dB 0.2705 dB 2847.826
cheby1 3.38e-03 40.5 dB 0.1000 dB 3551.677
cheby2 3.26e-03 57.8 dB 29.4187 dB 4790.013
ellip 9.41e-03 54.2 dB 0.1000 dB 4700.881
bessel 5.20e-01 32.5 dB 5.9845 dB 1380.212

4. Performance

Performance

Channels Exec Time (s) Speedup
1 0.637 1.00x
2 1.239 1.03x
4 2.447 1.04x
8 4.864 1.05x
16 9.685 1.05x

View Full Artifacts

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 9, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

CI Results 🚀

Test Summary

Python Version Tests Failures Coverage Status
macos-latest-3.13 124 0 100.0% ✅ Passed
ubuntu-latest-3.13 124 0 100.0% ✅ Passed
windows-latest-3.13 124 0 100.0% ✅ Passed

Technical Benchmark Summary

📊 View Benchmark Details

PyOctaveBand: Technical Benchmark Report

Generated: 2026-05-09 12:59:32

1. Test Signal Parameters

  • Sample Rate: 96.0 kHz
  • Duration: 10.0 seconds
  • Signal Types: White Noise (Stability) / Pure Sine (Precision)
  • Precision: 64-bit Floating Point

2. Crossover (Linkwitz-Riley)

Crossover

  • Flatness Error: 0.000000 dB (Target < 0.01)

3. Precision & Isolation

Precision

Type Error (dB) Isolation Ripple GD Std (ms)
butter 2.46e-03 31.3 dB 0.2705 dB 2847.826
cheby1 3.38e-03 40.5 dB 0.1000 dB 3551.677
cheby2 3.26e-03 57.8 dB 29.4187 dB 4790.013
ellip 9.41e-03 54.2 dB 0.1000 dB 4700.881
bessel 5.20e-01 32.5 dB 5.9845 dB 1380.212

4. Performance

Performance

Channels Exec Time (s) Speedup
1 0.639 1.00x
2 1.248 1.02x
4 2.448 1.04x
8 4.861 1.05x
16 9.701 1.05x

View Full Artifacts

@jmrplens jmrplens merged commit 54dea44 into main May 9, 2026
15 checks passed
@jmrplens jmrplens deleted the feature/time-weighting-initial-state branch May 9, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant