mirror of
https://github.com/xdsopl/robot36.git
synced 2026-01-20 15:00:16 +01:00
avoid confusion by adding sample rate
This commit is contained in:
parent
e52c2ee3ef
commit
8fc46077c8
|
|
@ -14,8 +14,8 @@ public final class Filter {
|
|||
return Math.sin(x) / x;
|
||||
}
|
||||
|
||||
public static double lowPass(double cutoff, int n, int N) {
|
||||
double f = 2 * cutoff;
|
||||
public static double lowPass(double cutoff, double rate, int n, int N) {
|
||||
double f = 2 * cutoff / rate;
|
||||
double x = n - (N - 1) / 2.0;
|
||||
return f * sinc(f * x);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue