Skip to content

Commit

Permalink
Fixed typos, made AnalogFilter package protected. Added toString to ZPK
Browse files Browse the repository at this point in the history
  • Loading branch information
StaticBeagle committed Dec 8, 2023
1 parent 6296c08 commit 393c622
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions src/main/java/com/wildbitsfoundry/etk4j/control/ZeroPoleGain.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import com.wildbitsfoundry.etk4j.math.complex.Complex;
import com.wildbitsfoundry.etk4j.math.polynomials.Polynomial;

import java.util.Arrays;

import static com.wildbitsfoundry.etk4j.util.ComplexArrays.deepCopy;

/**
Expand Down Expand Up @@ -90,4 +92,18 @@ public Complex evaluateAt(double w) {
num.multiplyEquals(gain);
return num;
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("Zeros: ")
.append(Arrays.asList(zeros))
.append(System.lineSeparator())
.append("Poles: ")
.append(Arrays.asList(poles))
.append(System.lineSeparator())
.append("Gain: ")
.append(gain);
return sb.toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import java.util.Arrays;

public class AnalogFilter {
class AnalogFilter {

protected static LowPassResults lowPassFilterOrder(LowPassSpecs specs, FilterOrderCalculationStrategy strategy) {
double wp = specs.getPassBandFrequency();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import com.wildbitsfoundry.etk4j.math.complex.Complex;

public class FourmulasExample {
public class FormulasExample {

public static void main(String[] args) {
double a = 1.0;
Expand Down

0 comments on commit 393c622

Please sign in to comment.