Generate variable frequency sinusoid
The DiscreteTimeVCO
(voltagecontrolled oscillator)
object generates a signal whose frequency shift from the quiescent
frequency property is proportional to the input signal. The input
signal is interpreted as a voltage.
To generate a variable frequency sinusoid:
Define and set up your discrete time voltagecontrolled oscillator object. See Construction .
Call step
to generate a variable
frequency sinusoid according to the properties of comm.DiscreteTimeVCO
.
The behavior of step
is specific to each object in
the toolbox.
Starting in R2016b, instead of using the step
method
to perform the operation defined by the System
object™, you can
call the object with arguments, as if it were a function. For example, y
= step(obj,x)
and y = obj(x)
perform
equivalent operations.
H = comm.DiscreteTimeVCO
creates a discretetime
voltagecontrolled oscillator (VCO) System
object, H
.
This object generates a sinusoidal signal with the frequency shifted
from the specified quiescent frequency to a value proportional to
the input signal.
H = comm.DiscreteTimeVCO(
creates
a discretetime VCO object, Name
,Value
)H
, with each specified
property set to the specified value. You can specify additional namevalue
pair arguments in any order as (Name1
,Value1
,...,NameN
,ValueN
).

Amplitude of output signal Specify the amplitude of the output signal as a double or singleprecision,
scalar value. The default is 

Frequency of output signal when input is zero Specify the quiescent frequency of the output signal in Hertz,
as a double or singleprecision, real, scalar value. The default
is 

Sensitivity of frequency shift of output signal Specify the sensitivity of the output signal frequency shift
to the input as a double or singleprecision, real, scalar value.
The default is 

Initial phase of output signal Specify the initial phase of the output signal, in radians,
as a double or single precision, real, scalar value. The default is 

Sample rate of input Specify the sample rate of the input, in Hertz, as a double
or singleprecision, positive, scalar value. The default is 
reset  Reset states of discretetime VCO object 
step  Generate variable frequency sinusoid 
Common to All System Objects  

clone  Create System object with same property values 
getNumInputs  Expected number of inputs to a System object 
getNumOutputs  Expected number of outputs of a System object 
isLocked  Check locked states of a System object (logical) 
release  Allow System object property value changes 
This object implements the algorithm, inputs, and outputs as described on the DiscreteTime VCO block reference page. However, this object and the corresponding block may not generate the exact same outputs for singleprecision inputs or property values due to the following differences in casting strategies and arithmetic precision issues:
The block always casts the result of intermediate mathematical operations to the input data type. The object does not cast intermediate results and MATLAB decides the data type. The object casts the final output to the input data type.
You can specify the SampleRate
object
property in singleprecision or doubleprecision. The block does not
allow this.
In arithmetic operations with more than two operands with mixed data types, the result may differ depending on the order of operation. Thus, the following calculation may also contribute to the difference in the output of the block and the object:
input * sensitivity * sampleTime
The block performs this calculation from left to right.
However, since sensitivity * sampleTime
is a onetime
calculation, the object calculates this in the following manner:
input * (sensitivity * sampleTime
)