System object: phased.RectangularWaveform
Package: phased

Samples of rectangular pulse waveform


Y = step(sRFM)
Y = step(sRFM,prfidx)


Y = step(sRFM) returns samples of a rectangular pulse in the column vector Y.

Y = step(sRFM,prfidx), uses the prfidx index to select the PRF from the predefined vector of values specified by in the PRF property. This syntax applies when you set the PRFSelectionInputPort property to true.

    Note:   The object performs an initialization the first time the step method is executed. This initialization locks nontunable properties and input specifications, such as dimensions, complexity, and data type of the input data. If you change a nontunable property or an input specification, the System object™ issues an error. To change nontunable properties or inputs, you must first call the release method to unlock the object.


expand all

Create Rectangular Waveform Pulse

Construct a 10 microseconds rectangular pulse with a pulse repetition interval of 100 microseconds.

Pulsewidth = 10e-6;
PRI = 100e-6;
sRFM = phased.RectangularWaveform('PulseWidth',Pulsewidth,...
wav = step(sRFM);
xlabel('Time (\mu sec)')

Create Rectangular Pulses with Variable PRF

Construct rectangular waveforms with two pulses each. Set the sample rate to 1 MHz, a pulse width of 50 microseconds, and a duty cycle of 20%. Vary the pulse repetition frequency.

Set the sample rate and PRF. The ratio of sample rate to PRF must be an integer.

fs = 1e6;
PRF = [10000,25000];
sRFM = phased.RectangularWaveform('OutputFormat','Pulses','SampleRate',fs,...
    'DurationSpecification','Duty Cycle','DutyCycle',.2,...

Obtain and plot the rectangular waveforms. For the first call to the step method, set the PRF to 10kHz using the PRF index. For the next call, set the PRF to 25 kHz. For the final call, set the PRF to 10kHz.

wav = [];
wav1 = step(sRFM,1);
wav = [wav; wav1];
wav1 = step(sRFM,2);
wav = [wav; wav1];
wav1 = step(sRFM,1);
wav = [wav; wav1];
nsamps = size(wav,1);
t = [0:(nsamps-1)]/sRFM.SampleRate;
xlabel('Time (\mu sec)')

Was this topic helpful?