The sawtooth wave, called the "castle rim function" by Trott, is the periodic function given by S(x) = A frac(x/T + ϕ), where frac(x) is the fractional part frac(x) congruent x - ⌊x⌋, A is the amplitude, T is the period of the wave, and ϕ is its phase. (Note that Trott 2004, p. 228 uses the term "sawtooth function" to describe a triangle wave.) It therefore consists of an infinite sequence of truncated ramp functions concatenated together. The sawtooth wave is implemented in the Wolfram Language as SawtoothWave[x].