A triangle wave is a signal with amplitude increasing like a ramp for half a cycle and amplitude decreasing like a ramp for the other half a cycle. There is not a function in Matlab called triangle. However, a triangle wave can be synthesized by modifying the sawtooth function. The basic syntax for using the function is the following:

 

[y] = sawtooth(2 * pi * f * t,0.5)

 

Input Variables:

f – frequency of the signal (scalar in Hz)

t – an array of time samples for a signal.

0.5 – for width where half the cycle is increasing amplitude and half the cycle is decreasing amplitude.

 

Output Variable:

y – an array containing a triangle-wave signal.

 

Further documentation for the function is available here.

 

 

Now let’s look at another test signal called a impulse train.

Receive Updates

No spam guarantee.