Iir1.Net is a faithful C# port of Bernd Porr's iir1 digital IIR filter library. It provides Butterworth, Chebyshev I, Chebyshev II, custom-pole, and RBJ filters while preserving the native implementation's coefficients, state progression, and sample-by-sample behavior.
The port targets .NET Standard 2.1, .NET 8, and .NET 10. Its parity suite contains 45 native scenarios captured
independently with MSVC and GCC and runs 46 contract tests on both .NET 8 and .NET 10. Expected floating-point
differences between native toolchains are handled with a strict 1e-14 absolute-or-relative tolerance; results that are
bit-identical also pass directly. See Parity verification for the exact contract and regeneration
procedure.
dotnet add package Iir1.Net --version 1.0.0using Iir.Butterworth;
var filter = new LowPass();
filter.Setup(sampleRate: 48_000, cutoffFrequency: 2_000);
double output = filter.Filter(inputSample);Butterworth, Chebyshev, and custom filters use direct-form II state by default; RBJ filters preserve the upstream
direct-form I default. Generic filter types accept another ISectionState implementation when an application needs a
different realization. Setup accepts frequencies in hertz; SetupN accepts frequencies normalized to the sample rate.
srcis the source root for all solution projects.src/Iir1.Netcontains the package implementation.src/Iir1.Net.Testscontains managed parity and behavior tests plus committed native fixtures.src/Iir1.Net.Demois a minimal executable example.reference/iir1is the exact upstream source revision used for verification.tools/paritybuilds the native capture harness and regenerates fixtures.tools/packagevalidates and smoke-tests the package artifacts.
Visual Studio 2022 or newer can open Iir1.Net.sln directly. The command-line equivalent is:
dotnet build Iir1.Net.sln -c Release
dotnet test src/Iir1.Net.Tests/Iir1.Net.Tests.csproj -c Release -f net8.0 --no-build
dotnet test src/Iir1.Net.Tests/Iir1.Net.Tests.csproj -c Release -f net10.0 --no-buildInitialize the pinned upstream source before regenerating parity data:
git submodule update --init --recursiveOn Windows, tools/parity/scripts/regenerate-parity.ps1 prefers the installed Visual Studio C++ toolchain. The GCC
profile accepts an explicit g++.exe through -Compiler. On Linux, use tools/parity/scripts/regenerate-parity.sh.
The managed port is MIT-licensed; see LICENSE. The original iir1 copyright and license are preserved in THIRD_PARTY_NOTICES.md and LICENSES/iir1-MIT.txt.