# How do I generate a pulse train which starts at the origin using functions

## How do I generate a pulse train which starts at the origin using functions in the Signal Processing Toolbox 6.10 (R2008b) ?

I am trying to generate a train of rectangular pulses. I want the train to start at the origin (t=0) and would like to know how to do this using functions in **Signal Processing Toolbox** 6.10 (R2008b).

# ANSWER

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

his can be done using the PULSTRAN function in the **Signal Processing Toolbox**.

As mentioned in the Signal Processing Toolbox 6.10 (R2008b) documentation, the default ‘rectpuls’ function extends from -0.5 to 0.5. Additionally, the PULSTRAN function returns “func(t-d(1))+func(t-d(2)) +…”, where ‘t’ and ‘d’ are the time and delay vectors respectively. Thus, the number of “pulses” in the “train” will be the same as the number of elements in ‘d’.

In order to generate pulses that do not overlap, the elements of ‘d’ must be greater than the pulse width (which is 1 by default for the ‘rectpuls’ function). Therefore, as an example, the first term should be “func(t-0.5)” so that the train of rectangular pulses starts at “t=0”. In other words, the first element of ‘d’ must be half the width of the function (i.e. ‘rectpuls’) if the pulse train is to start at “t=0”.

**SEE COMPLETE ANSWER CLICK THE LINK**