vco

Voltage controlled oscillator

Syntax

y = vco(x,fc,fs)
y = vco(x,[Fmin Fmax],fs)

Description

y = vco(x,fc,fs) creates a signal that oscillates at a frequency determined by the real input vector or array x with sampling frequency fs. fc is the carrier or reference frequency; when x is 0, y is an fc Hz cosine with amplitude 1 sampled at fs Hz. x ranges from -1 to 1, where x = -1 corresponds to 0 frequency output, x = 0 corresponds to fc, and x = 1 corresponds to 2*fc. Output y is the same size as x.

y = vco(x,[Fmin Fmax],fs) scales the frequency modulation range so that ±1 values of x yield oscillations of Fmin Hz and Fmax Hz respectively. For best results, Fmin and Fmax should be in the range 0 to fs/2.

By default, fs is 1 and fc is fs/4.

If x is a matrix, vco produces a matrix whose columns oscillate according to the columns of x.

Examples

Generate two seconds of a signal sampled at 10,000 samples/second whose instantaneous frequency is a triangle function of time:

fs = 10000;
t = 0:1/fs:2;
x = vco(sawtooth(2*pi*t,0.75),[0.1 0.4]*fs,fs);

Plot the spectrogram of the generated signal:

spectrogram(x,kaiser(256,5),220,512,fs,'yaxis')

Diagnostics

If any values of x lie outside [-1, 1], vco gives the following error message.

X outside of range [-1,1].

More About

expand all

Algorithms

vco performs FM modulation using the modulate function.

See Also

|

Was this topic helpful?