Documentation

phased.RectangularWaveform System object

Package: phased

Rectangular pulse waveform

Description

The RectangularWaveform object creates a rectangular pulse waveform.

To obtain waveform samples:

  1. Define and set up your rectangular pulse waveform. See Construction.

  2. Call step to generate the rectangular pulse waveform samples according to the properties of phased.RectangularWaveform. The behavior of step is specific to each object in the toolbox.

Construction

H = phased.RectangularWaveform creates a rectangular pulse waveform System object™, H. The object generates samples of a rectangular pulse.

H = phased.RectangularWaveform(Name,Value) creates a rectangular pulse waveform object, H, with each specified property Name set to the specified Value. You can specify additional name-value pair arguments in any order as (Name1,Value1,...,NameN,ValueN).

Properties

SampleRate

Sample rate

Signal sample rate, specified as a positive scalar. Units are Hertz. The ratio of sample rate to pulse repetition frequency (PRF) must be a positive integer — each pulse must contain an integer number of samples.

Default: 1e6

DurationSpecification

Method to set pulse duration

Method to set pulse duration (pulse width), specified as 'Pulse width' or 'Duty cycle'. This property determines how you set the pulse duration. When you set this property to 'Pulse width', then you set the pulse duration directly using the PulseWidth property. When you set this property to 'Duty cycle', you set the pulse duration from the values of the PRF and DutyCycle properties. The pulse width is equal to the duty cycle divided by the PRF.

Default: 'Pulse width'

PulseWidth

Pulse width

Specify the length of each pulse (in seconds) as a positive scalar. The value must satisfy PulseWidth <= 1./PRF.

Default: 50e-6

DutyCycle

Waveform duty cycle

Waveform duty cycle, specified as a scalar from 0 through 1, inclusive. This property applies when you set the DurationSpecification property to 'Duty cycle'. The pulse width is the value of the DutyCycle property divided by the value of the PRF property.

Default: 0.5

PRF

Pulse repetition frequency

Pulse repetition frequency (PRF), specified as a scalar or a row vector. Units are hertz. The pulse repetition interval (PRI) is the inverse of the PRF.

  • When PRFSelectionInputPort is false, you can

    • implement a constant PRF by specifying PRF as a positive real-valued scalar.

    • implement a staggered PRF by specifying PRF as a row vector with positive real-valued entries. When PRF is a vector, the each call to the step method produces pulses that use successive elements of the vector as the PRF. If the last element of the vector is reached, the process continues cyclically with the first element of the vector.

  • When PRFSelectionInputPort is true, you can implement a selectable PRF by specifying PRF as a row vector with positive real-valued entries. Then in each call to the step syntax, pass in an index to an entry in the desired PRF vector.

The value of this property must satisfy these constraints:

  • The PRF must be less than or equal to 1/PulseWidth. This is equivalent to the requirement that the pulse width is less than or equal to the PRI. For the phase-coded waveform, the pulse width is the product of the chip width and number of chips.

  • The ratio of sample rate to PRF must be an integer — the number of samples in a pulse must be an integer

Default: 10e3

PRFSelectionInputPort

Enable PRF selection input

Enable the PRF selection input, specified as true or false. When you set this property to false, the step method uses the values set in the PRF property in order. When you set this property to true, you can pass an additional argument into the step method to select any value from the PRF vector.

Default: false

OutputFormat

Output signal format

Specify the format of the output signal as one of 'Pulses' or 'Samples'. When you set the OutputFormat property to 'Pulses', the output of the step method is in the form of multiple pulses. In this case, the number of pulses is the value of the NumPulses property.

When you set the OutputFormat property to 'Samples', the output of the step method is in the form of multiple samples. In this case, the number of samples is the value of the NumSamples property.

Default: 'Pulses'

NumSamples

Number of samples in output

Specify the number of samples in the output of the step method as a positive integer. This property applies only when you set the OutputFormat property to 'Samples'.

Default: 100

NumPulses

Number of pulses in output

Specify the number of pulses in the output of the step method as a positive integer. This property applies only when you set the OutputFormat property to 'Pulses'.

Default: 1

Methods

bandwidthBandwidth of rectangular pulse waveform
cloneCreate rectangular waveform object with same property values
getMatchedFilterMatched filter coefficients for waveform
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs from step method
isLockedLocked status for input attributes and nontunable properties
plotPlot rectangular pulse waveform
releaseAllow property value and input characteristics changes
resetReset states of rectangular waveform object
stepSamples of rectangular pulse waveform

Examples

expand all

Plot Rectangular Waveform and Spectrum

Create and plot a rectangular pulse waveform object and then plot its spectrum.

Plot the waveform

Create and plot a pulse waveform. The sample rate is 500 kHz, the pulse width is 0.1 millisecond. The pulse repetition interval is twice the pulse duration.

fs = 500e3;

Create the rectangular waveform System object™.

sWF = phased.RectangularWaveform('SampleRate',fs,'PulseWidth',1e-4,'PRF',5000.0);

Use the step method to obtain the waveform. Then, plot the waveform.

rectwav = step(sWF);
nsamp = size(rectwav,1);
t = [0:(nsamp-1)]/fs;
plot(t*1000,real(rectwav))
xlabel('Time (millisec)')
ylabel('Amplitude')
grid

Plot the spectrum

Compute the Fourier transform of the complex signal. Then show the spectrum.

nfft = 2^nextpow2(nsamp);
Z = fft(real(rectwav),nfft);
fr = [0:(nfft/2-1)]/nfft*fs;
plot(fr/1000,abs(Z(1:nfft/2)),'.-')
xlabel('Frequency (kHz)')
ylabel('Amplitude')
grid

Plot the spectrogram

Plot a spectrogram of the function with a window size of 64 samples and 50% overlap. Window the signal with a Hamming function.

nfft1 = 64;
nov = floor(0.5*nfft1);
spectrogram(rectwav,hamming(nfft1),nov,nfft1,fs,'centered','yaxis')

This plot shows the constant frequency of the signal.

Related Examples

References

[1] Richards, M. A. Fundamentals of Radar Signal Processing. New York: McGraw-Hill, 2005.

Introduced in R2012a

Was this topic helpful?