Create Any Waveform on Your Function Generator

Function Generators typically produce Sine, Square, Triangle, Saw Tooth and DC signals. Many modern instruments include an AWG or Arbitrary Waveform Generator signal as an additional selection. This allows you to construct your own custom waveform to meet your testing needs. Typical examples might be a dual/multi tone audio signal to test intermodulation distortion in an audio amplifier or a complex modulated signal to test an RF demodulator.

Fig 1 HP Laptop & PicoScope 3205 Scope/Spec/FGn

In order to use the AWG, you have to create your waveform using a special editor or a math program. Essentially your are creating the digital samples that paint the actual waveform that you want. The quality of the waveform is limited by the hardware sample limitation of the instrument.

Fig 2 AWG Editor

The AWG editor allows you to customize various waveforms, draw them, record them from a scope and modify them, or import CSV text files from a math program that was used to construct them. A CSV file is a text file consisting of a series of floating point numbers separated by commas, representing the signal sample values taken at a particular sampling rate Fs and lying between a minimum voltage of -1.0V and +1.0V.

Figure 3 shows a Scilab program to generate a waveform consisting of two sine waves at 400Hz, 1KHz and with Fs sampling frequency 44.10KHz. The resulting samples are written to a column using the function csvWrite. The common period for 400Hz = 2.5msec  & 1000Hz = 1msec, is 5msec. Samples are collected for this period. Then the CSV file is read into the AWG, and the samples are written and repeated every 5msec or 200Hz. Figure 4 shows the AWG output taken over 2 periods or 10msecs. Figure 5 shows the AWG output spectrum clearly showing the two tones of 400Hz and 1KHz.

Fig 3 Scilab Program Dual Tone to CSV

Fig 4 AVG Output over 10msec

Fig 5 AVG Output 400Hz & 1KHz Tones

Leave a Reply

Your email address will not be published. Required fields are marked *