This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| 4rpl:commands:signalgenerator [2025/02/14 14:57] – external edit 127.0.0.1 | 4rpl:commands:signalgenerator [2025/09/03 16:43] (current) – [Sine wave in any direction without gaps] kalli | ||
|---|---|---|---|
| Line 140: | Line 140: | ||
| 1 -> | 1 -> | ||
| 0.5 -> | 0.5 -> | ||
| + | </ | ||
| + | |||
| + | ==== Sine wave in any direction without gaps ==== | ||
| + | {{ : | ||
| + | |||
| + | <code 4RPL> | ||
| + | 30 30 v2 165 91 v2 15 4.5 0 @getSinusoidCells ->list | ||
| + | <-list 0 do | ||
| + | < | ||
| + | loop | ||
| + | |||
| + | : | ||
| + | ->cell1 | ||
| + | ->cell0 | ||
| + | <-cell1 <-cell0 sub ->dir | ||
| + | <-dir.0 abs <-dir.1 abs max ->length | ||
| + | < | ||
| + | <-cell0 | ||
| + | < | ||
| + | dup <-dirL add | ||
| + | loop | ||
| + | < | ||
| + | |||
| + | : | ||
| + | ->shift # FLOAT between 0 and 1 that will shift the signal from signalgenerator. | ||
| + | -> | ||
| + | ->ampl | ||
| + | ->cell1 | ||
| + | ->cell0 | ||
| + | |||
| + | clearstack | ||
| + | <-cell0 <-cell1 @getSingleLineCells dup -> | ||
| + | < | ||
| + | |||
| + | <-cell1 <-cell0 sub normalize ->dir | ||
| + | <-dir.1 <-dir.0 neg v2 <-ampl mul ->dirP | ||
| + | |||
| + | <-cell0 | ||
| + | < | ||
| + | i <-freq <-shift 0 1 signalgenerator <-dirP mul < | ||
| + | loop | ||
| + | list | ||
| + | |||
| </ | </ | ||
| < | < | ||