public FirstOrderBandPassFilteredYoVariable(String name, String description, double minPassThroughFrequency_Hz, double maxPassThroughFrequency_Hz, double DT, YoVariableRegistry registry) { super(name, description, maxPassThroughFrequency_Hz, DT, FirstOrderFilterType.LOW_PASS, registry); this.highPassFilteredInput = new FirstOrderFilteredYoVariable(name + "HighPassFilteredOnly", description, minPassThroughFrequency_Hz, DT, FirstOrderFilterType.HIGH_PASS, registry); }
public FirstOrderBandPassFilteredYoVariable(String name, String description, double minPassThroughFrequency_Hz, double maxPassThroughFrequency_Hz, double DT, YoVariableRegistry registry) { super(name, description, maxPassThroughFrequency_Hz, DT, FirstOrderFilterType.LOW_PASS, registry); this.highPassFilteredInput = new FirstOrderFilteredYoVariable(name + "HighPassFilteredOnly", description, minPassThroughFrequency_Hz, DT, FirstOrderFilterType.HIGH_PASS, registry); }
public FirstOrderBandPassFilteredYoVariable(String name, String description, double minPassThroughFrequency_Hz, double maxPassThroughFrequency_Hz, YoDouble yoTime, YoVariableRegistry registry) { super(name, description, maxPassThroughFrequency_Hz, yoTime, FirstOrderFilterType.LOW_PASS, registry); this.highPassFilteredInput = new FirstOrderFilteredYoVariable(name + "HighPassFilteredOnly", description, minPassThroughFrequency_Hz, yoTime, FirstOrderFilterType.HIGH_PASS, registry); setPassBand(minPassThroughFrequency_Hz, maxPassThroughFrequency_Hz); }
public FirstOrderBandPassFilteredYoVariable(String name, String description, double minPassThroughFrequency_Hz, double maxPassThroughFrequency_Hz, DoubleYoVariable yoTime, YoVariableRegistry registry) { super(name, description, maxPassThroughFrequency_Hz, yoTime, FirstOrderFilterType.LOW_PASS, registry); this.highPassFilteredInput = new FirstOrderFilteredYoVariable(name + "HighPassFilteredOnly", description, minPassThroughFrequency_Hz, yoTime, FirstOrderFilterType.HIGH_PASS, registry); setPassBand(minPassThroughFrequency_Hz, maxPassThroughFrequency_Hz); }
@ContinuousIntegrationTest(estimatedDuration = 1.1) @Test(timeout=300000) public void testHighPassAttenuationForSinusoidalInput() { double inputFrequencyRadPerSec = 15.0; double cutoffFrequencyRadPerSec = inputFrequencyRadPerSec / 5.0; double filterAttenuation = 1.0; double properHighPassAttenuation; FirstOrderFilteredYoVariable highPassFilteredYoVariable = new FirstOrderFilteredYoVariable("highPass", "", cutoffFrequencyRadPerSec / (2.0*Math.PI), yoTime, FirstOrderFilterType.HIGH_PASS, registry); while (filterAttenuation > 0.1 && cutoffFrequencyRadPerSec > 0.0 ) { highPassFilteredYoVariable.setCutoffFrequencyHz(cutoffFrequencyRadPerSec / (2.0*Math.PI)); filterAttenuation = computeSteadyStateFilteredOutputAmplitude(yoTime, DT, inputFrequencyRadPerSec, highPassFilteredYoVariable); properHighPassAttenuation = computeProperHighPassAttenuation(inputFrequencyRadPerSec, cutoffFrequencyRadPerSec); assertEquals(properHighPassAttenuation, filterAttenuation, 1e-2); cutoffFrequencyRadPerSec += 10.0; } }
@ContinuousIntegrationTest(estimatedDuration = 0.2) @Test(timeout=300000) public void testLowPassAttenuationForSinusoidalInput() { double inputFrequencyRadPerSec = 10.0; double cutoffFrequencyRadPerSec = inputFrequencyRadPerSec * 5.0; double filterAttenuation = 1.0; double properLowPassAttenuation; FirstOrderFilteredYoVariable lowPassFilteredYoVariable = new FirstOrderFilteredYoVariable("lowPass", "", cutoffFrequencyRadPerSec / (2.0*Math.PI), yoTime, FirstOrderFilterType.LOW_PASS, registry); while (filterAttenuation > 0.1 && cutoffFrequencyRadPerSec > 0.0) { lowPassFilteredYoVariable.setCutoffFrequencyHz(cutoffFrequencyRadPerSec / (2.0*Math.PI)); filterAttenuation = computeSteadyStateFilteredOutputAmplitude(yoTime, DT, inputFrequencyRadPerSec, lowPassFilteredYoVariable); properLowPassAttenuation = computeProperLowPassAttenuation(inputFrequencyRadPerSec, cutoffFrequencyRadPerSec); assertEquals(properLowPassAttenuation, filterAttenuation, 1e-2); cutoffFrequencyRadPerSec -= 10.0; } }
yoWristSensorForceMagnitudeBias = new FirstOrderFilteredYoVariable(forceSensorName + "ForceBias", "", 0.0001, DT, FirstOrderFilterType.LOW_PASS, registry); yoWristSensorForceMagnitudeBandPassFiltered = new FirstOrderBandPassFilteredYoVariable(forceSensorName + "ForceMagFiltered", "", forceSensorMinPassThroughFreq_Hz, forceSensorMaxPassThroughFreq_Hz, DT, registry);
yoWristSensorForceMagnitudeBias = new FirstOrderFilteredYoVariable(forceSensorName + "ForceBias", "", 0.0001, DT, FirstOrderFilterType.LOW_PASS, registry); yoWristSensorForceMagnitudeBandPassFiltered = new FirstOrderBandPassFilteredYoVariable(forceSensorName + "ForceMagFiltered", "",