Engee documentation

Chirp

Generation of a variable frequency cosine wave (chirp).

blockType: ChirpDSP

Path in the library:

/Signal Operations/Sources/Chirp

Description

Block Chirp outputs a cosine-frequency signal with a single amplitude and continuous phase (chirp signal). To set the desired chirp output signal, it is necessary to define an instantaneous frequency function for it, also known as changing the frequency of the output signal. The frequency change can be linear, quadratic, or logarithmic and is repeated once per time by default. Sweep time. Description of the algorithms used by the block Chirp, see in the section Algorithms.

Ports

Output

Port_1 — variable frequency cosine signal (chirp)
scalar | vector

A variable frequency cosine signal (chirp). If the Frequency sweep parameter has modes set Linear, Logarithmic or Quadratic, then the unit outputs a cosine signal with a changing frequency with instantaneous frequency values, set frequency and time parameters. In the mode Swept cosine The unit outputs a cosine signal with a linearly varying instantaneous frequency, which may differ from that specified by the frequency and time parameters.

For more information about how the block calculates the output signal, see Algorithms.

Data types: Float32, Float64

Parameters

Frequency sweep — type of frequency change
Linear (by default) | Swept cosine | Logarithmic | Quadratic

The type of change in the instantaneous frequency of the output signal : Linear, Logarithmic, Quadratic or Swept cosine. For more information, see the sections Frequency change formation and Algorithms.

_ Restrictions_

If it is necessary to receive a signal with a linearly varying frequency, it is recommended to use the value for the Frequency sweep parameter Linear. Although the value is Swept cosine It also gives a signal with a linearly varying frequency, the output signal may have unexpected frequency content.

  • The number of fluctuations during Target time is not necessarily the frequency of Target frequency. This happens because the user-defined frequency change is not an actual frequency change of the output cosine signal, as indicated in the section A method for calculating the output signal for a varying frequency according to the law of cosine. The actual frequency change of the output cosine signal at a given time is shown in the table Values of instantaneous frequency changes.

  • In the mode Swept cosine do not set the parameters so that the value significantly exceeded the values of the Initial frequency and Target frequency parameters. In this case, the actual frequency change of the output cosine signal may be closer to , significantly exceeding the values of the Initial frequency and Target frequency parameters.

Sweep mode — pass frequency change mode:q[<br>] Unidirectional (by default) | Bidirectional

Parameter Sweep mode determines whether the frequency change is unidirectional or bidirectional, which affects the shape of the changing output frequency (see section Frequency change formation). The table describes the characteristics of unidirectional and bidirectional frequency changes.

The value of the Sweep mode parameter Frequency change Characteristics

Unidirectional

  • Lasts for one time Sweep time, .

  • Repeated once a day .

Bidirectional

  • Lasts for twice the time Sweep time, .

  • Repeated once a day .

  • The first half is identical to its unidirectional counterpart.

  • The second half is a mirror image of the first half.

The following diagram shows the linear change in frequency in both modes of change. For information about setting frequency values, see Setting the values of the instantaneous frequency changes.

chirp 1

Initial frequency (Hz) — initial pass frequency:q[<br>] 1000 (default) | scalar

If the Frequency sweep parameter is set to Linear, Quadratic or Swept cosine, the value of Initial frequency (Hz) is the initial frequency chirp output signal. Value of Initial frequency (Hz) is set as a scalar greater than or equal to zero.

If the Frequency sweep parameter is set to Logarithmic, the value of Initial frequency (Hz) one less than the actual value of the initial frequency. Also, in this case, the value of Initial frequency (Hz) must be less than the value of Target frequency.

For more information, see the section Setting the values of the instantaneous frequency changes.

Target frequency (Hz) — target pass frequency value:q[<br>] 4000 (default) | scalar

If the Frequency sweep parameter is set to Linear, Quadratic or Logarithmic, then the target frequency value is the instantaneous frequency output signal at a time Target time, . Value of Initial frequency (Hz) is set as a scalar greater than or equal to zero.

If the Frequency sweep parameter is set to Swept cosine, the value of Target frequency is the instantaneous frequency output signal in the middle of time Target time, .

If the Frequency sweep parameter is set to Logarithmic, then the value of Target frequency must be greater than the value of Initial frequency.

For more information, see the section Setting the values of the instantaneous frequency changes.

Target time (s) — the target value of the pass frequency change time:q[<br>] 1 (default) | scalar

If the Frequency sweep parameter is set to Linear, Quadratic or Logarithmic, the target value of the frequency change time — this is the time it takes for the frequency to reach the Target frequency value, .

If the Frequency sweep parameter is set to Swept cosine, the value of Target time(s) is the time it takes for the frequency to reach the value .

The value of Target time (s) is set as a scalar greater than or equal to zero and less than or equal to the value of Sweep time, .

For more information, see the section Setting the values of the instantaneous frequency changes.

