EngeePhased.LinearFMWaveform
Linear Frequency Modulated (LFM) signal.
Library |
|
Block |
Description
The LinearFMWaveform system object creates a pulse signal with LFM. To produce the signal, perform the following steps:
-
Define and configure the modulation waveform.
-
Call step to generate the signal according to the properties of EngeePhased.LinearFMWaveform. The behaviour of step is specific to each object in the toolbar.
Instead of usage of the step method to perform an operation defined by a System object, you can call the object with arguments as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations. If the only argument to the step method is the System object itself, replace y = step(obj) with y = obj() .
|
Syntax
The constructor of a system object can be called in the following ways:
-
object = EngeePhased.LinearFMWaveform
creates an LFM signal system object. The object generates pulses with a LFM waveform.Example:
target = EngeePhased.LinearFMWaveform
-
object = EngeePhased.LinearFMWaveform(Name,Value)
creates an LFM signal object, with each specified property Name (name) set to the specified Value (value). You can specify additional arguments as a name-value pair in any order (Name1
,Value1
,…,NameN
,ValueN
).Example:
target = EngeePhased.LinearFMWaveform(OutputFormat=Pulses, CoefficientsOutputPort=true)
Properties
SampleRate — sampling rate
`1e6 (By default).
Details
The sampling frequency of the signal, specified as a positive scalar. The ratio of sampling frequency to pulse repetition frequency (PRF) must be a positive integer - each pulse must contain an integer number of samples.
The units of measurement are hertz.
DurationSpecification -
method of setting the pulse duration
Pulse width (By default)
| Duty cycle
Details
The method for setting the pulse width, specified as Pulse width
or Duty cycle
. This property defines the method of setting the pulse width. When you set this property to Pulse width
, you set the pulse width 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 inverse of the Duty Cycle divided by PRF.
PulseWidth -
pulse width
`50e-6 (by default).
Details
Specify the duration of each pulse (in seconds) as a positive scalar. The value must satisfy the parameters PulseWidth < = 1./PRF
.
DutyCycle -
inverse of the signal rate
`0.5 (by default).
Details
The inverse value of the duty cycle, specified as a scalar from 0
to 1
exclusively. This property applies if the DurationSpecification property is set to Duty cycle
. The pulse width is equal to the value of the DutyCycle property divided by the value of the PRF property.
PRF -
pulse repetition rate
10e3 (By default)
Details
The pulse repetition frequency, PRF, specified as a scalar or string vector. The pulse repetition interval, PRI, is the inverse of the pulse repetition frequency, PRF. The PRF must satisfy these constraints:
-
The product of PRF and PulseWidth must be less than or equal to one. This condition expresses the requirement that the pulse width be less than one pulse repetition interval. For a phase-encoded waveform, the pulse width is equal to the product of the chip width and the number of chips.
-
The ratio of the sampling rate to any element of PRF must be an integer. This condition expresses the requirement that the number of samples in one pulse repetition interval be an integer.
You can select the PRF
value using the property settings alone or using the property settings in combination with the prfidx input argument of the step method.
-
If PRFSelectionInputPort is
false
, you set PRF using properties only. You can:-
implement a constant PRF by specifying PRF as a positive real scalar.
-
implement a stepped PRF by specifying PRF as a vector of strings with positive real values. But this time, execute the step method to select PRF by passing an argument specifying the index in the vector PRF.
-
-
When PRFSelectionInputPort is
true
, you can implement a selectable PRF by specifying PRF as a vector of strings with positive real values. But this time, when you execute the step method, select PRF by passing an argument specifying the index in the PRF vector.
In all cases, the number of output samples is fixed if the OutputFormat property is set to Samples
. By usage of the PRF variable and setting the OutputFormat property to Pulses
the number of samples may change.
The units of measurement are hertz.
PRFSelectionInputPort -.
PRF authorised selection input
true
| false (by default)
Details
Enables the PRF selection input specified as true
or false
. When this property is set to false
, the step method uses the values set in the PRF property. When this property is set to true
, an index argument is passed to the step method to select a value from the PRF vector.
SweepBandwidth -
LFM signal frequency deviation
1e5 (By default)
Details
Frequency deviation (in hertz) as a positive scalar. The value by default corresponds to 100
kHz.
SweepDirection
modulation direction
Up (By default)
| Down
Details
Specify the direction of the linear FM sweep as one of Up
or Down
.
SweepInterval -
modulation interval location
Positive
| Symmetric
Details
If you set this property to Positive
, the oscillogram will sweep in the interval from 0
to B
, where B
is the value of the SweepBandwidth property. If you set this property to Symmetric
, the oscillogram will unfold in the interval from -B/2
to B/2
.
Envelope -
envelope function of the LFM signal
Rectangular (by default)
| Gaussian
Details
Specify the envelope function as one of Rectangular
or Gaussian
.
FrequencyOffsetSource — frequency offset source
Property (By default)
| Input port
Details
Frequency offset source for the oscillogram specified as Property
or Input port
.
-
If you set this property to
Property
, the offset is determined by the value of the property FrequencyOffset. -
When you set this property to
Input port
, FrequencyOffset is determined by the input argument freqoffset.
FrequencyOffset — frequency offset
0 Hz (By default)
| scalar
Details
Frequency offset in Hz, specified as a scalar.
Dependencies
This property is applied if the FrequencyOffsetSource property is set to Input port
.
OutputFormat -
output format
Pulses (by default)
| `Samples `
Details
Specify the output format as Pulses
or Samples
. When the OutputFormat property is set to Pulses
, the output of the step method takes the form of several pulses, specified by the NumPulses property value. The number of samples per pulse can change if you change the pulse repetition rate during the simulation.
If the OutputFormat property is set to Samples
, the output of the step method will be in the form of multiple samples. In this case, the number of output samples is equal to the value of the NumSamples property and is fixed.
NumSamples -
number of samples of the signal at the output
`100 (By default).
Details
Specify the number of data samples at the output of the step method as a positive integer. This property applies only if the OutputFormat property is set to Samples
.
NumPulses -
number of output pulses
100 (By default)
Details
Specify the number of samples in the step method output as a positive integer. This property applies only if the OutputFormat property is set to Samples
.
PRFOutputPort -
switch on PRF output
true
| false (by default)
Details
Set this property to true
to output PRF for the current pulse using the step method argument.
Dependencies
This property can only be used if the OutputFormat property is set to Pulses
.
CoefficientsOutputPort -
switch on the output port of the matched filter coefficients
true
| false (by default)
Details
Enable the matched filter coefficients output port, specified as false
or true
. When this property is set to false
, the object does not provide the output of matched filter coefficients used during simulation. When this property is set to true
, the object provides the output of the matched filter coefficients used during the simulation.
Examples
Plot LFM Waveform and Spectrum
Create and plot an upsampled LFM pulse waveform. The sampling frequency is 500 kHz, the frequency deviation is 200 kHz, and the pulse width is 1 millisecond (equal to the pulse repetition interval).
fs = 500e3
sLFM = EngeePhased.LinearFMWaveform(
SampleRate=fs,
SweepBandwidth=200e3,
PulseWidth=1e-3,
PRF=1e3
);
Obtain and then plot the real part of the LFM waveform.
lfmwav = step(sLFM);
nsamp = size(lfmwav,1);
t = [0:(nsamp-1)]/fs;
plot(t*1000,real(lfmwav))
xlabel('Time (millisec)')
ylabel('Amplitude')
grid
Construct the Fourier transform of a complex signal.
using FFTW
nfft = nextpow(2,nsamp)
new_len = nextpow(2,nsamp)
lfmwav = [lfmwav;zeros(new_len - length(lfmwav))]
Z = fft(lfmwav,1)
fr = (0:(nfft/2-1)) /nfft*fs
plot(fr./1000,abs.(Z[1:Int(nfft/2)]),lab="" )
xlabel!("Частота кГц")
ylabel!("Амплитуда")
Construct a spectrogram of the function with a window size of 64 samples and 50 per cent overlap.
import DSP:hamming
nfft1 = 64
nov = floor(Int,0.5*nfft1)
imag1 = spectrogram(real.(lfmwav),hamming(nfft1),nov,nfft1;fs=fs,freqloc="yaxis")
xlabel!("Время, с")
plot!(imag1,colorbar_title = "СПМ (дБ/Гц)")
ylabel!("Частота, Гц")
This graph shows the increase in frequency of the signal.