typestar

Waves know their axis in Igor Pro

The point number p is not the x value: SetScale is what ties a wave to real units.

Make/O/N=200/D signal
SetScale/P x, 0, 0.001, "s", signal
signal = exp(-x / 0.05) * sin(2 * pi * 60 * x)

SetScale d, 0, 0, "V", signal

Variable start = DimOffset(signal, 0)
Variable step = DimDelta(signal, 0)
Print start, step, WaveUnits(signal, 0)

How it works

  1. SetScale/P sets a starting x and a step; /I sets the first and last.
  2. In a wave assignment x is the scaled position and p is the point index.
  3. DimOffset and DimDelta read the scaling back out.

Keywords and builtins used here

The run, in numbers

Lines
9
Characters to type
250
Tokens
77
Three-star pace
70 tpm

At the three-star pace of 70 tokens a minute, this run takes about 66 seconds.

Type this snippet

Step 2 of 4 in Waves, step 2 of 18 in Language basics.

← Previous Next →