Discarding amplitude/using it as a multiplier flatlines here. git-synced with develop
branch about 14:15 UTC
gosgood@lydia ~ $ gmic run '128,1,1,1,"[100*wave(x)]"'
[gmic]./ Start G'MIC interpreter (v.3.5.4).
[gmic]./run/__run/ Input image at position 0, with values '[100*wave(x)]' (1 image 128x1x1x1).
[gmic]./ Display image [0] = '[[100*wave(x)]]'.
[0] = '[[100*wave(x)]]':
size = (128,1,1,1) [512 b of float32].
data = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0).
Using the amplitude argument seems necessary with this build:
$ gmic run '128,1,1,1,"wave(x,0,w,255)"'
[gmic]./ Start G'MIC interpreter (v.3.5.4).
[gmic]./run/__run/ Input image at position 0, with values 'wave(x,0,w,255)' (1 image 128x1x1x1).
[gmic]./ Display image [0] = '[wave(x,0,w,255)]'.
[0] = '[wave(x,0,w,255)]':
size = (128,1,1,1) [512 b of float32].
data = (255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255,-255).
min = -255, max = 255, mean = 0, std = 256.002, coords_min = (64,0,0,0), coords_max = (0,0,0,0).
Argument 3 (being called ‘period’, a measure in time) seems to work more like ‘wavelength’ measured in distance (Welcome to ‘English’ We invented the language to aggravate the French).
See my second example above. To get a one period square wave (the relative time it takes to travel 128 pixels), amplitude 255, I needed an argument three value of ‘w (equal to 128 pixels, a distance)’.
Example: American amateur radio has an “80 meter” wavelength band. Exactly one period (cycle) of that radiation travels 80 meters of distance.
This is how I actually get a period 4 signal:
$ gmic run '128,1,1,1,"wave(x,3,w/4,100)"'
[gmic]./ Start G'MIC interpreter (v.3.5.4).
[gmic]./run/__run/ Input image at position 0, with values 'wave(x,3,w/4,100)' (1 image 128x1x1x1).
[gmic]./ Display image [0] = '[wave(x,3,w/4,100)]'.
[0] = '[wave(x,3,w/4,100)]':
size = (128,1,1,1) [512 b of float32].
data = (0,19.509,38.2683,55.557,70.7107,83.147,92.388,98.0785,100,98.0785,92.388,83.147,70.7107,55.557,38.2683,19.509,1.22465e-14,-19.509,-38.2683,-55.557,-70.7107,-83.147,-92.388,-98.0785,-100,-98.0785,-92.388,-83.147,-70.7107,-55.557,-38.2683,-19.509,0,19.509,38.2683,55.557,70.7107,83.147,92.388,98.0785,100,98.0785,92.388,83.147,70.7107,55.557,38.2683,19.509,1.22465e-14,-19.509,-38.2683,-55.557,-70.7107,-83.147,-92.388,-98.0785,-100,-98.0785,-92.388,-83.147,-70.7107,-55.557,-38.2683,-19.509,0,19.509,38.2683,55.557,70.7107,83.147,92.388,98.0785,100,98.0785,92.388,83.147,70.7107,55.557,38.2683,19.509,1.22465e-14,-19.509,-38.2683,-55.557,-70.7107,-83.147,-92.388,-98.0785,-100,-98.0785,-92.388,-83.147,-70.7107,-55.557,-38.2683,-19.509,0,19.509,38.2683,55.557,70.7107,83.147,92.388,98.0785,100,98.0785,92.388,83.147,70.7107,55.557,38.2683,19.509,1.22465e-14,-19.509,-38.2683,-55.557,-70.7107,-83.147,-92.388,-98.0785,-100,-98.0785,-92.388,-83.147,-70.7107,-55.557,-38.2683,-19.509).
min = -100, max = 100, mean = 0, std = 70.9885, coords_min = (24,0,0,0), coords_max = (8,0,0,0).
[gmic]./ End G'MIC interpreter.
Cycle starts at the zero crossing. As @David_Tschumperle confirmed, to phase shift, add to (or subtract from) the first argument math expression.