Engee documentation

EngeePhased.LinearFMWaveform

A linear frequency modulated signal generator.

Library

EngeePhased

Block

Linear FM Waveform

Description

To generate a linear frequency modulation (LFM) signal, follow these steps:

  1. Create an object EngeePhased.LinearFMWaveform and set its properties.

  2. Call the object with arguments as if it were a function.

To learn more about how to work with system objects, see Engee System Objects.

Syntax

Creation

  • waveform = EngeePhased.LinearFMWaveform() — creates a system object waveform pulse generator with LFM.

  • waveform = EngeePhased.LinearFMWaveform(Name=Value) — creates a system object waveform an LFM pulse generator with the specified property "Name", set to the specified value Value. You can specify additional properties as name-value pairs in any order (Name1=Value1,…​,NameN=ValueN).

Using

  • Y = waveform() — returns pulse counts from the LCHM in the form of a column vector Y. The Y argument can contain either a certain number of pulses or a certain number of samples.

  • Y = waveform(prfidx) — uses the prfidx index to select the pulse repetition rate (PRF) from a predefined vector of values set by the PRF property. This syntax applies if the PRFOutputPort property is set to true.

  • Y = waveform(freqoffset) — uses freqoffset to generate a frequency offset signal. Use this syntax in cases where it is necessary to dynamically update the frequency of transmitted pulses. This syntax is used if for the property FrequencyOffsetSource value set "Input port".

  • Y,prf = waveform(_) — also returns the current pulse repetition rate prf. To use this syntax, set the PRFOutputPort property to true, and for the property OutputFormat value "Pulses".

  • Y,coeff = waveform(_) — also returns the coefficients of the matched coeff filter for the current pulse. To use this syntax, set the [Property:CoordicientsOutputPort] value true.

You can combine optional input and output arguments if properties are specified that include them. Optional inputs and outputs should be listed in the same order as the properties that include them. For example, Y,prf,coeff = waveform(prfidx,freqoffset).

Arguments

Input arguments

prfidx — pulse repetition rate index

+ a positive integer

Details

Pulse Repetition rate index (PRF), set as a positive integer. The index identifies entries in the PRF property.

Dependencies

To use this argument, set the PRFOutputPort property to true.

freqoffset — frequency offset, Hz

+ scalar

Details

The frequency offset specified as a scalar. The offset allows you to generate a signal with a frequency offset. Use this argument in cases where it is necessary to dynamically update the frequency of the transmitted pulse.

Dependencies

To use this argument, set the property to FrequencyOffsetSource value "Input port".

Типы данных

Float64

Output arguments

Y — pulse signal

+ column vector

Details

The output signal returned as a column vector.

Типы данных

Float64

prf — pulse repetition rate
scalar

Details

The current pulse repetition rate in Hz, returned as a scalar.

Dependencies

To use this argument, set the PRFOutputPort property to true, and for the property OutputFormat value "Pulses".

Типы данных

Float64

Support for complex numbers

yes

coeff — coefficients of the matched filter

+ vector | the matrix

Details

Coefficients of the matched filter returned as a complex vector of size or a complex matrix of size .

Dependencies

To use this argument, set the property to [Property:CoordicientsOutputPort] value true.

Типы данных

Float64

Support for complex numbers

yes

Features

# NumSamples — number of samples of the output signal
Real number

Details

The number of samples of the output signal, set as a positive integer.

Default value — 100.

Dependencies

To use this property, set the OutputFormat value "Samples".

# SweepInterval — frequency deviation interval
String

Details

The frequency deviation interval, set as "Positive" (by default) or "Symmetric":

  • "Positive" — the frequency of the signal will vary from 0 before B, where B — the width of the deviation band in the SweepBandwidth.

  • "Symmetric" — the frequency of the signal will vary from −B/2 before B/2.

# OutputFormat — output signal format
String

Details

The format of the output signal as "Pulses" (by default) or "Samples":

  • If you set the value for this property "Pulses", then the output of the block consists of several pulses. The number of pulses is the value of the property NumPulses.

  • If you set the value for this property "Samples", then the output of the block consists of several samples. The number of samples is the value of the [Property:numSamples] property.

# FrequencyOffsetSource — The source of the frequency offset setting
String

Details

The source of the frequency offset setting, set as "Property" (by default) or "Input port":

  • If the value is set to "Property", then the offset is determined by the value of the FrequencyOffset.

  • If the value is set to "Input port", the offset is determined by the value of the FreqOffset argument.

# DutyCycle — fill factor
Real number

Details

A dimensionless fill factor specified as a scalar in the range [0, 1]. The pulse width is the value of the DutyCycle property divided by the value of the PRF property.

Default value — 0.5.

Dependencies

To use this property, set the DurationSpecification property to "Duty cycle".

# SweepDirection — frequency deviation direction of the frequency modulation range
String

Details

