Skip to content

Commit

Permalink
Added info about moving average
Browse files Browse the repository at this point in the history
  • Loading branch information
berndporr committed Apr 15, 2024
1 parent bc89a04 commit 6e7e606
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Fir1.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ class Fir1 {
Fir1(const char* coeffFile, unsigned number_of_taps = 0);

/**
* Inits all coefficients and the buffer to a constant value
* Inits all coefficients and the buffer to a constant value.
* This is useful for adaptive filters where we start with
* zero valued coefficients or moving average filters.
* zero valued coefficients or moving average filters with
* value = 1.0/number_of_taps.
**/
Fir1(unsigned number_of_taps, double value = 0);

Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ By default optimised release libraries are generated.
Under windows only the static library is generated which
should be used for your code development.

For example for Visual Studio 2019 you write:
```
cmake -G "Visual Studio 16 2019" -A x64 .
```
Expand All @@ -66,7 +67,7 @@ for an instructional example.

Windows / Linux / Mac
```
pip3 install fir1
pip install fir1
```
under Windows it might be just `pip` for python3.

Expand All @@ -75,7 +76,7 @@ under Windows it might be just `pip` for python3.

Windows / Linux / Mac: make sure that you have swig and a C++ compiler installed. Then type:
```
python3 setup.py install
python setup.py install
```


Expand Down Expand Up @@ -137,7 +138,12 @@ or import the coefficients as a const double array:
Fir1 fir(coefficients)
```
there is also an option to import a non-const array (for example
generated with the ifft) and using std::vector.
generated with the ifft) and using std::vector. You can also
create a moving average filter by initialising all coefficients
with a constant value:
```
Fir1 moving_average(100,1.0/100);
```

#### C++ integer FIR filter:
```
Expand Down

0 comments on commit 6e7e606

Please sign in to comment.