Dual channel function / waveform / signal generator for the speaker / headphone audio output.
This app puts a waveform on the audio output at 44.1 kHz and with a resolution of 16-bit. Two separate waveforms can be output to the left and right audio output channels respectively.
• Sine, square & triangular waveforms.
• Frequency range from 1 mHz up to 22 kHz.
• Amplitude as percentage 0-100%.
• Set duty for square waveforms or skew triangular waveforms to get saw waveforms.
• Shift the start phase of waveforms.
• Sweep frequency or amplitude (Single, Repeat & Bounce modes).
• Amplitude Modulation (AM).
• Frequency Modulation (FM).
• Burst mode for a specific number of waveforms (1-10000)
• White noise & pink noise generator.
Output will depend on your device hardware. Some device hardware may may filter out the DC bias and low frequency signals. At high frequencies, the waveforms will be distorted due to limited number of samples for each waveform (for example at 4.41kHz, a sine waveform will be approximated by only 10 points). Therefore this is for fun/educational use, for critical applications use a real calibrated function generator.
The app has two displays at the top showing the waveforms for channels 1 and 2 respectively. The output can be turned on with the blue button at the bottom right. The left and right audio outputs can be assigned to either channel 1 or 2 and turned on or off in this output box. The rest of the buttons allow the waveform to be specified. In the center is a spring slider that is used to adjust the currently selected parameter. If you to prefer to enter a precise value manually, tapping the enter value button will bring up a num-pad to enter the value. Values out of range will be coerced to the nearest allowed value.
Output Amplitude is as a percentage and the sum of Bias + Amplitude + Noise Amplitude and has to be 100% or less. The app will restrict changes to these values so that this is the case. Following is a longer explanation of all the controls.
The Edit box on the upper left side of the screen allows the channel to be selected.
The selected channel will be highlighted in orange. All button presses in the Waveform, Sweep, Burst, Noise
& Modulation boxes will apply to the selected channel only.
Either sine, square or triangular waveforms can be selected with the 3 buttons on the left of this section.
PHASE This will set the offset phase of the waveform and has a value between 0° and 360°. This is useful for when two channels are being used that are required to be out of phase.
FREQ Set the frequency of the waveform from 1mHz up to 22kHz. If in sweep frequency mode, this button is disabled.
BIAS Set the bias of the waveform as a percentage of maximum output. Note that the total amplitude (Bias+Amplitude+Noise Amplitude) will be kept to 100% or less. If your device hardware has a high pass filter it may block low frequency and DC signals and bias may not have any effect.
AMPL Set the amplitude of the waveform as a percentage of maximum allowable output. Note that the total amplitude (Bias+Amplitude+Noise Amplitude) will be kept to 100% or less.
DUTY/SKEW Set the duty (% high time) for a square wave or the skew of a triangular wave. The skew is defined here as the % rise time and is a percentage between 0 and 100%. 0% corresponds to a falling saw wave and 100% a rising saw wave. 50% is for a triangular waveform with equal rise and fall times.
Sweep Buttons are only available if not using Burst or Modulation features.
Either the frequency or amplitude can be swept.
FREQ Select frequency sweep mode. Button will be highlighted in orange if selected.
AMPL Select amplitude sweep mode. Button will be highlighted in orange if selected.
START Select the start frequency(or amplitude) of the sweep.
STOP Select the stop frequency(or amplitude) of the sweep.
TIME Select the duration of the sweep in seconds.
MODE Select either Single>Off, Single>Hold, Repeat or Bounce modes. Single>off, will put 0 amplitude onto the output channel once the sweep is completed. Single>Hold, will hold the waveform end value once the sweep is completed. Repeat will just start the sweep again from the start once the end is reached. Bounce mode will sweep up, then sweep back from end to start over the same duration and repeat indefinately.
Burst buttons are only available if not using Sweep or Modulation features. Burst allow a specific number of waveforms (1-10000)
to be output before outputting zero. The burst starts as soon as the blue OUT button is pressed. If in burst repeat mode, the burst
will repeat at the given frequency.
Repeat Burst with Count = 4
SINGLE Select single burst mode. Button will be highlighted in orange if selected.
REPEAT Select repeat burst mode. Button will be highlighted in orange if selected.
COUNT Enter the number of waveforms to burst. Button only available if single or repeat burst modes selected. Count can be any integer from 1 to 10000.
FREQ Select repeat frequency of the burst. Button only available if repeat burst mode selected. Frequency will be limited to the time it takes to burst the set count of waveforms.
White or pink noise can be added to the output signal by pressing white or pink in this section. The White or Pink buttons will become highlighted
depending on the type of noise to be added to the signal.
AMPL Set the amplitude of the noise. The total amplitude (Bias + Amplitude + Noise Amplitude) has to be 100% or less. Therefore the amplitude you can select will be limited by the other amplitude settings. To get noise and no waveform, set the waveform amplitude and bias both to 0%.
Pink (1/f) noise is generated by an algorithm that sums white noise from successive octaves. This should give pink noise that falls off at approximately 3dB per octave between 43 Hz and 44 kHz.
Sine wave (50% amplitude) with white noise (50% amplitude)
Modulation buttons are only available if not using Sweep or Burst features. The waveform can be frequency modulated or amplitude modulated.
In frequency modulation, the frequency will oscillate about the set waveform frequency, by an amount specified by the AMPLitude (in Hz) and at a rate specified by the Modulation FREQuency.
In amplitude modulation, the amplitude will oscillate between the set waveform amplitude and the lower amplitude set as the modulation AMPLitude 2 at a rate specified by the Modulation FREQuency.
There a are 10 memory slots where the setup for either channel 1 or channel 2 can be saved and recalled for future use. To copy the waveform setup from one channel to the other, press save to save it to a memory slot, select the other channel and then press recall.
This section controls output to the audio hardware. The slider switches determine which of the two channels the left and
right audio outputs should be assigned. Put them to the same channel if you want both Left and Right outputs to receive the same
LEFT Output to the Left audio channel is enabled if selected and highlighted in orange.
RIGHT Output to the Right audio channel is enabled if selected and highlighted in orange.
VOL Set the master volume. This applies to both channels 1 and 2 and will multiply the waveforms by the percentage set here.
OUT Turns output On and Off. The Out button will be highlighted in blue when the output is on.
The cogs on the top left of the function generator opens up a dialog where some preferences can be set.
Smooth On/Off - Check this box to gradually turn the output on or off over 0.1 seconds. This should remove the annoying click caused by a sudden change in output signal.
Remember Set-up - Remembers the instrument panel set-up for the next time the app is run. If unchecked the app starts with the default 440 Hz signal set-up.
Frequency Resolution - Select the number of significant figures to use in displaying the frequency values.
Amplitude Resolution - Select the number of decimal places to use in displaying the amplitude values.
Phase Resolution - Select the number of of decimal places to use in displaying the phase.
Duty/Skew Resolution - Select the number of decimal places to use in displaying the duty and skew.
If using the audio output socket to drive external circuitry, the impedance should be similar to headphones (i.e. ~100 ohms as was used when connecting to an oscilloscope to obtain the above images). If it is much higher, the output will just be directed to the speakers of your device. The possible uses of a function generator are numerous. Please be careful if connecting to external circuitry and only do so if you know what you are doing. This app is not meant for serious applications, but for educational purposes. It it not calibrated and is for indication only. Use a proper calibrated function generator where needed.