The direction of frequency deviation of a linear frequency modulated signal:

  • "Up" (default) — increase the frequency.

  • "Down" — frequency reduction.

# Envelope — the envelope of a frequency-modulated signal
String

Details

The envelope of a linear frequency modulated signal, defined as "Rectangular" (by default) or "Gaussian".

# NumPulses — number of output signal pulses
Real number

Details

The number of pulses of the output signal, set as a positive integer.

Default value — 1.

Dependencies

To use this property, set the OutputFormat value "Pulses".

# SweepBandwidth — frequency deviation of the LFM signal
Real number

Details

The bandwidth of the FM signal, set as a positive scalar. The units of measurement are Hz.

Default value — 10e4.

# PRF — pulse repetition rate
Real number

Details

Pulse repetition rate (PRF), set as a scalar or string vector. The units of measurement are Hz. The pulse repetition period (PRI) is the inverse of the pulse repetition rate (PRF). The PRF value must satisfy the following constraints:

  • The product of PRF and PulseWidth must be less than or equal to one. This condition requires that the pulse width be less than one PRI. For a phase-coded signal, the pulse duration is equal to the product of the duration of one chip and the number of chips.

  • Relation SampleRate k PRF must be an integer. This condition requires that the number of samples in one PRI be an integer.

The PRF value can be set using only the PRF property values or the property values combined with the prfidx input argument.

  • If PRFOutputPort has a value false, PRF is set only using the PRF properties. You can:

    • Implement a constant PRF by specifying the PRF property as a positive real scalar value.

    • Implement a discrete PRF by specifying the PRF property as a vector string with positive real elements. Each object call uses consecutive elements of this vector as a PRF. As soon as the object reaches the last element of the vector, it cyclically continues the process with the first element of the vector.

  • When PRFOutputPort has a value true you can set the value of PRF using the PRF property in combination with the input argument prfidx. You implement a selectable PRF by specifying the PRF property as a vector string with positive real elements. When executing an object, the PRF is selected using the index specified in the input argument prfidx to index the PRF vector.

In all cases, the number of output samples is fixed if you set the property to OutputFormat value "Samples". When using a variable pulse repetition rate (PRF) and setting for the property OutputFormat values "Pulses" the number of counts may vary.

Default value — 10e3.

# CoefficientsOutputPort — enable output of matched filter coefficients
Logical

Details

Enable or disable the output of the coefficients of the matched filter by specifying the value false (by default) or true. Set this property to true to enable the output of matched filter coefficients for the waveform used during the simulation.

# PulseWidth — pulse duration
Real number

Details

The pulse duration, set as a positive scalar. The value must meet the condition PulseWidth < 1/PRF. The units of measurement are seconds.

Default value — 50e−6.

Dependencies

To use this property, set the DurationSpecification property to "Pulse width".

# SampleRate — sampling rate
Real number

Details

The sampling frequency of the signal, set as a positive scalar. The ratio of the sampling rate to the pulse repetition rate must be a positive integer, so the number of samples in each pulse must be an integer. The units of measurement are Hz.

Default value — 100e3.

# DurationSpecification — pulse duration setting method
String

Details

The method of setting the pulse duration in the form "Pulse width" (by default) or "Duty cycle":

  • "Pulse width" — the pulse duration is set using the property PulseWidth.

  • "Duty cycle" — the pulse duration is calculated from the values of the properties PRF and DutyCycle. The pulse width is equal to the value of the property DutyCycle divided by the value of the property PRF.

# PRFOutputPort — enable PRF output
Logical

Details

If you set the value for this property true. you can pass an index argument to an object to select a predefined value from a vector of property values PRF. If you set the value for this property false (by default), the object will use the PRF property to define the PRF sequence used in the simulation.

Dependencies

To use this property, set the OutputFormat value "Pulses".

# FrequencyOffset — frequency offset
Real number

Details

The frequency offset specified as a scalar. The units of measurement are Hz.

Default value — 0.

Dependencies

To use this property, set the FrequencyOffsetSource value "Property".

Methods

Common to all system objects

step!

Run the system object operation algorithm

release!

Allow changing the value of a system object property

reset!

Resetting the internal states of a system object

Special for system objects of signal generators

bandwidth

Bandwidth of the signal getMatchedFilter: Matched filter coefficients obtained from the signal

plot

Plotting the pulse signal

Examples

Generation of signals with linear frequency modulation

Details

Let’s form an LFM signal with a pulse duration 100 iss, frequency of repetition 5 kHz, the number of pulses in the sequence 5, the central frequency 10 kHz and frequency deviation 200 kHz.

Initialize the parameters.

fs = 1e6 # Частота дискретизации, Гц
dur_spec = "Pulse width" # Метод формирования длительности импульсов
pw = 10.e-5 # длительность импульса, с
prf = 5_000 # частота следования импульсов (ЧСИ)

freq_off_type = "Property" # способ задания параметров "Property" — в параметрах СО
freq_off = 10_000 # значение начальной частоты спектра, Гц
out_type = "Pulses" # тип выходного сигнала "Pulses" — по импульсам

