mirror of
https://github.com/xdsopl/robot36.git
synced 2026-01-04 23:39:59 +01:00
removed unused stuff
This commit is contained in:
parent
25a8fc6589
commit
cfd54fcace
|
|
@ -1,27 +0,0 @@
|
|||
/*
|
||||
Complex digital delay line
|
||||
|
||||
Copyright 2024 Ahmet Inan <xdsopl@gmail.com>
|
||||
*/
|
||||
|
||||
package xdsopl.robot36;
|
||||
|
||||
public class ComplexDelay {
|
||||
public final int length;
|
||||
private final Delay real;
|
||||
private final Delay imag;
|
||||
private final Complex temp;
|
||||
|
||||
ComplexDelay(int length) {
|
||||
this.length = length;
|
||||
this.real = new Delay(length);
|
||||
this.imag = new Delay(length);
|
||||
this.temp = new Complex();
|
||||
}
|
||||
|
||||
Complex push(Complex input) {
|
||||
temp.real = real.push(input.real);
|
||||
temp.imag = imag.push(input.imag);
|
||||
return temp;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
/*
|
||||
Complex Moving Average
|
||||
|
||||
Copyright 2024 Ahmet Inan <xdsopl@gmail.com>
|
||||
*/
|
||||
|
||||
package xdsopl.robot36;
|
||||
|
||||
public class ComplexMovingAverage extends ComplexMovingSum {
|
||||
public ComplexMovingAverage(int length) {
|
||||
super(length);
|
||||
}
|
||||
|
||||
public Complex avg() {
|
||||
return sum().div(length);
|
||||
}
|
||||
|
||||
public Complex avg(Complex input) {
|
||||
return sum(input).div(length);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
/*
|
||||
Complex Moving Sum
|
||||
|
||||
Copyright 2024 Ahmet Inan <xdsopl@gmail.com>
|
||||
*/
|
||||
|
||||
package xdsopl.robot36;
|
||||
|
||||
public class ComplexMovingSum {
|
||||
public final int length;
|
||||
private final SimpleMovingSum real;
|
||||
private final SimpleMovingSum imag;
|
||||
private final Complex temp;
|
||||
|
||||
ComplexMovingSum(int length) {
|
||||
this.length = length;
|
||||
this.real = new SimpleMovingSum(length);
|
||||
this.imag = new SimpleMovingSum(length);
|
||||
this.temp = new Complex();
|
||||
}
|
||||
|
||||
void add(Complex input) {
|
||||
real.add(input.real);
|
||||
imag.add(input.imag);
|
||||
}
|
||||
|
||||
Complex sum() {
|
||||
temp.real = real.sum();
|
||||
temp.imag = imag.sum();
|
||||
return temp;
|
||||
}
|
||||
|
||||
Complex sum(Complex input) {
|
||||
temp.real = real.sum(input.real);
|
||||
temp.imag = imag.sum(input.imag);
|
||||
return temp;
|
||||
}
|
||||
}
|
||||
|
|
@ -14,18 +14,10 @@ public class ExponentialMovingAverage {
|
|||
this.alpha = 1;
|
||||
}
|
||||
|
||||
ExponentialMovingAverage(float alpha) {
|
||||
this.alpha = alpha;
|
||||
}
|
||||
|
||||
public float avg(float input) {
|
||||
return prev = prev * (1 - alpha) + alpha * input;
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
prev = 0;
|
||||
}
|
||||
|
||||
public void reset(float alpha) {
|
||||
this.alpha = alpha;
|
||||
prev = 0;
|
||||
|
|
|
|||
|
|
@ -11,10 +11,6 @@ public class SimpleMovingAverage extends SimpleMovingSum {
|
|||
super(length);
|
||||
}
|
||||
|
||||
public float avg() {
|
||||
return sum() / length;
|
||||
}
|
||||
|
||||
public float avg(float input) {
|
||||
return sum(input) / length;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue