Generates an output signal in proportion to one input signal.
More...
#include <filters.hpp>
|
| void | begin (uint8_t mode=INCREMENTAL) |
| | Initializes the ScalingFilter1D with the specified mode.
|
| void | set_ratio (ControlParameter ratio) |
| | Sets the scaling ratio between output and input.
|
| void | set_ratio (ControlParameter output_distance, ControlParameter input_distance) |
| | Sets the scaling ratio using output and input distances.
|
Generates an output signal in proportion to one input signal.
The ScalingFilter1D class scales an input signal by a specified ratio to produce an output signal. This is useful for scaling a motion trajectory. Here's an example of how to instantiate and configure a ScalingFilter1D:
#define module_driver
#include "stepdance.hpp"
void setup(){
output_a.
begin(OUTPUT_A);
enable_drivers();
channel_x.
begin(&output_a, SIGNAL_E);
scale_filter.
output.
map(channel_x.input_target_position);
dance_start();
}
void loop(){
dance_loop();
}
◆ begin()
| void ScalingFilter1D::begin |
( |
uint8_t | mode = INCREMENTAL | ) |
|
Initializes the ScalingFilter1D with the specified mode.
- Parameters
-
| mode | Mode of operation: INCREMENTAL or ABSOLUTE. Default is INCREMENTAL. |
◆ set_ratio() [1/2]
| void ScalingFilter1D::set_ratio |
( |
ControlParameter | output_distance, |
|
|
ControlParameter | input_distance ) |
|
inline |
Sets the scaling ratio using output and input distances.
- Parameters
-
| output_distance | Distance in world units for the output. |
| input_distance | Distance in world units for the input. |
◆ set_ratio() [2/2]
| void ScalingFilter1D::set_ratio |
( |
ControlParameter | ratio | ) |
|
Sets the scaling ratio between output and input.
- Parameters
-
| ratio | Scaling ratio (output / input). |
The documentation for this class was generated from the following file: