Main Content

comm.DiscreteTimeVCO

Generate variable frequency sinusoid

Description

The comm.DiscreteTimeVCO System object™ object generates a signal whose frequency shift from the quiescent frequency property is proportional to the input signal, treating the input as a voltage.

To generate a variable frequency sinusoid:

  1. Create the comm.DiscreteTimeVCO object and set its properties.

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

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

Creation

Description

discreteVCO = comm.DiscreteTimeVCO creates a discrete-time voltage-controlled oscillator (VCO) System object, discreteVCO. This object generates a sinusoidal signal, shifting its frequency from the specified quiescent frequency to a value proportional to the input signal.

discreteVCO = comm.DiscreteTimeVCO(Name=Value) sets properties using one or more optional name-value arguments. For example, comm.DiscreteTimeVCO(OutputAmplitude=2.5) sets the amplitude of the output signal to 2.5.

example

Properties

expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

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

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

Amplitude of the output signal, specified as a scalar.

Tunable: Yes

Data Types: single | double

Quiescent frequency of the output signal in hertz, specified as a scalar. This quiescent frequency refers to the frequency of the output signal when the input value is zero.

Tunable: Yes

Data Types: single | double

Sensitivity of the frequency shift of the output signal to the input, specified as a scalar. This value scales the input voltage, leading to a corresponding shift in frequency from the specified quiescent frequency. Units are in hertz per volt.

Tunable: Yes

Data Types: single | double

Initial phase of the output signal in radians, specified as a scalar.

Data Types: single | double

Sample rate of the input in hertz, specified as a positive scalar

Data Types: single | double

Usage

Description

Y = discreteVCO(X) produces a sinusoidal signal, Y, shifting its frequency from the specified QuiescentFrequency property to a value that is proportional to the input signal, X.

example

Input Arguments

expand all

Input signal, specified as a scalar or column vector.

Data Types: single | double

Output Arguments

expand all

Output signal, returned as a scalar or column vector. Y has the same data type and size as X.

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 named obj, use this syntax:

release(obj)

expand all

stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object

Examples

collapse all

Create a signal source System object™.

reader = dsp.SignalSource;

Generate random data and apply rectangular pulse shaping.

reader.Signal = randi([0 7],10,1);
reader.Signal = rectpulse(reader.Signal,100);

Create a signal logger and discrete time VCO System objects.

logger = dsp.SignalSink;
discreteVCO = comm.DiscreteTimeVCO( ...
    OutputAmplitude=8, ...
    QuiescentFrequency=1);

Generate an frequency shift keying (FSK) signal.

while(~isDone(reader))
    sig = reader();
    y = discreteVCO(sig);
    logger(y);
end
oscsig = logger.Buffer;

Plot the generated FSK signal.

t = (0:length(oscsig)-1)'/discreteVCO.SampleRate;
plot(t,reader.Signal,'--r', LineWidth=3)
hold on
plot(t,oscsig,"-b");
hold off
xlabel("Time (s)")
ylabel("Amplitude (V)")
legend("Input signal","FSK signal","location","se")

Figure contains an axes object. The axes object with xlabel Time (s), ylabel Amplitude (V) contains 2 objects of type line. These objects represent Input signal, FSK signal.

Algorithms

The comm.DiscreteTimeVCO system object generates a signal with a frequency shift from the quiescent frequency that is proportional to the input signal, interpreted as a voltage. Given the input signal (u(t)), the expression for the output signal becomes

y(t)=Accos(2πfct+2πkc0tu(τ)dτ+φ)

where:

  • Ac is the output amplitude.

  • fc is the quiescent frequency.

  • kc is the input sensitivity.

  • φ is the initial phase.

Extended Capabilities

Version History

Introduced in R2012a