| Signal Processing Toolbox | Search  Help Desk |
| vco | Examples See Also |
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 -1 corresponds to a 0 frequency output, 0 to Fc, and 1 to 2*Fc. y is the same size as x.
y = vco(x,[Fmin Fmax],Fs)
scales the frequency modulation range so that -1 and 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.
Example
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(2Plot the spectrogram of the generated signal.*pi*t,0.75),[.1 0.4]*Fs,Fs);
specgram(x,512,Fs,kaiser(256,5),220)
![]()
Algorithm
vco performs FM modulation using the modulate function.
Diagnostics
If any values ofx lie outside [-1,1], vco gives the following error message:
X outside of range [-1,1].
See Also
demod |
Demodulation for communications simulation. |
modulate |
Modulation for communications simulation. |