iirjdart 0.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 73

iirjdart #

An IIR filter library written in Dart. Highpass, lowpass, bandpass and bandstop as Butterworth, Bessel and Chebyshev Type I/II.

This library is a porting in Dart of the famous iirj library by berndporr.

alt tag

Usage #

To use this package add iirjdart as a dependency in your pubspec.yaml file.

Import the library.

import 'package:iirjdart/butterworth.dart';

Then create the filter that you want.

Butterworth butterworth = new Butterworth();

And initialize it with:

  1. Bandstop

    butterworth.bandStop(order,Samplingfreq,Center freq,Width in frequ);

  2. Bandpass

    butterworth.bandPass(order,Samplingfreq,Center freq,Width in frequ);

  3. Lowpass

    butterworth.lowPass(order,Samplingfreq,Cutoff frequ);

  4. Highpass

    butterworth.highPass(order,Samplingfreq,Cutoff frequ);

Filtering #

The filtering is done sample by sample for realtime processing:

v = butterworth.filter(v)

Coding examples #

See the test/*_test.dart files for complete examples for all filter types.

0.0.1 - 2020-05-01. #

  • Initial release.

example/main.dart

import 'package:iirjdart/butterworth.dart';

void main() {
  List<double> dataToFilter = List.filled(500, 0.0);
  dataToFilter[10] = 1.0;

  Butterworth butterworth = Butterworth();
  butterworth.lowPass(4, 250, 50);

  List<double> filteredData = [];
  for(var v in dataToFilter) {
    filteredData.add(butterworth.filter(v));
  }

  print(filteredData);
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  iirjdart: ^0.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:iirjdart/butterworth.dart';
import 'package:iirjdart/chebyshev_1.dart';
import 'package:iirjdart/chebyshev_2.dart';
import 'package:iirjdart/direct_form_1.dart';
import 'package:iirjdart/direct_form_2.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
50
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
73
Learn more about scoring.

We analyzed this package on Jul 8, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

because of import path [iirjdart] that is in a package requiring null.

Health suggestions

Format lib/butterworth.dart.

Run flutter format to format lib/butterworth.dart.

Format lib/chebyshev_1.dart.

Run flutter format to format lib/chebyshev_1.dart.

Format lib/chebyshev_2.dart.

Run flutter format to format lib/chebyshev_2.dart.

Fix additional 14 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/direct_form_1.dart (Run flutter format to format lib/direct_form_1.dart.)
  • lib/direct_form_2.dart (Run flutter format to format lib/direct_form_2.dart.)
  • lib/src/band_pass_transform.dart (Run flutter format to format lib/src/band_pass_transform.dart.)
  • lib/src/band_stop_transform.dart (Run flutter format to format lib/src/band_stop_transform.dart.)
  • lib/src/biquad.dart (Run flutter format to format lib/src/biquad.dart.)
  • lib/src/biquad_pole_state.dart (Run flutter format to format lib/src/biquad_pole_state.dart.)
  • lib/src/cascade.dart (Run flutter format to format lib/src/cascade.dart.)
  • lib/src/complex_pair.dart (Run flutter format to format lib/src/complex_pair.dart.)
  • lib/src/direct_form.dart (Run flutter format to format lib/src/direct_form.dart.)
  • lib/src/high_pass_transform.dart (Run flutter format to format lib/src/high_pass_transform.dart.)
  • lib/src/layout_base.dart (Run flutter format to format lib/src/layout_base.dart.)
  • lib/src/low_pass_transform.dart (Run flutter format to format lib/src/low_pass_transform.dart.)
  • lib/src/math_supplement.dart (Run flutter format to format lib/src/math_supplement.dart.)
  • lib/src/pole_zero_pair.dart (Run flutter format to format lib/src/pole_zero_pair.dart.)

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
complex ^0.5.0 0.5.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test