Engee documentation

Chirp

Generates 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 (s). Description of the algorithms used by the block Chirp, see the Algorithms section.

Ports

Output

# OUT_1 — variable frequency cosine signal (chirp)
scalar | vector

Details

A variable frequency cosine signal (chirp). If for the parameter Frequency sweep modes are 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

Complex numbers support

Yes

Parameters

Main

# Frequency sweep — type of frequency change
Swept cosine | Linear | Logarithmic | Quadratic

Details

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 for the parameter Frequency sweep meaning 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 over time Target time (s) It is not necessarily a frequency Target frequency (Hz). This happens because the user-defined frequency change is not an actual frequency change of the output cosine signal, as indicated in the [calculation-method-sweep-cosine] section. 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 parameters Initial frequency (Hz) and Target frequency (Hz). In this case, the actual frequency change of the output cosine signal may be closer to significantly exceeding the values of the parameters Initial frequency (Hz) and Target frequency (Hz).

Values

Swept cosine | Linear | Logarithmic | Quadratic

Default value

Linear

Program usage name

FrequencySweep

Tunable

No

Evaluatable

No

# Sweep mode — frequency change mode
Unidirectional | Bidirectional

Details

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

Parameter value Sweep mode Frequency change Characteristics

Unidirectional

  • Lasts for one time Sweep time (s), .

  • Repeated once a day .

Bidirectional

  • Lasts for twice the time Sweep time (s), .

  • 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

Values

Unidirectional | Bidirectional

Default value

Unidirectional

Program usage name

SweepMode

Tunable

No

Evaluatable

No

# Initial frequency (Hz) — Initial frequency
Real number

Details

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

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

Default value

1000

Program usage name

InitialFrequency

Tunable

Yes

Evaluatable

Yes

# Target frequency (Hz) — target frequency value
Real number

Details

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

If for the parameter Frequency sweep the value is set Swept cosine, the value of Target frequency (Hz) — this is an instantaneous frequency The output signal is in the middle of time Target time (s), .

If for the parameter Frequency sweep the value is set Logarithmic, the value of Target frequency (Hz) there should be more value Initial frequency (Hz).

Default value

4000

Program usage name

TargetFrequency

Tunable

Yes

Evaluatable

Yes

# Target time (s) — the target value of the frequency change time
Real number

Details

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

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

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

Default value

1

Program usage name

TargetTime

Tunable

Yes

Evaluatable

Yes

# Sweep time (s) — frequency change time
Real number

Details

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

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

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

Default value

1

Program usage name

SweepTime

Tunable

Yes

Evaluatable

Yes

# Initial phase (rad) — initial phase value
Real number

Details

Phase the output cosine signal at a time :

.

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

Default value

0

Program usage name

InitialPhase

Tunable

Yes

Evaluatable

Yes

# Sample time — sampling period
SampleTime (real number / vector of two real numbers)

Details

Sampling period of the output frame , set as a positive number. The sampling period of the output frame is , where — the number of samples per frame..

Default value

1/8000

Program usage name

SampleTime

Tunable

No

Evaluatable

Yes

# Samples per frame — samples per output frame
Int64 integer

Details

Number of samples per frame in one output data channel, set as a positive integer.

Default value

1

Program usage name

SamplesPerFrame

Tunable

No

Evaluatable

Yes

# Output data type — type of output data
Single | Double

Details

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.

Values

Single | Double

Default value

Double

Program usage name

OutputDataType

Tunable

No

Evaluatable

No

Additional Info

Frequency change formation

Details

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

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 forms of frequency variation that can be obtained using the parameters Frequency sweep and Sweep mode.

chirp 2

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

Setting the values of the instantaneous frequency changes

Details

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 parameter values. Frequency sweep. 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 parameter setting. Frequency sweep.

Equations for calculating the output signal

Details

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 for the parameter Frequency sweep the value is set 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 Frequency change formation section.

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

Details

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 parameter Frequency sweep it matters 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 parameter Frequency sweep meaning 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 variation are given in the Equations for calculating the output signal section.

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

Details

When the parameter Frequency sweep it matters Swept cosine, the block calculates the output signal as follows:

.

The instantaneous frequency equation given in the [calculation-method] section 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 Equations for calculating the output signal section.