Sweep time (s) — time for changing the pass frequency:q[<br>] 1 (default) | scalar

If the Sweep mode parameter is set to Unidirectional, the time of the frequency change — this is the period during which the frequency changes.

If the Sweep mode parameter is set to Bidirectional, the time of the frequency change — this is half of the period during which the frequency changes.

The value of Target time (s) is set as a scalar greater than or equal to the value of Sweep time, .

Initial phase (rad) — initial value of the pass phase:q[<br>] 0 (default) | scalar

Phase the output cosine signal at a time :

.

Value of Initial phase (rad) is set as a scalar greater than or equal to zero.

Sample time — the sampling period of the output signal
1/8000 (default) | positive scalar

Sample period the output signal. The period of the output frame is , where — the number of samples per frame.

Samples per frame — number of samples per frame
1 (default) | positive scalar

Number of samples per frame for buffering in each output frame, it is set as a positive integer scalar.

Output data type — output data type
Double (by default) | Single

When selecting an option Double the data type will be used Float64, when SingleFloat32.

Calculations using Float64 they will be more accurate than with Float32, but it will require more memory and computing resources.

Float32 It may be more efficient when lower accuracy is required, for example, when storing large amounts of data.

Additional Info

Shaping the frequency change

Controlling the basic form of instantaneous frequency change It is performed using the Frequency sweep and Sweep mode parameters.

Name of the parameter Values to choose from Parameter Description

Frequency sweep

Linear Quadratic Logarithmic Swept cosine

Determines how the frequency changes: linearly, quadratically, logarithmically, or according to the law of cosine.

Sweep mode

Unidirectional Bidirectional

Determines whether the change will be unidirectional or bidirectional.

The following diagram shows the possible frequency variation patterns that can be obtained using the Frequency sweep and Sweep mode parameters.

chirp 2

For information on how to set the frequency values, see Setting the values of the instantaneous frequency changes.

Setting the values of the instantaneous frequency changes

Set the following parameters to adjust the values of the changes in the instantaneous frequency of the output signal:

  • Initial frequency (Hz), ;

  • Target frequency (Hz), ;

  • Target time (s), .

The following table shows the values of the frequency change at certain points in time for all values of the Frequency sweep parameter. For information about formulas used to calculate frequency variation values at other time points, see Algorithms.

Frequency sweep The frequency value at a given time The frequency value at a given time The time value when the frequency value is Target frequency (Hz),

Linear

Quadratic

Logarithmic

Swept cosine

Algorithms

Block Chirp uses one of two formulas to calculate the output signal depending on the setting of the Frequency Sweep parameter.

Equations for calculating the output signal

The following table shows the equations used by the unit to calculate the user-defined frequency change of the output signal. , the output signal of the block and the actual frequency change of the output signal . The only case when the user—defined frequency change of the output signal does not match the actual output sweep is when the Frequency sweep parameter is set to Swept cosine.

The following equations apply only to unidirectional sweeps in which . To derive the equations for other cases, study the table and diagram in the section Frequency change formation.

The above table of equations used by the block contains the following variables:

  • — User-defined frequency change.

  • — the actual frequency change, usually equal to .

  • — the output signal.

  • — the phase of the chirp signal, where and the derivative of the phase: .

  • — the initial value of the phase Initial phase, where .

Frequency sweep CHIRP output signal User-defined frequency change actual frequency change

Linear

Quadratic

The same as for Linear

Logarithmic

The same as for Linear

, where

Not used

Swept cosine

The same as for Linear

The same as for Linear

A method for calculating the output signal for linear, quadratic and logarithmic frequency changes

The phase derivative of the chirp function gives the instantaneous frequency of the chirp function. Block Chirp uses this principle to calculate the chirp output signal when the Frequency Sweep parameter has the value Linear, Quadratic or Logarithmic.

CHIRP output signal with phase :

.

The instantaneous frequency is the derivative of the phase: .

For example, if you want to receive a chirp signal with a linearly varying instantaneous frequency, set the Frequency Sweep parameter to Linear and adjust the values of the linear frequency change by setting the other parameters accordingly. The unit outputs a chirp signal, the phase derivative of which corresponds to a given linear frequency change. This ensures that the instantaneous frequency of the output signal corresponds to a given linear frequency change. The equations describing linear, quadratic, and logarithmic frequency changes are given in the section Equations for calculating the output signal.

A method for calculating the output signal for a varying frequency according to the law of cosine

When the Frequency Sweep parameter has a value Swept cosine, the block calculates the output signal as follows:

.

The instantaneous frequency equation given in the section The method of calculating the output signal for linear, quadratic and logarithmic frequency changes is not valid for this case, so the user-defined frequency change differs from the actual one . Thus, the output signal may not behave as expected. For more information, see the parameter description Frequency sweep and in the section Equations for calculating the output signal.