SineCosineGenMacro
Macro component that outputs a sine and a cosine wave with a given angle step, period and gain.
Processing
- A number_generator outputs the angle increment periodically; each sample advances the angle of SineCosineGenerator by angle_increment_in_deg.
- Another number_generator supplies the gain once at start.
Usage
- Use as a test signal, e.g. Sine_1 → Add_Diff.input1 (add noise) or Oscilloscope.inputA.
- Defined in SMSL_BasicToolkit_Macros.rtmc; used in the RobotPositioningToolkit Kalman filter examples (e.g. KalmanFilter_1D_demo.rtd).
Data format
- Outputs: Float64 scalars, one sample per period.
Notes
- Despite its name, sample_ratio is the output period in microseconds (default 10000 = 100 Hz).
- The wave frequency is angle_increment_in_deg / 360 × (1e6 / sample_ratio) Hz.
Properties
| Name | Description |
|---|---|
angle_increment_in_deg | Angle increment in degree per output sample. Default: 2 |
sample_ratio | Output period in microseconds (period of the internal angle number_generator). Default: 10000 |
gain | Amplitude of the output waves. Default: 1 |
Outputs
| Name | Description |
|---|---|
Sine_1 | Gain·sin(θ). Type: Float64 |
Cosine_1 | Gain·cos(θ). Type: Float64 |
RTMaps Toolkits Documentation