What is the most efficient way to produce an array of 100 numbers that form the shape of the triangle wave below, with a max/min amplitude of 0.5?
Triangle waveform in m
Triangle is absolute value of sawtooth.
from scipy import signal time=np.arange(0,1,0.001) freq=3 tri=np.abs(signal.sawtooth(2 * np.pi * freq * time))