Spectrum Lab's Test Signal Generator
Spectrum Lab is more than a simple audio analyzer. It has a built-in audio signal generator with the following features:
This chapter contains:
The test signal generator can be activated either from Spectrum Lab's main window or the Component Window: The output of the generator can be added to the input of the processing chain, but also to the output (to test external devices). If you need a generator with I/Q-output, let the signal run through the FFT-based filter (which can turn normal signals into complex signals, and remove the "negative" frequencies in the spectrum if necessary).
See also: circuit window overview , main index , sample applications .
Three independent audio frequencies may be generated WHILE the audio input of the sound card is analyzed. Each of these "tones" can be adjusted from 0.1 Hz to 2000.0 Hz in 0.1Hz-steps. By setting a tone's frequency to zero you turn it off (so you can use this generator also for one-tone- and two-tone- tests).
The three sine waves are calculated in real-time using the PC's floating point unit, so you need a fast CPU if you want to generate these tones WHILE analyzing the input. The generator can be started from the "View/Windows" menu.
The signal generator also has an adjustable noise generator (white noise). This is a useful tool for testing filters. You may test the "software"-filter of SpecLab with this generator, but you may also test a "real" filter with it if you connect the signal generator to the sound output and the spectrum analyzer to the sound input (look at the component window for details).
The signal generator's control window can be opened from Spectrum Lab's main window, or by clicking on the generator block in the test circuit diagram.
Here are just some of the generator controls:
"On": Used to turn one of the sine generators on or off. If this box is checked,
the generator is active.
"AM": Activates the amplitude modulator for this generator.
"FM": Activates the frequency modulator for this generator.
"Waveform": Select sine, rectangle, triangle or sawtooth here.
"Freq/Hz": You can enter the (center-)frequency of the generator here as
a decimal number (accurate to fractions of a Hertz).
"Frequency Slider": Can also be used to change the frequency rapidly, using
the mouse. Hint: you can also connect the frequency of a generator to a
frequency marker/slider.
"Level": Set the output amplitude of the generator. All three generators
can be individually controlled. The maximum value is "0 dB".
Note: If a suitable GPS receiver is connected to the PC
via soundcard (!),
the output of the sine wave generators can be
phase-locked to the GPS sync
pulse.
Each of the signal generators -also the AM+FM modulators- can be switched to "arbitrary waveform" mode. The arbitrary waveform is stored in array with 1024 sample points, from where it can be read out in any desired speed (using interpolation). To define the waveform, you can ...
To fill the arbitrary waveform table with calculated values, enter a numeric
formula in the edit field on the right side of the graphic waveform display.
The formula will be evaluated by SpecLab's numeric interpreter. The variable
'x' runs as index from 0 to 1 over the whole array (regardless of the actual
length of the array; so you can say that 'x' is the array index "normalized"
to 0 ... 1). To use 'x' in an argument of the trigonometric functions like
sin and cos (sine and cosine), 'x' must be multiplied with 2 * pi ( pi is
a constant, approx. 3.14159265...) .
The result of the formula must be in the range +/- 1 . Some examples :
Expression ("formula") |
Result |
|
fills the waveform table with a pure sine wave |
|
fills the table with a pulse, 50 percent duty cycle |
|
fills the table with a pulse, 10 percent duty cycle |
(x<0.1)+0.01*((x>0.5)&&(x<0.6)) |
produces a "strong", followed by a "weak" pulse |
|
"Starwars"-like sound (laser) when played at 5 Hz . |
|
fills the waveform table with white noise |
There are a few commands and functions in Spectrum Lab's
interpreter which can be used to control the signal
generator. They can be used to control the generator from an external program,
etc.
To set a new value, use a formal assignment like
"generator[0].freq=123.4".
The token "generator" can be abbreviated as "gen"
if necessary.
The author used this generator to find out how "linear" his "linear transverter" for 136kHz really was by feeding it with a two-tone signal and analyzing the transmitted spectrum at the same time. A simple two-tone test is also good for testing the intermodulation of receivers or single amplifier stages.
It was later used in a 'confidence test' for some of Spectrum Lab's spectrum analysis functions (using the FM modulator to spread the energy from a sine generator, without changing the total power).
Tech notes, something to test: