Skip to content

Commit

Permalink
[fixes psambit9791#26] Rename LMS & NLMS filter classes
Browse files Browse the repository at this point in the history
  • Loading branch information
SiboVG committed Nov 16, 2021
1 parent 645eaeb commit f108d18
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @author SiboVanGool
* @version 1.0
*/
public class LMSFilter {
public class LMS {
private final double learningRate; // Learning rate (= step size)
private double[] weights; // Weights of the filter
private double[] error; // Error of the filter
Expand All @@ -37,7 +37,7 @@ public enum WeightsFillMethod {
* With 'k' being a sample index, and n ranging from 0 to weights.length
* @param weights initialized weights (size = number of taps of the filter)
*/
public LMSFilter(double learningRate, double[] weights) {
public LMS(double learningRate, double[] weights) {
if (weights == null || weights.length == 0) {
throw new IllegalArgumentException("Weights must be non-null and with a length greater than 0");
}
Expand All @@ -56,7 +56,7 @@ public LMSFilter(double learningRate, double[] weights) {
* @param length length (number of taps) of the filter
* @param fillMethod determines how the weights should be initialized
*/
public LMSFilter(double learningRate, int length, WeightsFillMethod fillMethod) {
public LMS(double learningRate, int length, WeightsFillMethod fillMethod) {
this.weights = new double[length];
switch (fillMethod) {
// Create random weights between 0 and 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @author SiboVanGool
* @version 1.0
*/
public class NLMSFilter {
public class NLMS {
private final double learningRate; // Learning rate (= step size)
private double[] weights; // Weights of the filter
private double[] error; // Error of the filter
Expand All @@ -39,7 +39,7 @@ public enum WeightsFillMethod {
* 0 ≤ learningRate ≤ 2
* @param weights initialized weights (size = number of taps of the filter)
*/
public NLMSFilter(double learningRate, double[] weights) {
public NLMS(double learningRate, double[] weights) {
if (weights == null || weights.length == 0) {
throw new IllegalArgumentException("Weights must be non-null and with a length greater than 0");
}
Expand All @@ -60,7 +60,7 @@ public NLMSFilter(double learningRate, double[] weights) {
* @param length length (number of taps) of the filter
* @param fillMethod determines how the weights should be initialized
*/
public NLMSFilter(double learningRate, int length, WeightsFillMethod fillMethod) {
public NLMS(double learningRate, int length, WeightsFillMethod fillMethod) {
if (learningRate < 0 || learningRate > 2) {
System.err.println("Keep the learning rate between 0 and 2 to avoid diverging results");
}
Expand Down
Loading

0 comments on commit f108d18

Please sign in to comment.