# How do you make a square pulse train in Matlab?

## How do you make a square pulse train in Matlab?

y = pulstran( t , d , func ) generates a pulse train based on samples of a continuous function, func . y = pulstran( t , d , func , fs ) uses a sample rate of fs . y = pulstran( t , d , p ) generates a pulse train that is the sum of multiple delayed interpolations of the prototype pulse in vector p .

What is a square wave pulse train?

The square wave, also called a pulse train, or pulse wave, is a periodic waveform consisting of instantaneous transitions between two levels. The square wave is sometimes also called the Rademacher function.

How do you make a sawtooth wave in Matlab?

Description. x = sawtooth( t ) generates a sawtooth wave with period 2π for the elements of the time array t . sawtooth is similar to the sine function but creates a sawtooth wave with peaks of –1 and 1.

### What is the equation of a square wave?

Here, T is the period of the square wave and f is its frequency, which are related by the equation f = 1/T.

How do you create a pulse?

In general, generators for pulses with widths over a few microseconds employ digital counters for timing these pulses, while widths between approximately 1 nanosecond and several microseconds are typically generated by analog techniques such as RC (resistor-capacitor) networks or switched delay lines.

What is the difference between pulse and square wave?

A square wave is a certain kind of pulse wave – one where the positive portion of its cycle equals the negative portion. Also called a “50% duty cycle”. If the two halves are not equal, it’s generically a pulse wave.

## What is square in Matlab?

x = square( t ) generates a square wave with period 2π for the elements of the time array t . square is similar to the sine function but creates a square wave with values of –1 and 1. The duty cycle is the percent of the signal period in which the square wave is positive.

Is a square wave AC or DC?

The 240 volt mains power supplied by the electricity grid is AC (Alternating Current). “Square wave” is the term used when the electricity has a constant force, such as it has with DC but switches direction more or less instantly at the same kind of frequency as the normal grid supply (at 50 times per second).