Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/StuyPulse/stuylib
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam-Belliveau committed Feb 18, 2020
2 parents 3b94268 + 678f462 commit ae184be
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@ public class OrderedLowPassFilter implements IStreamFilter {
*/
public OrderedLowPassFilter(double rc, int order) throws ConstructionError {

IStreamFilter[] filters = new IStreamFilter[order];
for(int i = 0; i < filters.length; ++i) {
filters[i] = new LowPassFilter(rc / order);
}

mFilter = new IStreamFilterGroup(filters);

if (rc < 0.0) {
throw new ConstructionError("OrderedLowPassFilter(double rc, int order)", "rc must be greater than 0.0!");
}

if (order < 1) {
throw new ConstructionError("OrderedLowPassFilter(double rc, int order)", "order must be greater than 0!");
}

IStreamFilter[] filters = new IStreamFilter[order];
for(int i = 0; i < filters.length; ++i) {
filters[i] = new LowPassFilter(rc / order);
}

mFilter = new IStreamFilterGroup(filters);
}

public double get(double next) {
Expand Down

0 comments on commit ae184be

Please sign in to comment.