Periodic signals can be generated by obtaining a period and adding shifted versions of this period. Suppose we wish to generate a train of triangular pulses. A period of the signal is x[n] = 0.5(r[n] 2r[n 2] + r[n 4]) where r[n] is the discrete-time ramp signal. Obtain the values of x[n] for 0 ¤ n ¤ 4 and write a script to generate x[n] and the periodic signal y[n]
and plot 4 of the periods.