Skip to content

Commit

Permalink
[fixes psambit9791#26] Use 'filter' instead of 'run' for LMS & NLMS
Browse files Browse the repository at this point in the history
  • Loading branch information
SiboVG committed Nov 16, 2021
1 parent b46e510 commit 645eaeb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private double[] adaptWeights(double desired, double[] x) {
* @param desired desired signal that you want after filtering of x
* @param x input signal that you want to filter with the LMS adaptive filter to achieve the desired signal
*/
public void run(double[] desired, double[] x) {
public void filter(double[] desired, double[] x) {
if (desired == null || desired.length == 0) {
throw new IllegalArgumentException("Desired signal cannot be null, or with size 0");
}
Expand Down Expand Up @@ -172,7 +172,7 @@ public double[] getOutput() {

private void checkOutput() {
if (this.output == null) {
throw new ExceptionInInitializerError("Execute run() function before returning result");
throw new ExceptionInInitializerError("Execute filter() function before returning result");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private double[] adaptWeights(double desired, double[] x) {
* @param desired desired signal that you want after filtering of x
* @param x input signal that you want to filter with the NLMS adaptive filter to achieve the desired signal
*/
public void run(double[] desired, double[] x) {
public void filter(double[] desired, double[] x) {
if (desired == null || desired.length == 0) {
throw new IllegalArgumentException("Desired signal cannot be null, or with size 0");
}
Expand Down Expand Up @@ -181,7 +181,7 @@ public double[] getOutput() {

private void checkOutput() {
if (this.output == null) {
throw new ExceptionInInitializerError("Execute run() function before returning result");
throw new ExceptionInInitializerError("Execute filter() function before returning result");
}
}
}
Loading

0 comments on commit 645eaeb

Please sign in to comment.