Main Content

dsp.Chirp

Generate swept-frequency cosine (chirp) signal

Description

TheChirp对象生成一个扫描cos(chirp) signal.

To generate the chirp signal:

  1. Create thedsp.Chirpobject and set its properties.

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

To learn more about how System objects work, seeWhat Are System Objects?

Creation

Description

chirp= dsp.Chirpreturns a chirp signal,chirp, with unity amplitude.

example

chirp= dsp.Chirp(Name,Value)returns a chirp signal,chirp, with each specified property set to the specified value.

Properties

expand all

Unless otherwise indicated, properties arenontunable,这意味着你无法改变他们的价值观calling the object. Objects lock when you call them, and thereleasefunction unlocks them.

If a property istunable, you can change its value at any time.

For more information on changing property values, seeSystem Design in MATLAB Using System Objects.

Specify the frequency sweep type asSwept cosine,Linear,Logarithmic, orQuadratic. This property specifies how the output instantaneous frequency sweep varies over time.

Specify the sweep direction as eitherUnidirectionalorBidirectional.

When you set theTypeproperty toLinear,Quadratic, orLogarithmic, this property specifies the initial instantaneous frequency in hertz of the output chirp signal. When you set theTypeproperty toLogarithmic, the value of this property is one less than the actual initial frequency of the sweep. Also, when the sweep is logarithmic, the initial frequency must be less than the target frequency, specified by theTargetFrequencyproperty.

可调:Yes

Data Types:single|double|int8|int16|int32|int64|uint8|uint16|uint32|uint64

When you set theTypeproperty toLinear,Quadratic, orLogarithmic, this property specifies the instantaneous frequency of the output signal in hertz at the target time. When you set theTypeproperty toSwept Cosine, the target frequency is the instantaneous frequency of the output at half the target time. Also, when the sweep is logarithmic, the target frequency must be greater than the initial frequency, specified by theInitialFrequencyproperty.

可调:Yes

Data Types:single|double|int8|int16|int32|int64|uint8|uint16|uint32|uint64

When you set theTypeproperty toLinear,Quadratic, orLogarithmic, this property specifies the target time in seconds at which the target frequency is reached. When you set theTypeproperty toSwept cosine, this property specifies the time at which the sweep reaches 2ftgtfinitHz, whereftgtis theTargetFrequencyandfinitis theInitialFrequency. The target time should not be greater than the sweep time, specified by theSweepTimeproperty.

可调:Yes

Data Types:single|double|int8|int16|int32|int64|uint8|uint16|uint32|uint64

When you set theSweepDirectionproperty toUnidirectional, the sweep time in seconds is the period of the output frequency sweep. When you set theSweepDirectionproperty toBidirectional, the sweep time is half the period of the output frequency sweep. The sweep time should be no less than the target time, specified by theTargetTime. This property must be a positive numeric scalar.

可调:Yes

Data Types:single|double|int8|int16|int32|int64|uint8|uint16|uint32|uint64

Specify initial phase of the output in radians at timet= 0.

可调:Yes

Data Types:single|double|int8|int16|int32|int64|uint8|uint16|uint32|uint64

Specify the sampling rate of the output in hertz as a positive numeric scalar.

Data Types:single|double|logical

Specify the number of samples to buffer into each output as a positive integer. The default value is1.

Data Types:single|double|int8|int16|int32|int64|uint8|uint16|uint32|uint64

Specify the output data type asdoubleorsingle. The default value isdouble.

Usage

Syntax

Description

example

y= chirp()returns a swept-frequency cosine output,y.

Output Arguments

expand all

Swept-frequency cosine output, returned as a scalar or a column vector. The length of the output vector equals the value you specify in theSamplesPerFrameproperty.

Data Types:double

Object Functions

To use an object function, specify the System object™ as the first input argument. For example, to release system resources of a System object namedobj, use this syntax:

release(obj)

expand all

step RunSystem objectalgorithm
release Release resources and allow changes toSystem objectproperty values and input characteristics
reset Reset internal states ofSystem object

Examples

collapse all

Note: If you are using R2016a or earlier, replace each call to the object with the equivalentstepsyntax. For example,obj(x)becomesstep(obj,x).

chirp = dsp.Chirp(...'SweepDirection','Bidirectional',...'TargetFrequency', 25,...'InitialFrequency', 0,...'TargetTime', 1,...'SweepTime', 1,...'SamplesPerFrame', 400,...'SampleRate', 400);
plot(chirp());

Figure contains an axes object. The axes object contains an object of type line.

Algorithms

This object implements the algorithm, inputs, and outputs described on theChirpblock reference page. The object properties correspond to the block parameters.

Version History

Introduced in R2012a

See Also

Objects