# funcGen(function,frequency,amplitude,DCOffset,Phase,TimeSpan,Numpts)

A general purpose function generator.

### Syntax

o_funcGen(function,frequency,amplitude,DCOffset,Phase,TimeSpan,Numpts)
  Function: Text - basic waveform function: Cosine, Sine, Triangle, Square, Ramp
  Frequency: - Text - expression defining the frequency of the signal
  Amplitude: - Text - expression defining the amplitude of the signal
  DCOffset: - Text - expression defining the DC offset of the signal
  Phase: - Text - expression defining the phase offset of the signal
  TimeSpan: - Text - expression defining the duration of the signal
  Numpts - Text - expression defining the number of samples of the signal
  return: Waveform

### Usage

This extends the capabilities of the built-in Function Generator by allowing arbitrary expressions for the various settings. By doing so complex waveforms may be generated easily.

`Frequency, Amplitude, DCOffset, and Phase` are variables that are mutually available. Hence the expression defining any of these may use the others as well as the `TimeSpan` and `NumPts` variables, as well as the `Time` variable defined by NumPts and TimeSpan

`TimeSpan` and `Numpts` can also be expressions but may NOT use these internal variables.

### Location

menu: veeos ==> Signal Processing ==> Modules ==> funcGen

library: sigLib

### Example

Since expressions are possible, complex waveforms such as this amplitude-modulated square Chirp signal are easy to specify. Note the usage of the frequency and numPts variables.

### Notes

If any of the defined parameters are arrays they MUST be of size numPts.

If you create circular definitions or too much cross-coupling of parameters expect errors! Keep it simple.

### Reference

### Dependencies

### Supported On

VEE 7.0+, all platforms

### See Also

© 2015-2021. All Rights Reserved. Stan Bischof (stan@worldbadminton.com). Last updated 09 August 2021 18:25.