Spectrum Lab Configuration
Dialog
From the Options menu you can activate a special Setup window, where you
may modify the following parameters:
See also: Spectrum Lab's main index ,
user-defined menus ,
installation hints ,
troubleshooting ,
some applications .
This item in the Setup dialog is used to define the COM port number where
a "RX/TX" (=PTT) line and other control signals can be connected.
-
PTT Control:
The hardware required to use this feature is exactly the same as for many
PSK31-programs. For example, the RTS line of the serial interface can be
set HIGH during transmit and LOW during receive. The signal actually used
can be selected on this control panel. There are some
interpreter commands to access this
port, too. Alternatively (if there's no free COM port), consider using
a pilot tone for PTT control.
-
CW Keying:
Will be used to generate a slow CW keying signal.
-
Alert Bell:
This output can be driven by the Spectrum Alert function. A low signal
means "no alert" (bell off), a high signal means "ALERT !" (bell should ring,
warning light flashing etc).
-
use SmallPort driver to access I/O
ports
(removed, because either direct I/O port access or the "smallport" utility
caused severe problems under Win XP, and most likely under any later version
of windows)
-
PTT pilot tone (frequency)
Can be used for PTT switching through a weak pilot tone generated by the
soundcard. This is an alternative to control a transmitter if your PC doesn't
have a free COM port for this purpose. Whenever the transmitter shall be
ON ("sending"), a pilot tone with the specified frequency is added to the
output audio signal for the soundcard (approx. 20 dB below the max. output
level, added to the signal at label "L5" in the
circuit). Use a simple PLL tone decoder
like the LM567 or similar to detect the pilot tone, and convert it into a
switching signal. Note: The LM567 is marked as 'obsolete part' but it's still
easy to find, cheap, and easy to use.
To disable the PTT pilot tone, set the frequency to zero (the default state).
Beware to place the pilot tone outside of the transmitter's frequency range,
but keep it below the half sampling rate: For example, use 5000 Hz is about
the maximum if the soundcard runs at 11025 samples/second.
The group "Radio Control Port" can be used if Spectrum Lab shall be used
to remotely control a suitable receiver (a "real radio"). Details can be
found in the chapter "Interpreter
commands for Remote Control". The parameters are:
-
Serial port number
Note: At the moment, don't use the same port as for the PTT control (set
the PTT control port to "none" if your PC only has one serial port)
-
Bits/second
Some old ICOM radios used 1200 bit/second, others use 9600 bit/second. Check
your radio's manual !
-
Data bits
Set this parameter to "8" which works for 99% of all cases ;-)
-
Parity
Set this parameter to "none" for ICOM's CI-V protocol
-
Stopbits
Usually set to "1"
-
Flow control
Set this to "none", because most radios use neither RTS/CTS (hardware flow
control) nor XON/XOFF (software flow control)
-
Protocol
Set this to "ICOM CI-V", or different (one fine day). The selection "none
/ ASCII-Text" means you can only send ASCII strings to the radio through
an interpreter command, but there will not be any manufacturer-specific
translation, message acknowledge etc.
-
Address of the Radio
This hexadecimal value (with "0x" prefix) must match the "CI-V Address" of
the radio. You will find the default value in your radio's manual. Here are
some values for ICOM radios (more at http://www.plicht.de/ekki/civ ) :
| Model |
IC-735 |
IC-751A |
IC-725 |
IC-706 |
IC-706MkII |
IC-706MkII-G |
IC-756 |
... |
|
| Address |
0x04 |
0x1C |
0x28 |
0x48 |
0x4E |
0x58 |
0x50 |
... |
|
Note that for the "older" three HF radios, the frequency is sent with 8 digits
only, while for all "newer" radios 10 digits are exchanged. So if you set
the CI-V address of your IC-706 to 0x04 in its menu, SpecLab will think it's
an old IC-735 and only send 8 digits (which fails if the frequency above
99 MHz). So better keep the radio's default settings, and select the right
address in Spectrum Lab.
-
Master Address (for CI-V protocol)
Usually set to 0xE0... at least this is what ICOM uses in their own examples.
back to top
System
Settings
Timezone : Difference between
local time MINUS UTC(GMT)... just a few examples:
-
enter "2" if you are in Germany, BeNeLux, France, and windoze has adjusted
your PC's clock for daylight saving time (MESZ)
-
enter "1" if you are in Germany, ... , and windoze has adjusted your
PC's clock for winter time (MEZ)
-
enter "0" if you are in Great Britain, Portugal, etc; it's winter time or
if you have convinced windoze not to fool around with your PC's clock in
October
-
enter "-5" if you are on the east coast of Canada or the USA (EST).
etc... or use the trial-and-error method until the time shown in this dialog
displays the correct UTC value. In earlier versions, the program tried to
find out the correct UTC by itself, couldn't handle daylight saving time
properly. For this reason, it's now up to you, dear user, to enter the correct
time zone here if you need it :o)
Timer Calibration: In this
edit field, the precise frequency of a CPU-internal timer can be defined.
This timer is used as a "high-resolution" timebase. Its frequeny is often
3.58 MHz, in some PCs only 1.79 MHz. The nominal value is queried automatically,
but for some special applications you can enter the precise frequency here.
Clock Source for timestamps: Defines the clock source for timestamps
(in spectra, waterfall time grid, and the "time"-function which is used in
export data definitions). These options are avaliable:
-
Use audio sampling clock only: Gives the best resolution and almost no 'jitter'
because the time is calculated from the count of audio samples, plus an "offset"
to get date+time. If you use a 'calibrated' sampling rate, or even an external
A/D converter, this option is the best choice.
-
Slowly pull towards PC's real-time clock: Provides a better long-term accuracy
in some cases, especially if the audio sampling rate is drifting or not
calibrated. With this option, the timestamps are always very close to the
PC's real-time clock (usually one second or less).
-
(temporarily removed:)
-
Daily clock
error : The daily drift of your PC's "real time clock". Unit is
seconds per day. Use the DCF77-decoder, a radio-controlled
clock or the evening news on TV to find this value. Use this feature only
if you really need it, and only if your PC runs in a thermally stable environment
for a long time. If your PC's RTC is too slow, the value must be
negative. The Reset button clears the number of accumulated
'compensation' seconds. Use this button after correcting the PC's clock from
an external program. Internally, the program keeps a copy of the time when
the clock error was zero.
See also: TRX (transmitter/receiver) interface settings, audio settings,
back to top
Audio
Settings
To open the audio settings dialog, select "Options"..."Audio Settings" from
Spectrum Lab's main menu. Some of the parameters are explained here:
-
Audio Input Device, Audio Output Device:
-
Select which audio device ("soundcard") shall be used for input or output.
Only useful if your system really has more
than one soundcard. The audio device selection boxes may appear disabled
if the audio stream comes from (or goes to) an external
audio server. The audio server may be a simple
interface program which reads analog samples from an
external A/D converter, etc.
Note: Entries beginning with a number are standard multimedia drivers. Entries
beginning with a letter are ASIO drivers. If
an ASIO driver is selected as the INPUT device, the selection for the OUTPUT
device is disabled, because in this case the same ASIO driver will be used
for in- and output. ASIO provides a lower latency between in- and output,
but is not available on all systems.
Input devices "SDR-IQ / SDR-14" require an extra hardware on the USB port,
or a TCP/IP connection to a server running a USB/TCP-IP gateway. More info
on using SpecLab with SDR-IQ is available in an extra
document. And if you want to use SL with PERSEUS, read
this document .
To exchange uncompressed audio streams with other applications (for example,
Winamp), you can select also select the
Audio-I/O-library
(a special DLL) instead of the soundcard.
For absolute measurements, the input amplitudes must be
calibrated. Amplitude display units like Volts
or dBuV only make sense if the relationship between A/D converter value and
absolute input voltage is known. Otherwise, stick to the default amplitude
display unit which is "dBfs" (dB relative to full scale) .
-
Other sources, other destinations :
-
These links take you to another tab of the configuration dialog, where
alternative sources and destinations for digitized audio (or quadrature IF
streams) can be configured. This includes audio servers
and -clients, which can be connected through different ways (UDP/IP,
TCP/IP, WM_COPYDATA messages, periodically written audio files, etc). The
WM_COPYDATA method was, for example, used to receive data from the
"winamp-to-SpecLab" plugin, which is described
here.
If the "local" soundcard is used for in- and possibly output, you don't need
to care about these other sources and destinations.
-
Sampling Rate:
-
The nominal audio sample rate of the soundcard, which is the number of samples
per second read from the analog/digital converter.
Both sound-input and -output use the same sampling rate (dictated by hardware).
You should use the lowest possible sample rate allowed by Shannon's theorem:
With 8000 samples per second, you can process signals up to 4000 Hz. Don't
use higher sample rates just because your soundcard supports them ! Only
for very special applications (like the "VLF radio"), sample rates up to
48000 samples / second may be necessary. SpecLab works with sampling rates
up to 192kHz, but only a few cards really support such high sampling rates.
Caution, the windows multimedia driver will happily deliver any sampling
rate - even if the hardware doesn't support it (it will be interpolated then,
which is not really helpful).
Some cards can play dirty tricks when you use 48000 samples per second, which
leads to "phantom signals" on the waterfall. See the
notes in the "VLF Radio" application.
Some other cards play dirty tricks when running in full duplex (which means
input + output running at the same time): For example, the input- and the
output sampling rate may be slightly different. More details in the
chapter about output resampling. (use a
different output sample rate; any ratio between 0.5 and 2.0 is possible).
Also don't miss the sampling rate calibration
if you use the program for the first time, or have installed a new
soundcard.
-
Sampling
Rate Divisor:
-
Defines the decimation ratio between the analog/digital conversion rate and
the processing rate of all following stages (which you can see in the component
window, for example frequency converter, digital filter, but also the Spectrum
Analyzer).
Reducing the sample rate at this early stage is especially helpful if you
run out of CPU power, because -depending on what you are doing- the real-time
sound processing threadwhats_a_thread can 'eat up' a lot of the available
CPU time. The internal processing rate is:
<Sampling Rate> divided by <Sample Rate Divisor>,
for example:
11025 samples per second, divisor set to "2" will give an internal processing
rate of 5512.5 samples per second. This would be enough to process audio
signals below 2kHz (theoretically 2756 Hz, but this is impossible because
of the anti-alias-filter's roll-off).
Note: After this decimation stage, and before the FFT calculation, there
may be more decimation stages. See 'FFT
Settings'.
-
Bits per sample
-
Defines the resolution of the A/D converter. Usually 16 bits per sample.
A few cards also support 24 bits per sample, resulting in more dynamic range
(only required in rare cases though). Has only been tested -with positive
result- with the Soundblaster Audigy 2 ZS, but the difference between 16
and 24 bit per sample can only bee seen if the input signal is *very* weak.
With most 'real-world signals' you won't see a difference in the spectrum,
unless you have the ultimately pure sine wave generator on your workbench.
The theoretic dynamic range with 24 bits is somewhere near 20*log(2^24) =
144 dB, more realistic are 108 dB as specified for the Audigy 2 card.
For most applications, stick to a resolution of 16 bits per sample.
-
Use anti-alias filter
-
has no effect at the moment, because the anti-alias filter is always enabled
if the Input Sample Rate Divisor is set to 2 or higher.
The anti-alias filter's length may be adjustable in future releases.
-
I/Q input adjustment
-
Switches to a submenu of the circuit window, where the gain balance and phase
errors from an image-cancelling direct conversion receiver can be compensated.
More details can be found in a separate
document (if you don't know what a direct conversion receiver is, you
don't need it anyway.. )
-
Sample Rate Calibration
Table
-
Because the true sample rates used by some soundcards (also expensive ones!)
differs significantly from the 'nominal' value, you can enter the true values
for a number of standard 'nominal' rates in this table. The "one-time" sampling
rate calibration procedure is explained in another
file. For normal audio applications, you don't need this.
In rare cases (depending on the soundcard), the conversion rate of the ADC
and the DAC can be different. Since Version 2.7, Spectrum Lab contains a
resampling function which can cope with this problem, but it requires some
additional CPU power (see the notes about soundcards with
slightly different sampling
rates in the next chapter).
If you are looking for extreme frequency accuracy, there is the possibility
to 'detect' or 'calibrate' the sample rate
permanently but you need a stable reference signal).
Note: Besides these settings, be prepared to spend a few hours playing with
your soundcard's own "volume control panel" (or whatever the manufacturer
called it), until you managed that the audio input (from the "line-in" jack)
only(!!) goes into the A/D converter, and the card's audio
output (the "line-out" jack) is only fed from the D/A converter,
without annoying bypass. Read more about this in the
document about SL's
installation. Since May 2004 there is an extra chapter for the
Audigy 2 ZS (and possibly similar cards
by Creative Labs), because it was sooo complicated to achieve - but it can
be done !
back to top
(added 2007-11-09)
In certain cases, the sampling rate of the audio output (DAC) may be different
from the sampling rate of the input (ADC).
For example:
-
The input comes from an external "box" (for example, an
SDR), which uses an exotic sampling rate that is
not an integer multiple of your computer's soundcard,
-
your computer's soundcard uses slightly different sample rates for the in-
and the output (this happened, for example, with the integrated audio device
in Thinkpad notebook). How to notice this is explained further below.
-
you want to connect an exotic audio output device to the computer, which
doesn't use one of the 'standard' audio sampling rates
In these cases, open the "Audio I/O" tab in SpecLab's configuration dialog.
Set the checkmark "use different output sample rate", and enter the nominal
sampling rate. For example:
[v] use different output sample rate:
nominal : 22050 Hz
SL will try to lookup the precise sample rate in the
sample rate calibration table.
The "precise" sampling rate for the output may be a bit difficult
to find out if you don't have a hardware frequency counter, but there is
a trick how to do this below. SpectrumLab needs to know this "real" output
sampling rate to calculate the precise resampling ratio, which may be any
fractional number (thanks to an algorithm similar to those explained at
http://www-ccrma.stanford.edu/~jos/resample/ ).
The next chapter describes on of the most important applications of the output
resampling function.
A quick check to see if the input- and output sampling rate of your soundcard
are exactly equal (as they should) :
-
Turn the option "use different output sample rate" off (see above)
-
Turn on both ADC and DAC in the circuit
window (so the soundcard runs in full duplex mode)
-
Turn on one of the sine waves in the test signal
generator, and connect it to the output
-
Let the generator run for several minutes, and listen to the tone. If you
hear a clean note without any gaps (popping or clicking sounds), you don't
need different input- and output sample rates !
Otherwise, in the main menu, select "View/Windows"..."Debugging Window".
On the Debug tab, there are indicators for the input- and the output buffer
usages. Watch the display for "OutBuf=XX %" and "InBuff=XX %". Typically
(if all works well in full duplex mode), the output buffer is filled to 40
.. 60 percent, and the input buffer is filled to 0 percent. Why ? As soon
as input samples are received from the soundcard, they are processed; so
the input buffer is ideally empty most of the time. On the other hand, the
output buffer must not run empty - otherwise, there is the chance of interrupted
audio output (which you hear as "popping" or "clicking" sounds). When the
audio processing starts, the output buffer is filled to about 50 percent
of the available space.
If the "OutBuff" percentage slowly decreases, the true output sampling rate
is higher than the nominal value (as in the example shown above).
If the "OutBuff" percentage slowly increases (or the "InBuf"-percentage
increases), the true output sampling rate is smaller than the nominal value.
If you have a frequency counter, you can easily find the correct value for
the true ("real") output sample rate: Use SL's test signal generator to produce
a 1000 Hz tone, measure it with a frequency counter, and calculate the "real"
sample rate as below:
f_sample_real = f_sample_nominal * f_test_measured / f_test .
Example: f_sample_nominal = 22050 Hz, f_test = 1000 Hz, f_test_measured =
1006.8 Hz
-> f_sample_real = 22050 Hz * 1006.8 / 1000 = 22199.94 Hz .
After this, there should be no more input buffer overruns, or output buffer
underruns... until you install another soundcard !
back to top
Multiple soundcards
in one system
If you have more than one audio device (soundcards eg) in your system, you
can select the audio input and output which shall be used by Spectrum Lab
in the audio settings.
Beware: The names which appear in the selection list are sometimes quite
cryptic, like "Nr. 3 = Spiele Kompatibeles Gerät" on the author's machine.
Though the author's PC only had a single soundcard, the program found three
different "devices" (which all worked - all connecting to the same "line"...
strange).
However, if you are sure to have only soundcard, leave both "Audio Input
Device" and "Audio Output Device" set to the default value (-1 = use default
WAVE input / output) as shown above.
Entries in the device selection lists which do not begin with a number are
ASIO drivers. More information on how to use ASIO is in
this separate document .
See also: audio servers,
program start with command line
parameters .
back to top
Audio File Servers and
Clients
It is possible to connect Spectrum Lab to an other application which serves
as "remote Analog/Digital converter" or "Digital/Analog coverter". The other
application then acts as "Audio File Server" to replace the audio input (ADC)
and/or output (DAC). This may be used as an interface to any kind of exotic
audio hardware. (Note: You don't need this if SL shall analyze the audio
input from your "local" soundcard !)
To establish a link between an audio client and an audio server, the audio
client (which is Spectrum Lab) must know the name of the audio server, or
at least the name of the file produced or consumed by the server. All this
can be configured in Spectrum Lab's "Audio File Server" menu:
For example the program may receive audio data from an audio server called
"SndInput.exe" and sends sound data to "SndOutpt.exe". (These are just
examples, I use these two programs myself. Instead of SndInput.exe
use SerInput.exe if you have an external A/D converter on the serial port.
See notes below)
In this case, simple disk files are used to exchange audio data from "producer"
to "consumer". The audio file transfer protocol is very simple (not "FTP"
for heaven's sake :-), it is described in a file which is available from
the author of Spectrum Lab (part of the sound utility package, files
"SoundUtilityInfo_01.txt" (english) and "SoundUtilityInfo_49.txt" (german).
Two sample programs which use the soundcard are written in plain "C", and
are available on the DL4YHF website. They can easily be adapted to drive
any external A/D or D/A hardware. To drive the author's PIC-based A/D converter
(connected to the serial port), use the serial
input utility mentioned further below.
To use an external A/D or D/A "server" program, fill out these fields in
Spectrum Lab's setup dialog:
-
"consume ADC file"
-
Activate this checkmark if you want to use an external audio file server
instead of your soundcard's analog/digital converter,
and enter the name of the file which will be produced by the audio server.
Example: ..\SoundUtl\audio.dat
-
"to start A/D server"
-
This is an optional service if you want to start your A/D server automatically
from SpecLab (only possible when the audio server runs on the same PC as
SpecLab, otherwise you will have to start the server manually). Example:
Example: C:\SoundUtl\SndInput.exe /of=audio.dat /sr=11025 /ch=1
/dt=1
(Look into the A/D server's manual for the
necessary command line parameters ! The command line may be added automatically
after you selected the server by clicking on the [...] button )
-
"to stop A/D server"
-
This is a similar command line as the one above, but to stop the A/D file
server (and terminate itself, usually..). The command line argument for both
SndInput.exe and SerInput.exe is
/quit .
-
"produce DAC file"
-
Activate this checkmark if you want to use an external audio file server
instead of your soundcard's analog/digital converter,
and enter the name of the file which will be produced by the audio server.
Example: ..\SoundUtl\to_dac.dat
-
"to start D/A server"
-
Works like "to start A/D server" (described above) if you want to start the
D/A-conversion server automatically from SpecLab.
Besides the "file-based" audio interface, it is possible to send and receive
uncompressed audio streams via UDP, TCP/IP, or other network protocols:
Notes:
-
While the "A/D" server is in use, the message "File doesn't exist" may appear
on the tabsheet "A/D D/A Server". This is not an error. It only means that
SpecLab looked for the audio exchange file and didn't find it, because the
server has not produced a new file since SL last deleted it. Under normal
conditions, the message toggles between "no error" and "file not found".
If the "file not found"-message never disappears, make sure the filenames
are correct, and the A/D server writes the file into the directory where
SL expects it. It may be helpful to specify the full path for the audio file,
not just the pure filename (something like "c:\temp\audio.dat" instead of
just "audio.dat").
-
SL uses 16-bit integer values (by default) to communicate with "audio file
servers". This may be different if decimated I/Q sample pairs are used.
-
For more information about
the "sound input" and "sound output" utilities, look into the file
?..\..\SoundUtl\SoundUtilityInfo_49.txt
(in german) or
?..\..\SoundUtl\SoundUtilityInfo_01.txt
after downloading and unpacking the "sound/audio utilities" from
DL4YHF's website. If you already
have a copy of DL4YHF's "Sound Utilities" on your harddisk: The
SoundUtilityInfo-links only work if you have downloaded these utilities and
copied them into the same directory structure as in my original "source files".
PIC-based A/D converter
for the serial port
Since October 2002, a firmware is available for a PIC12F675 microcontroller
which can be used as an external A/D converter for 2 channels at exactly
2500 samples per second. Data are sent to the PC through the serial port
("COM1" or "COM2"). PIC-Firmware and "interface driver" program ("SerInput.exe")
can be obtained from the author, or downloaded from DL4YHF's homepage. The
"interface driver" program is implemented as an audio
server for Spectrum Lab (and almost any other application, written in
any programming language which can access simple disk files). See
hardware desription for the PIC-based serial A/D
converter for more details.
Different audio-processing programs running on the same computer can send
audio in real-time to other applications without the need for an extra soundcard,
or a virtual audio cable. Spectrum Lab (and a few other applications written
by its author) can use WM_COPYDATA messages. Details about the principle
are here. One application
which uses this feature is an output-plugin for Winamp, which allows you
to play MP3 files (and audio streams received from the internet) directly
into Spectrum Lab. Details about the Winamp-to-SpecLab plugin are
here.
For remote site survey, uncompressed audio can also be sent through a local
network. For example, a remote VLF receiver consisting of an old laptop PC
with soundcard and WLAN adapter, located in an electrically quiet place,
can send an *uncompressed* audio stream for logging and further analysis
into the shack.
The following controls (checkmarks and input fields) on the "A/D &
D/A Server" tab on SL's configuration screen are used for this purpose:
-
[ ] Receive audio via TCP / UDP
-
Set this checkmark, select the protocol, and define the (source-) IP + port
number of the computer from which you want to receive an audio stream (as
a client).
-
[ ] Send audio via TCP / UDP
-
Set this checkmark, select the protocol, and define the (source-) IP + port
number of the computer to which you want to send an audio stream (as a client).
-
[ ] Act as a SERVER for audio-via-TCP/IP
-
Set this checkmark if your computer shall act as a SERVER for audio-requests
from other computers (the "clients" mentioned above).
Notes:
-
For UDP (user datagram protocol), there are no "clients" and "servers", just
one sender and at least one receiver. When testing UDP on a shaky WLAN link,
audible dropouts could be detected. But UDP is such a nice simple protocol
(it can easily be implemented on a microcontroller with ethernet interface),
that in some cases UDP may be better suited than TCP/IP.
-
Don't confuse the integrated HTTP server with
the audio-via-TCP-server, and never
use the same IP port number for these functions ! Though both use TCP/IP
as the underlying protocol, they are totally incompatible. If you try to
connect the audio-via-TCP-server with a web browser, the best you can expect
is getting a message like "400 Bad Request - this is not an HTTP server !"
.
-
At the moment, no standard audio streaming protocol (such as RTSP) is implemented
in Spectrum Lab. But, there is the
winamp-to-speclab plugin, so you can use winamp
as the "bridge" between SpecLab and such streams.
-
The built-in protocol was designed to be simple, stupid, but as flexible
as possible (including timestamp, calibrated sampling rate, format descriptor,
etc). A specification about the protocol use in SpecLab will be available
one fine day (if someone asks for it) .
back to top
Since it is rarely used, this plugin is not part of the Spectrum Lab installer.
Instead, you can download it from
here
- or, if the page has moved because I changed my ISP, search for "WINAMP
-> Spectrum Lab output plugin". That page also described the installation
of the plugin (which means to unpack it, and copying the DLL into
Winamp's plugin folder).
It is an "output" plugin from Winamp's point of view. From Spectrum Lab's
point of view, it is an audio source like many others. SpecLab doesn't need
to know that this particular plugin sends the audio data. All you need to
do within SpecLab is set the option
Receive audio data through
WM_COPYDATA messages in one of the configuration tabs.
Some technical details about the communication between this (older) winamp
plugin and Spectrum Lab are explained here.
The other direction (from Spectrum Lab to Winamp) is also possible, i.e.
send audio from SpecLab to Winamp. To do this, you will need another plugin
(an "input plugin" from Winamp's point of view) which can be found
here.
If the link is broken, search the web for "DL4YHF Audio I/O libraries". You
will also find the sourcecodes, and a manual (PDF) for the audio I/O libraries
there.
... turned into a nightmare, and was only possible with "ancient" plugins
from Winamp Version 2.9 (and older). The full story is
here. It may still be working, but most of the
plan was abandoned in 2008 .
back to top
FFT
settings
The FFT settings are now a part of the Configuration and Display Control
dialog. It can be opened from the menu "Options ... FFT Settings". The following
parameters can be adjusted :
-
Decimate FFT Input
(formerly: Sample Rate Divisor)
-
An internal "sample rate divisor". This parameter is used to decimate the
samples before the FFT calculation. If the audio processing rate is 8000,
and (for example) the "Rate Divisor" is set to 4, the 'internal' sample rate
for the FFT input is only (8000/4=) 2000 samples per second, reducing the
CPU power and increasing the FFT resolution.
BUT: The higher the "Rate Divisor", the lower the maximum frequency that
can be detected with the FFT.
Note: The sample rate may have already been decimated at an earlier stage
! See 'Audio Settings'.
-
FFT input size
-
The number of samples that are processed by a single FFT calculation. Must
be a power of 2. This parameter influences the frequency
resolution in the FFT output.
Since program version V1.2, the FFT Size does no longer define the speed
of the scrolling waterfall !
The higher you set the FFT size, the more frequency esolution you will get,
but the longer it will take to calculate an FFT. On slow PCs (<100MHz),
you should leave the FFT input size below 16384 samples. If the CPU is too
slow, the waterfall will scroll slower than it should !
A detailed discussion of FFT input size, decimation, sample rate and
frequency resolution is here.
-
FFT window function
-
Selects the windowing function for the samples in the time domain. Each block
of samples which enters the FFT will be multiplied with this function, which
usually has a shape of a raised sine wave, with values near zero at the edges
of the window, and one in the center. For most applications, the Hann window
(mistakingly called "Hanning") is often the best choice because it has
a good dynamic range (suppression of sidelobes) while maintaining a low
equivalent noise bandwidth. For details, search Wikipedia on "window function"
(used to be on en.wikipedia.org/wiki/Window_function). The window functions
implemented in SL are:
Rectangle, Hamming, Hann, Gauss, Nuttall, Flat Top. They can also be set
through the interpreter.
Notes on the FFT windowing functions:
- The equivalent noise bandwidth for the currently selected FFT parameters
is displayed in the info box below the FFT settings.
- The formulas of the FFT windowing functions are contained in the SL
installation archive, in the file 'Goodies/fft_windows.txt'. You can load
that file with DL4YHF's "CalcEd" ("calculating editor") to plot the windowing
functions in a graphic window.
- for the experimental correlogram
display, you may have to use the rectangular window .
-
FFT Type and Center
Frequency
-
"Real-number FFT": Preferred type for all broadband applications,
where the displayed frequency range shall start at "DC" (0 Hz). No frequency
conversion inside the spectrum analyser.
"Complex input with frequency shift": For narrow-band applications,
if only a small frequency range (centered around any audio frequency) is
of interest. This only works together with a decimation factor of 4 or higher.
Internally, the analysed signal is multiplied with a complex oscillator
signal (the "center frequency"). The complex signal (with "I"- and "Q"-branch)
is then decimated, and the decimated signal (with a low sampling rate) is
fed into a complex FFT.
"Complex input with separate I/Q channels": also a complex FFT, but
no oscillator and complex I/Q multiplier inside the frequency analyser.
Instead, the I- and Q-branch is fed into the analyser via two separate input
channels. These two channels can be the LEFT and RIGHT input of a soundcard
running in stereo mode, or an external two-channel A/D converter. More
information about I/Q processing with Spectrum Lab is here.
-
Include F.O. calibrator (Frequeny
Offset Calibrator)
-
This is only possible if the FFT type is set to "complex input with frequency
shift". With this option, the frequency error (measured by the
frequency offset detector)
is subtracted from the complex oscillator frequency as explained in the previous
paragraph.
-
FFT output unit
-
Select the display unit for the FFT results (for spectrum graph and
waterfall):
V (volts), W (power in watt), and several logarithmic scales (dB, dBuV,
etc).
The linear scales (voltage or power) are sometimes better to detect very
weak signals in the waterfall display, expecially with high noise floor.
The logarithmic scales ("dB" with different reference levels) are more common
if the input signal has a high dynamic range.
Absolute unites (like V, dBuV and a few others) only make sense after an
amplitude 'calibration' as explained here.
Hint: You can compare signal amplitudes directly in decibels with the "readout
cursor" in the spectrum display. The cursor function also uses the "FFT output
unit" for display, so this name is a bit misleading.
-
FFT internal average
-
This parameter may be important if you try to 'dig' very weak signals out
of the noise.
A value of 0 will give no averaging, a value of 3 will already reduce the
random noise a bit, and will make the spectrum look smoother, so weak coherent
signals crawl out of the noise on the spectrogram display. The higher the
average value, the greater the smoothing effect, but if the value is too
high the spectrum (and spectrogram) will react too sluggish. See also: Overwiev
of different averaging-
and smoothing options.
-
FFT smoothing (parameter: number of
neighbour bins)
-
This option can help to detect very weak, but relatively "broad" signals.
The smoothing parameter are the number of "neighbour" bins in the FFT which
are averaged to form the smoothed spectrum. Internally, a Gaussian kernel
is used. Unlike FFT averaging (which operates on consecutive FFTs), the smoothing
option affects the shape of a signal (for example, it turns a 'sharp peak'
from a coherent signal into a wider (Gaussian) 'hump'. But if the signal
is already a hump with a certain bandwidth anyway, this option can help to
squeeze the last fraction of a decibel out, so a signal becomes visible in
the spectrum display. Try to match the smoothed bandwidth to your observed
signal to get the best result with this function .. it may require some
trial-and-error. The FFT Smoothing was revived in SpecLab for the
EVE experiment.
-
FFT output type
-
Set to "Normal (amplitude only)" for a normal spectrogram without phase (or
radio-direction) information,
-
or to "Complex (real + imaginary part)" for special applications - for
example phase analysis,
or to "Radio Direction Finder" for a
radio-direction-finding spectrogram where the
colour indicates the azimuth angle.
Note 1 : Some FFT output types don't affect the waterfall display, but only
the FFT export (as file)
!
Note 2 : The spectrum replay function (which
transforms spectra back into audible signals) only works if
the FFT output is set to "complex", otherwise the phase information in the
original signal gets lost.
back to top
(last modified 2008-01-06)
These settings are part of the Setup Dialog which can be opened from SL's
main menu via "Options".."Spectrum Display Settings". Here just some parameters
which need explanation. Parameters with a (2) are located on the
second part of the spectrum display
settings, because the space on the first tab was not sufficient.
-
Vertical Frequency Axis
-
Affects the layout of the
spectrum/spectrogram screen. The classic waterfall display scrolls from TOP
to BOTTOM, so the time axis is vertical and the frequency axis is horizontal.
If the option "Vertical Frequency Axis" is checked, the frequency axis will
be rotated by 90 degrees and the waterfall will scroll from RIGHT to LEFT
(which is better for HELL modes and for visual decoding of slow CW).
-
Logarithmic frequency scale (2)
-
With this checkmark set, the frequency scale for both waterfall and spectrum
graph will be logarithmically scaled (which is preferred by musicians). Otherwise
the frequency scaling is linear.
-
Mirror for Lower Side Band
(2)
-
Usually the lower frequency will be on the LEFT or LOWER side of the frequency
axis. With this option set ("checked"), the frequency axis will be mirrored
so the lower frequency will be on the RIGHT or UPPER side of the frequency
axis (depending on the "Rotation" of the frequency axis).
-
Split frequency scale
(2)
-
Allows to split the frequency scale
for the waterfall and spectrum graph in two sections. The frequency
ranges of both settings can be defined independently. If the "split frequency
axis" is enabled, you can divide the screen area with the mouse on the small
'gap' between both parts on the frequency scale. When the mouse cursor is
replaced with the splitter symbol, hold the left button pressed and move
the mouse.
This option can also be activated from a popup menu on the frequency scale
(use the right mouse button to open a popup menu, while the mouse cursor
is on a certain screen element).
-
Amplitude grid
-
activates a grid (overlay) for the spectrum graph, usually in 10- or 20-dB
steps (depends on display unit and height of the graph area).
-
Double-width waterfall lines
-
is an option added for high-resolution screens. With this option, each new
line of the spectrogram is drawn twice on the screen. If you have a monitor
with a vertical resolution of 1536 pixels, try this option if you cannot
see individual lines in the spectrogram. The option is also good for fast
non-scrolling spectrograms (waterfalls) without causing unnecessary CPU load
(because it halves the number of FFTs calculated per screen sweep).
-
One pixel per FFT bin
-
With this option enabled, the frequency scale will always be stretched so
one screen pixel (along the frequency scale) will represent exactly one FFT
bin. The 'Max' frequency field on the control panel on the left side of the
main window will be disabled if this option is active (you can only enter
both 'Min' and 'Max' frequency if the 'one pixel per bin' option is off).
The benefit of this option is that you always see the maximum frequency
resolution for a given FFT size on the screen (but you may have to pan the
frequency scale around to see different frequency ranges).
Tip: There is an option to zoom into the spectrum with exactly 'one pixel
per bin' in the popup menu of the main
frequency scale.
-
-
Optimum waterfall average
-
Is especially useful for slow waterfalls. With this option, as many FFT's
as possible are calculated and summed up before they go into one line of
the waterfall. This greatly smoothes the noise for 'overnight recordings'
or if you want to get a nice curve of your receiver's passband. The number
of FFTs added for one waterfall line can be examined in the Debugging Window
("Waterfall average count"). It depends on the waterfall scroll interval
and the time required to collect enough audio samples for one FFT.
-
Multi-Strip Waterfall (with "number
of pixels per strip")
-
Speciality for long-term observations. If this option is enabled, the spectrogram
screen will be divided into a number of vertically (or horizontally) stacked
"strips" which will show the history of a long time on a single screen -
for the expense of the displayed frequency range, or frequency resolution.
The parameter "number of pixels per strip" defines the height of each strip,
if the frequency scale runs vertically, othewise its width.
-
Triggered Spectrum (should read "Triggered Spectrogram" but there
wasn't enough space ! )
-
Only for "very special" applications. If this checkmark is not set, the spectrum
runs 'free' (without the need for a 'trigger', only controlled by the waterfall
scroll interval). Otherwise, new spectra are calculated only after a certain
"trigger" event. More details are
here.
-
Non-Scrolling Waterfall ("Radar-like" view)
-
.. may be more friendly to the eye for very fast spectrograms (short "scroll"
intervals, which do not really scroll in this mode).
An example for this option can be recalled from the "Quick Settings" menu:
select "Natural Radio"..."Sferics and Tweeks". It uses a 2-millisecond drawing
interval - quite impossible to see any details if the image scrolls 500 times
a second !
-
Peak Detecting
Cursor
-
Sets the mode of the frequency/amplitude readout cursor. When you move the
mouse across the waterfall or the spectrum, the displayed frequency and amplitude
is the PEAK value, and the frequency resolution of the displayed value is
much higher than the FFT bin width (thanks to an interpolating algorithm
which was suggested by DF6NM. Works best when FFT windowing is set to "Hanning".
Readings with a milli-Hertz accuracy (not just
resolution) can be taken after
calibrating the soundcard's sampling rate.
-
Peak-holding spectrum graph
-
If this option is set, the spectrum graph shows an additional curve with
the peak value of the previous N seconds. The number of seconds can be set
between 0.5 and 60 . This function is good for reading the amplitudes of
"short tone bursts" or similar, or to display the result of a frequency sweep.
For this reason, the peak values can be cleared and "frozen" via interpreter
command too.
The colour of the peak curve in the spectrum graph can be modified
here.
Note: The actual peak detection is done more frequently than the display
update ! Some "peaks" may have such a short duration, that you won't recognize
them in the momentary spectrum graph, but only in this peak indicator.
-
Average spectrum graph (over a range of
spectra from the spectrogram screen)
-
If this option is set, the spectrum graph shows yet another curve, which
shows the average spectrum over the visible spectrogram screen ("waterfall"),
or a selection within the waterfall area. This option was added in 2007 for
an "extreme" weak signal test, which required an extra long integration.
Details can be found here (Earth-Venus-Earth
test on 10 GHz, using the 20 meter parabolic dish at the IUZ in Bochum).
-
Emphasize MIN+MAX values
-
With this box checked, both min- and max values will be displayed in the
spectrum graph. Actually, the area between min- and max value which
occurred within one
-
Show Spectrum as Bargraph
-
Normally, the spectrum graph is drawn as a thin curve. With this option,
it is painted using solid bars, which are better visible from a distance
(looks a bit like a colourful level indicator of a graphic equalizer, because
the colours of the bars indicate the amplitude since they use the colour
from the waterfall palette).
-
Show... (selection combo)
-
This combo box defines whether the
spectrum graph and/or the
spectrogram (aka waterfall), or the
3D spectrum is visible in the main
window. Futhermore (if the frequency axis shall be vertical) it defines if
the spectrum graph shall be on the left or on the right side of the screen
("show both / plot on the right" means "show both spectrum graph and
waterfall, with the graph on the right side").
-
-
Show Amplitude Bar
-
This 'amplitude bar' is the blue strip which runs along the spectrogram
(optionally). The white line inside it shows the (broadband-) amplitude present
at the input of the spectrum analyser, measured at the same time when the
data for the FFT were calculated. The amplitude bar can be parametrized on
the second part of the 'Spectrum Display Setting' - see next chapter. The
"..visible"-checkmark only turns the bar on and off (if you don't need it).
-
Mathematics
-
Usually set to "none", if one or two independent channels shall be displayed
in the spectrum window. The other options only work if two input channels
are connected to the main spectrum analyser:
"CH1 - CH2" = calculate spectra for both channels, subtract the 2nd from
the 1st channel, and only show the difference
"CH2 - CH1" = simular as above, but subtract the spectrum of channel 1 from
the spectrum of channel 2.
An example can be found in the preconfigured setting
"SpecDiff.usr", where CH1 is the
test signal for a filter, CH2 is the filter output, and the display shows
"CH2 - CH1". In that example, that's the filter's frequency response, because
the filter is fed with broadband noise from the test
signal generator.
-
Spectrum Graph Area (pixels)
-
Defines how large the spectrum graph area shall be, if both graph and spectrogram
(waterfall) shall be visible at the same time. The default value is 100 pixels.
-
-
Channels / Connections
-
This button takes you to the circuit window where
you can select the input channels for the spectrum analyser (which can be
connected to different "taps" within the test circuit; not only to the inputs
from the soundcard).
-
Waterfall Scroll Interval
-
Defines how much time passes between two steps of the waterfall. If the option
"Optimum Waterfall Average" is not set, this parameter also defines the time
between two FFT calculations. Be careful not to make this value too low,
unless you have a quite fast PC. Don't expect your 50MHz-486 to do five
FFT-calculations with 32768 input samples per second - this example requires
a 266MHz-P2. A modern machine by today's standards does a lot more of
course.
With the "automatic" option, the
waterfall scroll interval will be automatically selected, depending on the
current FFT size, for a 50 percent overlap (which makes sense due to the
FFT windowing).
Note 1: The spectrum replay function only works
if the scroll interval is set to "automatic, for 50 percent overlap".
Note 2: For the reassigned spectrogram display,
overlaps of 50, 75, or 87.5 % worked best.
Note 3: The "scroll interval" has no effect if the option "triggered spectrum"
is enabled and set to "trigger for ONE LINE of the spectrogram". This gives
you the opportunity to control the waterfall scroll interval through an external
sync signal (it was used for a doppler radar experiment once).
-
Waterfall Time Grid
-
Produces an overlay in the spectrogram with periodic time markers. As long
as the 'Source' field is empty, the 'Interval' field usually defines the
number of seconds (or minutes) between to time ticks. "Style" defines how
the time markers shall be drawn over the spectrogram (as dotted line, solid
line, or just a small "tick"). Each marker can optionally be labelled in
a selectable format, or user-defined formatted text. If the "Label" combo
set to "User Defined", you can define the format string for the time label
in the field "user-defined time label format". Some examples for suitable
format strings are here . Since 2006-10,
the user-defined label may even be a variable string expression (evaluated
by the interpreter before printing the label) like the following example
(caution, for advanced users and 'special applications' only) :
str("## dB",peak_a(500,3000))
The str()-function used in this example does is explained
here (it converts a numeric value into
a string). Some black magic lets the peak-function in this example use the
spectrum "under" the time marker to calculate the peak amplitude in the specified
frequency range.
The 'Source' field inside the group 'Waterfall Time Grid' can be used for
special applications, where the source for the time markers shall not be
the time, but something else. For this purpose, any numeric expression can
be entered in this field. The result from this expression will tell where
the markers are placed (in combination with the 'Interval' field: Whenever
the value calculated from the 'Source' expression, divided by 'Interval',
truncated to an integer number, gives a new value, a new marker will be painted
on the waterfall. Too complicated ? Here's a simple example: With 'Source'
set to water.lines - 1 -
water.line_nr, the timescale will not show a count of seconds, but the
current pixel position.
By default, the time markers painted near the waterfall time grid will show
the current date and time, or (while a file analysis is in progress) the
time-of-recording. You can change this time in the
file analysis dialog.
Spectrum Display Options, Part 2 (second
tabsheet)
-
Amplitude Range and Spectrogram
Options (tab 2)
-
Allows you to reduce the displayed amplitude range for the waterfall and
spectrum graph. The default settings cover a large dynamic range (like -120
dB to 0 dB). If, for example, you are only interested in weak signals between
-60 and -50 dB, adjust this range accordingly.
The 'Offset' can be used to modify the displayed decibel scale. It is not
necessarily a fixed value, but a numeric expression which will be periodically
evaluated by SpecLab's interpreter. The gray field right next to the input
field shows the current value. This feature was used to take the automatic
gain of a "real" receiver into consideration when displaying "absolute" voltage
readings in the spectrum graph.
Note: Of course, you can adjust the waterfall colour palette with the
'contrast' and 'brightness' sliders,
so everything below -60 dB will be black for example, and everything above
-50 dB will be white; but reducing the displayed amplitude range here will
also make the spectrum graph look better.
Additional, the visual AGC function can be turned on for the spectrogram
display. Details about the visual AGC are
here.
-
Amplitude Bar (2)
-
Shows the total amplitude in a coloured bar, running alongside the
spectrogram display. In contrast
to the spectrogram, the amplitude bar doesn't depend on frequencies. The
size and display range of the amplitude bar can be defined independently
in its control panel (regardless of the "Displayed Amplitude Range" for the
spectrum / spectrogram). The following controls can be found in the group
"Amplitude Bar", which is on the second part of the spectrum display
configuration screen:
- visible : turns the amplitude bar on/off
- with scale: means a scale (in percent) shall be visible near the amplitude
bar, covering a part of the frequency scale
- size: displays the width or height of the amplitude bar in pixels (whether
this is "width" or "height" depends on the
screen layout / rotation )
- show channels from watch window: defines which of the channels of the
watch window shall also be plotted
into the amplitude bar. These are decimal channel numbers, separated by comma.
For example: 1,2,3 means "plot the plotter-channels number one, two, and
three also into the amplitude bar".
- display range: Defines the amplitude scaling for the amplitude bars (the
"seismogram"), in percents of the maximum analog/digital converter's input.
100 % means the display range of the amplitude bar covers the full ADC swing
(the point of clipping, which should be avoided). 10 % display range is more
suited for most applications. Note: The additional channels which can be
plotted into the amplitude bar are not affected by this parameter. They are
entirely controlled by the "min" and "max" values entered in the watch-window.
-
-
Options for the frequency axis (2)
-
Contains the following checkboxes, which were once on the first tabsheet
(before running out of space there). This group contains the following options,
which should speak for themselves:
- show grid in spectrum graph
- show grid in waterfall display
- use dotted grid in waterfall (note, this applies to the FREQUENCY scale
only)
- split frequency scale
- logarithmic frequency scale
- mirror for lower side band
-
Options for Triggered Spectrogram
(2)
-
If the option 'Triggerd Spectrum' is set, the
universal trigger function can be used
to trigger the acquisition of data for the next FFT (=a single waterfall
line) or a complete spectrogram sweep (= a complete waterfall screen). With
this option, you can -for example- realize an external trigger if you connect
the trigger to one channel of the soundcard, and the spectrum analyser itself
to another channel.
Note: The triggered spectrogram only makes sense in 'Non-Scrolling Waterfall
Mode'. In combination with the 'Triggered Average' option, it can be used
to dig weak but periodic signals ("pings") out of the noise, as explained
in this example . In
that mode, there are individual average buffers for every spectrogram
line. The "Reset" button on this panel can be used to erase those
average buffers to start an all-new reception cycle.
An overview of the various
AVERAGING modes is
here .
-
Note:
-
Some of the settings explained above apply to the currently selected channel
of a spectrum analyser, but most of them are common of all channels. To toggle
the channel number, click the button labelled
"Shown: Settings for Analyser 1, channel 1" or "Shown: Settings
for Analyser 1, channel 2" ... etc
Every click on this button toggles the channel number.
-
back to top
To scroll the waterfall (spectrogram) back
in time, a large buffer can be used, which stores a lot of calculated
spectra (more or less, the results of the FFT calculations). The contents
of this buffer can be browsed with the
'buffer overview' in the control
bar on the bottom of the main window.
This buffer is in RAM, but can -optionally- also be a large disk file. Which
is best for you, depends on your application. If you don't need to scroll
back in time, only use a small RAM buffer (which is required for repainting
the spectrogram, after changing the contrast/brightness values, zooming into
certain frequency ranges, etc).
The following 'Spectrum Buffer Settings' can be modified on the configuration
screen:
-
Buffered lines in RAM
-
This edit field is used to define the maximum count of spectrum lines buffered
in the PC's main memory. The spectrum buffer is required to be able to "scroll
back in time" while recording new spectrum samples.
If you experience periodic hard disk accesses after every FFT (or waterfall
step), you should reduce this value because your PC runs out of "real" RAM
and starts swapping memory from RAM to disk.
A value of 200 is ok for all PCs even with only 16MB RAM (if not too
many other programs are running).
On machines with 128MB RAM and more, use 400 lines.
If you have 256 MB RAM or more, use 800 lines so the full screen can be repainted
after zooming or modifying the waterfall colours.
This parameter will be effective only after exiting and restarting the program
because the buffer is allocated only once during program initialization.
-
Use file buffer
-
A file can be used as an extra large display buffer. Also enter the name
of the disk file here, so you can have different buffers for different
applications. Switching from one file name to another sometimes requires
exiting and restarting the program.
-
Max. FFT bins in file
-
To make more efficient use of the buffer file, you can define how many FFT
bins (frequency samples) shall be written into the file. If, for example,
the spectrum analyzer uses an FFT size of 65536 points, but you are only
interested in a small portion of the spectrum (say a quarter of the bandwidth
covered by the soundcard), enter "16384" here, or even less:
In an other "extreme" case, you may only want to observe 19.5 to 22.5 kHz
while your soundcard runs at 96 kHz (so the FFT covers 0..48 kHz). To save
space in the buffer file, you only record (22.5-19.5)kHz / 48kHz = 6.25%
of the total bandwidth. From a 65536-point FFT, you only need 65536 * 0.0625
= 4096 bins. This is the value to be entered in the field "Max FFT
bins in file". (Why so complicated ? All entries in the file buffers have
the same size for simplicity, and the buffer does not change its file structure
automatically when you select another FFT resolution).
The "center" of the frequency range which will be written into the spectrum
file buffer will be taken from the "center frequency" of the main spectrogram.
If you zoom out of the narrow frequency display, parts of the waterfall which
are no longer present in the RAM buffer will remain black if they are not
contained in the buffer file.
If the currently used FFT size greater than the count of bins in a buffer
file entry, a warning message will be displayed in the setup screen, like
this:
| WARNING: The FFT size (65536 bins) exceeds the currently used
buffer (4096 bins). |
-
Having read the explanations above, you can decide to accept recording only
a part of the input spectrum in the buffer, or to change the buffer settings
(set the number of bins in the buffer to the same value as currently used
under FFT settings. But, to make the changes effective, the old buffer file
must be discarded, and a new one (with different structure) must be
written.
-
Max buffer file size
-
Limits the size of the spectrum buffer file (if such a file is used at all).
Helps to reduce the risk of running out of harddisk space, which will cause
problems under windows. For most applications, a buffer size of 200...2000
MByte is sufficient, and most modern HD's have many gigabytes more than
this.
See also:
back to top
These settings are part of the Setup Dialog, now on the 3rd part of the
"Spectrum" display settings.
-
Colors:
-
Used to customize some colors used for grids, graphs, scales, text labels,
etc. (this does not include the color palette
for the waterfall)
-
Spectrum graph background, Spectrum graph grid, Pens1 ... 4 :
-
Click on one of these panels to modify the color used to display these parts
of the "spectrum graph".
Pen 1 is used to draw the current or averaged spectrum,
Pen 2 for a temporary (instantaneous) spectrum which will be added to the
average spectrum (if averaging is ON),
Pen 3 is used for the peak hold indicator
(if enabled),
Pen 4 is used for the FFT-based filter's
frequency response (and other optional elements like the spectrum alert function)
.
Note: The pen colour for the reference spectrum
curve is defined on the "Reference Spectrum / Frequency Response" tab
of the configuration window.
-
Frequency scale background, Frequency scale foreground:
-
Set the colors of the frequency scale between spectrum graph and waterfall
(which was black on orange in earlier versions).
-
Waterfall grid, Waterfall Label Text, transparent waterfall label:
-
Color for the waterfall grid, text on scales and transparancy of the text.
Some users prefer transparent text, others opaque. If you use a black &
white waterfall palette, you can use blue waterfall grid, blue label text
and transparent labels for example (will always be visible). If the checkmark
for "transparent" is off, the text will be opaque (it appears in a solid
rectangular box with the waterfall grid color). The text itself always appears
in the "Label Text" color. Do not use the same colors for "Waterfall grid"
and "Label Text" if the text is not transparent !
The waterfall frequency grid can either be a solid or dotted line; individual
frequency grid lines can be added or suppressed with the user-defineable
frequency markers.
back to top
Up to twenty(?) frequency markers can be displayed on the frequency scale
(for waterfall and spectrum graph). A table like this is used to "connect"
the marker either to a fixed frequency or to any "frequency-dependent" parameter:
(screenshot "Markers" in the Configuration
and Display Control window)
A name must be supplied for every marker which shall be visible on
the frequency axis or in the waterfall diagram. Lines in the marker definition
table are treated as 'unused entries'. A every frequency marker's name
will be displayed as a "hint" when the user moves the mouse across the marker
on the frequency scale.
The value column shows the current position of the marker (frequency in Hz,
with or without "RF" offset - see below). For all markers, this will be the
last position to which the 'operator' dragged the marker via mouse... unless
one of the functions presented below doesn't prevent that.
The type of a marker defines how it shall appear on the screen. It
is defined as a combination of letters which will be explained in the
following section in detail. The type
is optional. By default, a marker only appears as a diamond-shaped icon on
the main frequency axis.
The color of a marker can be modified by clicking on the panel in
the lower left corner of the dialog window. Additionally, this column in
the definition table may include a combination of the "flags" shown just
below the table.
The marker's RF-flag defines if this marker displays a RADIO-FREQUENCY
(RF=1) or a BASEBAND-FREQUENCY (or "AUDIO-FREQUENCY"; RF=0). A radio frequency
includes the current VFO-frequency, which is added to the baseband frequency
for the display. Details about BASEBAND- and RADIO frequencies are
here.
The set procedure is an interpreter command which will be executed
whenever the user tries to move the position of the marker with the left
mouse button held down. The new frequency value is passed to this command
on the local variable "x". If you use this feature, you can use the frequency
marker like a slider.
The read function is a numeric expression (see examples) which is
periodically evaluated (every 500ms or so). This is done because a frequency
marker can be connected to something which changes its value by itself, for
example the AFC center frequency of the digimode decoder during receive.
If the result of the read function changes, the marker will automatically
move along the frequency scale. If no read-function is specified for a marker,
its position is freely movable with the mouse, and it's frequency ("value")
will be saved between two SpecLab sessions. Thus, a marker can be used like
a "variable" to store a single frequency value. To markers can be used to
store a frequency range, etc.
Some examples for the use of frequency markers as sliders (to control a few
of Spectrum Lab's components):
| Set Procecure |
Read Function |
Remarks |
| generator[0].freq=x |
generator[0].freq |
display and modify the frequency of the first sine wave
generator |
| circuit.osc.freq=x-650.0 |
circuit.osc.freq+650.0 |
Used for the VFO in the VLF software radio
with 650 Hz "audio IF" |
| filter[0].fft.fc=x |
filter[0].fft.fc |
reads or modifies the center frequency ("fc") of the
FFT-based filter. |
| filter[0].fft.fs=x |
filter[0].fft.fs |
reads or modifies the frequency shift ("fs") of the
FFT-based filter.
Often used as a software "beat frequency oscillator" in software-defined
radios. |
|
|
|
|
|
|
Since 2009-06, frequency markers can also be used -a bit easier- without
having to define a special "set"- and "get"-function. If a frequency marker
does *NOT* have a special 'read function' (as explained above), it can still
be moved on the main frequency scale with the mouse, and the current value
(frequency) of a frequency marker can be polled from the interpreter using
one of the functions listed further below.
An overview of Spectrum Lab's interpreter functions can be found
here.
Functions (and -commands) to access frequency markers through the interpreter
Frequency markers are numbered from N=1 to 10, like in the 'frequency marker
definition' table shown above. The
frequency, and possibly some other properties of a frequency marker, can
be accessed through the interpreter using the following commands (or functions):
-
fmarker[N].freq
-
returns (or sets) the current frequency of a marker. Unit is Hz.
-
Examples:
-
"f="+str(fmarker[1].freq)+" Hz,
a="+str("##",peak_a(fmarker[1].freq-50,fmarker[1].freq+50))+" dB"
-
(used in any of the programmable
buttons, "variable expression" field)
Displays the frequency of that marker (in Hz), and the peak amplitude in
a frequency range "near" that marker.
back to top
The type of a frequency marker defines how and where a frequency marker
appears. The following marker types can be used, also as combinations
of these lower case letters:
-
s (frequency marker type 'scale')
-
Marker appears on the main frequency scale.
-
w (frequency marker type 'waterfall grid line')
-
A thin grid line at the marker's programmed frequency appears in the waterfall,
using the marker's color which can be defined on the
'marker settings' tab. This makes it possible
to have additional lines in the waterfall's frequency grid. You can use to
mark odd frequencies like 15.625kHz in the waterfall which would usually
not appear on the automatically generated grid (which can be enabled and
disabled on the 'display settings' tab).
-
d (frequency marker type 'disable frequency grid line')
-
Suppresses one of the frequency grid lines on the waterfall. For example,
there may be a frequency scale from 10..20kHz with visible grid lines on
the waterfall spaced 1kHz. You have an interesting signal at 16 kHz (let's
call it GBR) and don't want to have this particular frequency covered by
a frequency grid line. Define a marker named "GBR" with the type "d" or even
"sd" (so you can see it on the frequency scale). From now on, the 16kHz-line
is ommitted (excluded) in the frequency grid.
As noted in the frequency marker settings, a marker can be programmed to
use either the baseband- or the radio-frequency.
-
A radio frequency includes the VFO frequency (= "the frequency to which the
external radio, or downconverter, is tuned to").
-
A baseband frequency does not include that frequency offset.
For example, let's assume Spectrum Lab is connected to a software-defined
receiver (SDR), which is tuned to a center frequency of 7.03 MHz ( = "VFO
frequency" displayed on the SDR control panel). The quadrature IF (intermediate
frequency) output is sampled 44100 times per second (f_sample=44.1 kHz).
This means, the I/Q stream covers a baseband frequency range of
-f_sample/2 to +f_sample = -22050 Hz to +22100 Hz.
An audio tone appearing in the baseband at 1000 Hz corresponds to
a radio frequency of 7.031 MHz .
Markers displaying RADIO frequencies should be used ...
-
to tune the radio (VFO control)
-
to show the frequency of radio stations in the frequency scale
Markers displaying BASEBAND frequencies are better suited ...
-
to adjust the "audio filter" (bandwidth and center frequency; or lower and
upper cutoff frequency)
-
to indicate certain frequencies which are *not* related to the VFO tuning
frequency, for example the receiver's audio passband, FM stereo pilot tones,
etc.
-
to control the test signal generator in Spectrum Lab (because the test signal
generator produces baseband signals, not radio frequencies)
back to top
Sorry - still under construction. Use intuition ;-)
More about using wave files for logging and analysis can be found
here .
back to top
To realize absolute voltage readings, level readings in
dBuV, etc, the program needs to know the relation
between input voltage and A/D converter value. For example, a 16-bit
analog-to-digital converter may reach the maximum positive output value of
32767 at an input voltage of 200 mV. This value (input voltage for the maximum
ADC value) can be entered in the setup window (from the main menu:
Options ... System Settings .. Amplitude
Calibration . It doesn't matter what hardware is actually used - it
may be a soundcard, an external A/D converter on the serial port, a software
defined radio (like SDR-IQ or Perseus).
The value entered in the field labelled max ADC input voltage
is the single peak voltage ("Vpk" - not the peak-to-peak
voltage) fed into the soundcard, SDR, or whatever. You can measure the single
peak voltage with an oscilloscope if you have. The typical procedure to determine
this value is as follows:
-
Connect a signal generator set to sine wave output, with adjustable amplitude
to the analog input of the soundcard / SDR / etc. Turn the output voltage
low initially to avoid damage to the receiver !
-
Open the "input monitor scope" in Spectrum Lab, and set the vertical
magnification to 1 (which is the default)
-
Slowly increase the signal generator's output amplitude, until the sine wave
in the input monitor reaches the clipping point (i.e. touches the upper and
lower edge of th scope display).

-
Measure the peak voltage of the signal generator (with a real oscilloscope).
-
Enter that value in the input field mentioned above ("max ADC input
voltage").
Note You can use the 'technical' notation like 20m (m=milli) instead
of 0.02 in this field. After clicking "Apply", SL will convert the entered
value into the default format.
Typical values for software defined radios (giving values for soundcards
is pretty useless here, because those figures will always depend on the
ever-changing soundcard settings):
-
SDR-IQ near 1 MHz, bw=50 kHz, RF gain +10 dB, IF gain +24 dB : Vin_peak_max
= 22 mV (*)
-
SDR-IQ near 1 MHz, bw=50 kHz, RF gain +0 dB, IF gain +24 dB : Vin_peak_max
= 58 mV (?)
-
SDR-IQ near 1 MHz, bw=50 kHz, RF gain -10 dB, IF gain +24 dB : Vin_peak_max
= 172 mV
-
SDR-IQ near 1 MHz, bw=50 kHz, RF gain -10 dB, IF gain +18 dB : Vin_peak_max
= 346 mV
(*) Peak values measured with a TDS 210 oscilloscope with 1:1 probe, using
the scopes "Pk-Pk" measurement, divided by two.
(?) - Check this: 20 * log10( 58 / 22 ) = 8.4 dB ; 20 * log10( 172
/ 58 ) = 9.4 dB . Either the author's measurements, or the preamp gain is
inaccurate...
See also: Spectrum reference,
Audio settings ; back
to top .
All parameters are (by default) saved in an old style INI-file named
"SETTINGS.INI" which will be created in the current directory of the spectrum
analyzer. These files can -if necessary- be loaded with a text editor (a
nice way to copy a group of parameters from one file to another if you know
what you're doing).
There will be no changes made in the windows registry ! To restore the default
settings, simply delete the file SETTINGS.INI. If you want to run multiple
instances of the program at the same time, you must provide the name of the
settings file in the command line.
To make changes in the "Setup"-window effective, click the "Apply!"-button.
Clicking the "Close"-button without "Apply" will close this control window
without using the new settings.
After making changes to the settings, you can define them as a new entry
in the "Quick Settings" menu. See user defined menus
for details.
If you want to have multiple instances of the program with different settings
running at the same time on a single machine (possibly using different
soundcards), you can change the name of the configuration files via command
line argument. This allows you for example to generate different icons to
start Spectrum Lab with different settings, but all in one single directory.
See also: Program Start with Command
Line Arguments, main index .
back to top
See also: Spectrum Lab's main index .
Last modified: 2006-05-01 (YYYY-MM-DD)