Chirp
Generation of a cosine signal with varying frequency (chirp).
Description
The Chirp block outputs a variable frequency cosine signal with unit amplitude and continuous phase (chirp signal). To specify the desired output chirp signal, it is necessary to define an instantaneous frequency function for it, also known as the output frequency change. The frequency change can be linear, quadratic or logarithmic and by default is repeated once per Sweep time. For a description of the algorithms used by the Chirp block, see Algorithms.
Ports
Output
Port_1 - cosine signal with changing frequency (chirp)
scalar
| vector
Variable frequency cosine signal (chirp). If the Frequency sweep parameter is set to Linear
, Logarithmic
or Quadratic
modes, the unit outputs a cosine variable frequency signal with instantaneous frequency values specified by the frequency and time parameters. In the Swept cosine
mode, 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 on how the unit calculates the output signal, see Algorithms.
Data types: Float32
, Float64
.
Parameters
Frequency sweep - type of frequency sweep
Linear (by default)
| Swept cosine
| Logarithmic
| Quadratic
Instantaneous output signal type : Linear
, Logarithmic
, Quadratic
or Swept cosine
. For details, refer to Frequency Change Shaping and Algorithms.
Limitations.
If a signal with a linearly varying frequency is desired, it is recommended that the Frequency sweep parameter be set to Linear
. Although the Swept cosine
value also gives a signal with linearly varying frequency, the output signal may have unexpected frequency content.
-
The number of oscillations per Target time is not necessarily the Target frequency. This is because the frequency change specified by the user is not the actual frequency change of the output cosine signal as described in Method for Calculating Output Signal for Varying Frequency by Cosine Law. Refer to Instantaneous Frequency Change Values for the actual frequency change of the cosine output signal at the specified time.
-
In the `Swept cosine' mode, do not set the parameters so that the value of significantly exceeds 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 - frequency change mode
Unidirectional (by default)
| Bidirectional
The Sweep mode parameter determines whether the frequency change is unidirectional or bidirectional, which affects the shape of the changing output frequency (see Shaping the frequency change). The table describes the characteristics of unidirectional and bidirectional frequency change.
Parameter value Sweep mode | Frequency change characteristics |
---|---|
|
|
|
|
The following diagram shows the linear change in frequency in both modes of variation. For information on setting the frequency values, refer to Setting the Instantaneous Frequency Change Values.
Initial frequency (Hz) - initial frequency
1000 (By default)
| scalar
If Frequency sweep is set to Linear
, Quadratic
or Swept cosine
, the Initial frequency (Hz) value is the initial frequency of the output chirp signal. The Initial frequency (Hz) value is specified as a scalar greater than or equal to zero.
If Frequency sweep is set to Logarithmic
, then the Initial frequency (Hz) value is one less than the actual value of the initial frequency. Also in this case the Initial frequency (Hz) must be less than the Target frequency.
For details, refer to Setting the Instantaneous Frequency Change Values.
Target frequency (Hz) is the target frequency value
4000 (By default)
| scalar
.
If Frequency sweep is set to Linear
, Quadratic
or Logarithmic
, then the target frequency value is the instantaneous frequency of the output signal at the Target time, . The Initial frequency (Hz) value is specified as a scalar greater than or equal to zero.
If Frequency sweep is set to Swept cosine
, the Target frequency value is the instantaneous frequency of the output signal at the midpoint of Target time, .
If Frequency sweep is set to Logarithmic
, then the Target frequency value must be greater than the Initial frequency value.
For details, refer to Setting instantaneous frequency sweep values.
Target time (s) is the target frequency change time value
1 (By default)
| scalar
.
If Frequency sweep is set to Linear
, Quadratic
or Logarithmic
, the target frequency sweep time value is the time for the frequency to reach the Target frequency value, .
If Frequency sweep is set to Swept cosine
, then the Target time (s) value is the time it takes for the frequency to reach the value .
The Target time (s) value is set as a scalar greater than or equal to zero and less than or equal to the Sweep time value, .
For details, refer to Setting Instantaneous Frequency Change Values.
Sweep time (s) is the frequency change time
1 (By default)
| scalar
.
If Sweep mode is set to Unidirectional
, the frequency change time is the period over which the frequency change occurs.
If Sweep mode is set to Bidirectional
, the frequency change time is half the period over which the frequency change occurs.
The Target time (s) value is set as a scalar greater than or equal to the Sweep time value, .
Initial phase (rad) - initial phase value
0 (By default)
| scalar
Phase of the output cosine signal at time :
.
The Initial phase (rad) value is specified as a scalar greater than or equal to zero.
Sample time - sampling period of the output signal
1/8000 (By default)
| `positive scalar'.
Sampling period of output signal. The period of the output frame is equal to , where is the number of samples in the frame.
Samples per frame - number of samples per frame
1 (by default)
| positive scalar
.
The number of samples per frame for buffering in each output frame is set as an integer positive scalar.
Output data type - output data type
Double (by default)
| Single
If Double
parameter is selected, Float64
data type will be used, if Single
- Float32
.
Calculations using Float64
will be more accurate than with Float32
, but will require more memory and computational resources.
Float32
may be more efficient when less precision is required, such as when storing large amounts of data.
Read more
*Formation of frequency change
The basic shape of the instantaneous frequency change is controlled by the Frequency sweep and Sweep mode parameters.
Parameter name | Selection values | Parameter description |
---|---|---|
*Frequency sweep |
|
Specifies whether the frequency sweep is linear, quadratic, logarithmic or cosine. |
*Sweep mode. |
|
Determines whether the change is unidirectional or bidirectional. |
The following diagram shows the possible forms of frequency sweep that can be obtained by using the Frequency sweep and Sweep mode parameters.
For information on how to set the frequency values, refer to Setting Instantaneous Frequency Sweep Values.
*Setting the instantaneous frequency change values
Set the following parameters to set the instantaneous frequency change values of the output signal:
-
Initial frequency (Hz), ;
-
Target frequency (Hz), ;
-
Target time (s), .
The following table shows the frequency sweep values at specific points in time for all values of Frequency sweep. Refer to Algorithms for information on the formulas used to calculate frequency sweep values at other times.
Frequency sweep | Frequency value at time | Frequency value at time | Time when frequency value is equal to Target frequency (Hz), |
---|---|---|---|
|
|
|
|
`Quadratic |
|
|
|
|
|
|
|
`Swept cosine |
|
|
|
Algorithms
The Chirp block 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 summarises the equations used by the unit to calculate the user-defined output frequency sweep , the unit’s output sweep , and the actual output frequency sweep . The only case where the user specified output frequency change 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 where . To derive equations for other cases, study the table and diagram in Frequency sweep shaping. |
The above equation table used by the unit contains the following variables:
-
- user-defined frequency change.
-
- the actual frequency change, usually equal to .
-
- output signal.
-
- the phase of the chirp signal, where and is the derivative of the phase: .
-
- initial phase value Initial phase, where .
Frequency sweep | Output chirp signal | User defined frequency change | actual frequency change | |
---|---|---|---|---|
|
|
|
|
|
|
Same as `Linear'. |
|
|
|
|
Same as `Linear'. |
where |
Not used |
|
`Swept cosine |
|
Same as `Linear'. |
Same as `Linear'. |
|
*Method of calculating the output signal for linear, quadratic and logarithmic changes in frequency.
The derivative of the phase of the chirp function gives the instantaneous frequency of the chirp function. The Chirp block uses this principle to calculate the output chirp signal when the Frequency Sweep parameter is set to Linear
, Quadratic
or Logarithmic
.
Output chirp signal with phase :
.
Instantaneous frequency is the derivative of phase: .
For example, if you want a chirp signal with a linearly varying instantaneous frequency, set the Frequency Sweep parameter to `Linear' and adjust the linear frequency change values, setting the other parameters accordingly. The unit outputs a chirp signal whose phase derivative corresponds to the specified linear frequency change. This ensures that the instantaneous frequency of the output signal matches the specified linear frequency change. For equations describing linear, quadratic, and logarithmic frequency change, refer to Equations for Output Calculation.
*Method of calculating the output signal for varying frequency by the law of cosine.
When Frequency Sweep is set to Swept cosine
, the unit calculates the output signal as follows:
.
The instantaneous frequency equation given in Output calculation method for linear, quadratic and logarithmic frequency change is not valid for this case, so the user-defined frequency change is different from the actual frequency change . Thus, the output signal may not behave as expected. For details, refer to the description of Frequency sweep and Equations for calculating the output signal.