DspFiltersNet 1.1.0
dotnet add package DspFiltersNet --version 1.1.0
NuGet\Install-Package DspFiltersNet -Version 1.1.0
<PackageReference Include="DspFiltersNet" Version="1.1.0" />
<PackageVersion Include="DspFiltersNet" Version="1.1.0" />
<PackageReference Include="DspFiltersNet" />
paket add DspFiltersNet --version 1.1.0
#r "nuget: DspFiltersNet, 1.1.0"
#addin nuget:?package=DspFiltersNet&version=1.1.0
#tool nuget:?package=DspFiltersNet&version=1.1.0
DspFiltersNet
DspFiltersNet is a digital signal processing library for .NET 8.0.
It allows the creation of the following FilterTypes:
- MovingAverage
- FrequencyFilters
For FrequencyFilters it allows the creation of the following filter design types:
- Butterworth
- Bessel
- Chebyshev Type I
- Chebyshev Type II
- Elliptic
The package supports the creation of Lowpass, Highpass, Bandpass and Bandstop filters up to order 16.
The package only supports Filters and does not have other features. For more DSP features in C# you may want to check out <img src="https://raw.githubusercontent.com/ar1st0crat/NWaves/master/assets/logo/logo_draft.bmp" alt="NWaves" height="18"/> NWaves
Example Usage
using DspFiltersNet;
class Program
{
static void Main()
{
// Define a butterworth lowpass of second order with a cutoff frequency of 10Hz and a sampling frequency of 1kHz.
var filterData = new ButterworthFilterDefinition(FrequencyFilterType.LowPass, 10, 0, 2, 1000);
// Create your filter instance
var filterInstance = new FrequencyFilterInstance(filterData);
// Use the filter instance to process your samples (single sample mode also available)
var result = filterInstance.ProcessSamples([0.0000000000000000D, 0.5941312281110626D, 0.9637482198843191D, 0.9700934515686609D, 0.6131666751454520D]);
}
}
Remarks
The frequency filters provided by this implementation use the transfer functions to filter your data. According to multiple documentations this can cause some stability problems and using SOS (second order sections) would be better but is currently not implemented
This library just creates filters based on the users input parameters. The user is still responsible to select plausible filter settings that work nice with the provided data.
Internal function
The package first creates an analog lowpass prototype of the selected settings similar to the matlab functions besselap, butterap, cheb1ap and cheb2ap. After that the lowpass prototype is converted to the selected filter (Lowpass, Highpass, Bandpass, Bandstop). This all works on the Zeros, Poles and Gain notation. After that the filter is transformed to a digital filter using the bilinear transform. In the end the Zeros, Poles and Gain returned from the bilinear transform are converted to a transfer function which is then used to in the filter instance to filter user data.
Validation
The code is validated with UnitTests against testdata generated with Matlab and with SciPy and should match these implementations pretty much perfectly (1e-14).
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.