A function that takes a frequency, pulse width, and time, and returns the square wave value.
Generates a square wave signal.
Frequency of the square wave.
Pulse width (between 0 and 1). Defaults to 0.5.
Time in seconds.
Generates a square wave signal.
Frequency of the square wave.
Time in seconds.
Generates a stateful square wave signal.
(State is necessary to keep track of the phase of the wave over time, which is crucial for generating continuous waveforms without clicks or pops.)