num_pulse = 5 # количество импульсов
prf_out = false # выключение выхода ЧСИ
coeff_mf_out = false # выключение выхода коэффициентов СФ

band = 200e3 # ширина спектра ЛЧМ-сигнала
sw_dir = "Up" # направление изменения частоты
SweepInterval = "Positive"; # тип пилы ["Positive","Symmetric"]

Let’s use EngeePhased.LinearFMWaveform to create a *linearFM*probing signal system object.

linearFM = EngeePhased.LinearFMWaveform(
    SampleRate = fs, # Частота дискретизации, Гц
    DurationSpecification = dur_spec, # Метод формирования длительности импульсов
    PulseWidth = pw, # длительность импульса
    PRF = prf, # частота следования импульса
    SweepDirection = sw_dir, # направление изменения частоты
    FrequencyOffsetSource = freq_off_type, # источник задания центральной частоты
    FrequencyOffset = freq_off, # центральная частота
    OutputFormat = out_type, # тип выхода
    NumPulses = num_pulse, # количество импульсов
    PRFOutputPort = prf_out, # ЧСИ
    CoefficientsOutputPort = coeff_mf_out # выключение выхода коэффициентов СФ
);

Making a call to the system object EngeePhased.LinearFMWaveform using the linearFM variable:

linearFM_sig = linearFM();

Using the function plot Let’s construct an oscilloscope in the form of an IQ component, a module, and a phase of the signal.

# построение IQ-компонент
t_grid = range(start = 0,step = 1/fs,length = length(linearFM_sig)) * 1e6 # сетка времени, мкс
fig1 = plot(t_grid,real.(linearFM_sig),title = "синфазная составляющая",lab="",ylab="Амплитуда")
fig2 = plot(t_grid,imag.(linearFM_sig),title = "квадратурная составляющая",lab="",xlab = "Время, мкс",ylab="Амплитуда");

plot(fig1,fig2,layout = (2,1))

object phased linear waveform 2 en

# построение модуля и фазы сигнала
fig3 = plot(t_grid,abs.(linearFM_sig),title = "Модуль комплексного сигнала",lab="",ylab="Амплитуда");
fig4 = plot(t_grid,angle.(linearFM_sig)*180/pi,title = "Аргумент комплексного сигнала",lab="",xlab = "Время, мкс",ylab="Фаза, град.");

plot(fig3,fig4,layout = (2,1))

object phased linear waveform 3 en

The main characteristic of the signal is the frequency spectrum and the spectrogram. Let’s use the built-in function periodogram.

# расчет спектра сигнала
spec_LFM,f = EngeePhased.Functions.periodogram(
    linearFM_sig, # исходный сигнал
    EngeeDSP.Functions.hamming(size(linearFM_sig)...),
    8192; # длина частоты дискретизации
    out = :data, # тип выхода
    fs = fs, # частота дискретизации
    spectrumtype = "power" # тип спектра
);

Visualize the result using the function plot.

plot(
    f * 1e-3,
    EngeePhased.Functions.mag2db.(spec_LFM),
    lab="", xlab = "Частота, кГц",
    ylab = "Мощность, дБВт",
    title = "Спектр сигнала"
)

object phased linear waveform 4 en

The spectrum is centered around a central frequency , with a stripe . To calculate the spectrogram, we use the built-in function spectrogram.

# расчет спектрограммы
spectgm_lfm,f1,t1 = EngeeDSP.Functions.spectrogram(
    real.(linearFM_sig);
    nfft = 512, # длина БПФ
    window = EngeeDSP.Functions.hamming(64),
    noverlap = 60, # перекрытие окна
    spectrumtype = "power",  # тип спектра — по мощности
    freqrange = "onesided", # диапазон спектра — односторонний
    out = :data, # тип выхода — массив данных
    fs = fs # частота дискретизации
);

We visualize the result of the spectrogram calculation using the function heatmap.

# построение спектрограммы
heatmap(
    t1[:]*1e6,f1[:]*1e-3,
    abs.(spectgm_lfm),color = :jet,
    xlab = "Время, мкс",
    ylab = "Частота Доплера, кГц",
    ylims = (0,200)
)

object phased linear waveform 5 en

Algorithms

The analytical recording of the LFM signal has the form:

where

  •  — pulse duration;

  • - is the rate of frequency increase, where  — frequency deviation;

  •  — the amplitude;

  •  — the initial frequency.

To generate a linear frequency modulated signal, the following parameters must be set:

  • filter sampling rate ;

  • pulse duration ;

  • pulse repetition rate ;

  • number of pulses ;

  • the central frequency of the signal ;

  • frequency deviation .

object phased linear waveform 1 en

Literature

  1. Levanon, N. and E. Mozeson. Radar Signals. Hoboken, NJ: John Wiley & Sons, 2004.

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