# pulsetrain (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info Download Help (Windows Only)

Owning Class: waveform generation

Requires: MathScript RT Module

## Syntax

f = pulsetrain(a, b, c, d, e)

f = pulsetrain(a, b, c, d)

f = pulsetrain(a, b, c, e)

f = pulsetrain(a, b, c)

Legacy Name: `pulstran`

## Description

Generates a pulse train from a sampled prototype pulse.

Examples

## Inputs

Name Description
a Specifies the sampling time. a is a real array.
b Specifies the offsets. b is a real array or a 2D array with 2 columns. If b is a 1D array, f = c(a-b(1))+c(a-b(2))+... . Otherwise, f = b(1, 2)*c(a-b(1, 1))+b(2, 2)*c(a-b(2, 1))+... .
c Specifies the sampled prototype pulse. c is a real array.
d Specifies the alternative interpolation method. d is a string that accepts the following values.

 'cubic' Performs cubic Hermite interpolation. 'linear' (default) Performs linear interpolation. 'nearest' Sets the interpolated value to the nearest data point. 'spline' Performs spline interpolation.
e Specifies the sampling rate of c. e is a positive number. The default is 1.

## Outputs

Name Description
f Returns the sampled pulse train.

## Details

The following table lists the support characteristics of this function.

 Supported in the LabVIEW Run-Time Engine Yes Supported on RT targets Yes Suitable for bounded execution times on RT Not characterized

## Examples

X1 = -1:0.1:1;
Y1 = tripulse(X1, 2, 0.2);
X2 = 0:0.1:20;
D = 0:5:20;
D = [D; 1:length(D)]';
Y2 = pulsetrain(X2, D, Y1, 10);
plot(X2, Y2)