You are on page 1of 50

Visual Analyser HELP

By Alfredo Accattatis

Main window
Brief list of the functions implemented in Visual
Analyser (VA)
VA is a real time program which simulates a set of
electronic instruments, such as:
Oscilloscope (dual channel, xy, time division, trigger);
Spectrum Analyzer with amplitude and phase display

(linear, log, lines, bar, octaves band analysis 1/3, 1/6, 1/9,
1/12, 1/24, CUSTOM spectrum);

Wave-form generator with "custom functions", triangular,

square, sinusoidal (all with NO ALIASING and smooth


transition), white(gauss, uniform)/pink noise, pulse
generation, DC generation;

Frequency meter (in time and frequency domain) and

counter; in time domain by means of a real time zero


crossing algorithm;

Volt meter with DC, true RMS, peak to peak and mean

display plus resolution calculus;


Filtering (low pass, hi pass, band pass, band reject,

notch, "diode", DC removal);


Memo windows (data log) for analysis and storage of

time series, spectrum and phase


with "triggering"
events; THD and Impedance data logging with spline
interpolation; possibility to save the graphics in various
format (.tee, .txt, .wmf) )and display them with an internal
viewer;
Screenshot of Spectrum and Scope window;
A TRUE software digital analogue conversion (for

complete signal reconstruction using Nyquist theorem) ;

Frequency compensation: possibility to create/edit a

custom frequency response and add it to the spectrum


analyzer computed spectrum; added standard weighting
curves A,B,C in parallel with custom frequency response;

Support for 8/16/24 bit soundcard by means of API calls;


Internal 80 bit IEEE floating point variables for minimum

rounding error;
Unlimited

frequency sampling (depend from


capabilities of your soundcard/acquisition device);

Cepstrum analysis;

the

Cross Correlation;
Extended THD measurements, with automatic sweep,

compensation, data log;


ZRLC-meter with Vector Scope, sweep in time and

frequency for automatic measurement; original algorithm


to reduce systematic errors,
Calibration mechanism (you can calibrate the VA scales

directly in VOLT or dB or PERCENT FULL SCALE);

Set of values computed in real time (peak to peak, peak,

crest factor, form factor, true rms, mean, frequency with


zero-crossing algorithm);

..and more

About Visual Analyser (VA) and its author


(skip this section if you are interested only in the
description of the main window and related functions)
I love electronics, and I have been working for years
in commercial companies as software/firmware
engineer and software designer. I've been writing
programs for embedded systems (with DSP and
MICROCONTROLLERS), for PC, for avionic computers
and even for mainframes, using C, C++, Pascal, Ada
and assembly. I write VA during my free time just for

fun. The program is completely FREE.


Many people do not have the money to buy an
expensive Oscilloscope or a Spectrum Analyser. Or
simply they do not want to invest money for something
they will use rarely. Nevertheless they love to build and
test audio amplifiers or other kinds of simple circuits,
and are only interested in the range of audio
frequencies. So, a good soundcard could be all the
hardware they need. A newer soundcard with a
sampling frequency of 96 or even 192 kHz will allows to
manage frequencies up to almost 100 kHz ( well
beyond the audio frequencies) transforming VA in a
powerful set of instruments for general electronics.
Latest versions of VA are able to manage also the 24
bit soundcard capabilities; if you are using a 16 bit
soundcard, you'll be able the same to select the 24 bit
modalities; in that case the resolution will be 16 bit
shifted to the left of 8 bits (i.e. is the same to multiply
the sample value for 256).
The idea of using the soundcard of a PC is not a new
one (there are many of programs like VA) but I tried to
write a program made for the analysis of audio circuits
for the electronics hobbyist. I think VA is probably less

"extravagant" than other (i.e. less windows and frills)


but full of substance and even a lot of original idea.
General introduction
There are two ways of using VA. The "Standard" and
"Floating" mode. The first time you run VA, after
installation, it will run in "standard" mode. The VA.INI
file does not exist yet (see warning at the end of this
file), and so VA runs with default settings (i.e. in
standard mode). If VA.INI is not present in the
execution directory it will be automatically created.
Standard mode
Standard mode means that VA is full-contained in a big
main window of fixed minimum dimension of 790x637
pixel and freely sizeable over this minimum dimension.
The main window contain the scope & spectrum
windows plus a subset of the commands you can find
in settings window. Other commands and options are
contained only in settings window, because less
frequently used, although very powerful (example: the
calibration function). The other windows (i.e. the
frequency meter or the volt meter) are separate from

the main window and in some case freely resizable.


This separate windows will be visible only if the
appropriate checkbox has been checked
or the
correspondent button (just under the caption of VA)
pressed.
Floating mode
Floating mode means that the main windows is
reduced to a sort of command bar with a series of
button, a "led" and a combobox for the selection of the
input source (enabled only if the checkbox "apply
calibration" in Setting/Calibrate has not been checked).
In floating mode you can freely select the windows of
your interest, in this way you can personalize VA
according your needs. In floating mode all the windows
are all freely sizeable (except the wave generator
window and the setting window itself) and completely
separate from the main window/command bar. In other
words, if you, for example, need only a scope, simply
press the button "scope", then resize the windows (full
screen if you want...) and VA will be only a scope. Due
to the automatic configuration saving, each time you
run VA you'll find exactly the last configuration (see
warning below). The scope and spectrum windows are
provided of a "command bar" which contains some

"shortcut" to the commands most frequently used


(auto-scale, average, logx/y etc.).
WARNING:
The configuration of VA is automatically saved in a files
named VA.INI, saved in the execution directory of VA
(normally c:\programs\VA); this means that when you
start VA, you'll find exactly the same configuration you
left the last time at the end of the program.
"Configuration" means the position and dimension of all
the windows (except for settings window) and all the
choice you made (ex. square wave in wave generator,
A + B channels in spectrum/scope , trigger ON for left
channel etc.). If you need to return at the default
configuration you have two choice: (1) delete VA.INI (2)
press the "default" button in Settings windows. If you
need to save a particular configuration (to use at a
later time for a particular purpose: for example
determining the frequency response of your Hi-Fi
amplifier), you can save the configuration in a different
INI file pressing the button "save as" in Settings window
and then defining a new name for the current INI file.
To open this configuration file at a later time you should
press the "Open config" button in Settings window
and then select the desired INI file. Be careful that at

the end of the program the new configuration will be


saved in the current INI file, that is, the INI file indicated
in the caption of VA or in the "info" windows.

The main window


The main window (standard mode) contains at a
glance:

Oscilloscope;
Separate main option for left and right channels;
Spectrum Analyzer;
Main commands, divided in sub folder (Main,
More, Cepst., THD, IMD);
Pop-up menu for quick operation;
Selection of input source;
Slider for Input and Output level;
Buttons for quick recall of main instruments;
Input and Output gain button: to invoke quickly the
Windows mixer utility, both in case of Windows XP
(and lower) and Vista/Seven

In more details the upper border of the main window

contains the buttons (both in standard and floating


mode) called COMMAND BAR:

On/off
Setting
Phase
Scope
Spectrum
Wave
Freq. meter
Filters
Floating Windows mode
Help

and the listbox for the selection of the input source,


plus two slider for manage the input and output level.
This listbox is directly related to the selected
soundboard; when you select an input is exactly the
same of selecting the input source by means of the
Windows Volume control. You can invoke the original
windows volume control opening the "Setting" window
(click Settings button) and selecting the "calibrate"
option. Then you need to press the "Windows volume"
button. Warning: for some PC configuration with old or
not properly installed mixer utility the input listbox may

appear disabled. Use original windows volume control


or install the updated driver for your soundcard. Some
soundcard do not provide at all the internal input and/or
output mixer and related software driver.
In the next section a detailed explanation of the
buttons functions.

The COMMAND BAR


The ON buttons allows to start VA. VA is a real time
program, it reads the samples directly form the
selected soundboard by means of API calls. There are
mainly three task. One read the samples from a buffer
of selected dimension (a power of two, typical 4096
points) and store it in an internal dynamic buffer. After
a read it will be suspended waiting for a new buffer.
You can select the dimension of the buffer selecting it
in the "settings" window (see next sections). The more
points you select the more resolution you get but
conversely VA need more time to compute the
Spectrum.
The second task get the dynamic buffer and compute

the Spectrum by means of the well-known algorithm


FFT (Fast Fourier Transform), and then plot it on the
screen in the spectrum window together with the scope
window.
The third task is completely dedicated to the user
interface (buttons, listbox, etc.)
The OFF button is the opposite of the On button. In the
latest version of VA it is the same ON button, that
simply change its function, as standard for many
Windows programs. Normally you can even change the
settings of VA while it is running. The settings you can't
modify during run will be disabled or may cause a
temporary stop of VA (automatically).
The Settings button allows to invoke the settings
window. This window allows to issue all the commands
to VA plus the settings for the Soundcard and colors.
You can use it for example when you're using VA in
"floating mode"; in fact, the most common commands
are directly available in the floating windows itself, but
not all. So, if you need you can invoke the settings
window, and put it in a preferred position on the screen
using it as a command-center. See help on setting

window for further details (open the settings window


and click the help button in the page you want help
about).
The Scope button allows to invoke the floating scope
window, allowing you to use the scope function. You
can freely resize it up to the maximum screen
resolution, using VA as it were only a scope. Or you
can use it together with other windows (for example the
frequency meter window or the spectrum window). A
useful sub menu will appear in the scope window by
clicking the right mouse button. The Scope button will
appear disabled if the Standard mode is selected. See
scope window help for further details about the scope
window (open scope window, right mouse click and
select the help item).
The Spectrum button allows to invoke the floating
spectrum windows; this button will be disabled (it do
not appear at all) when the standard mode is selected.
The spectrum window, as the scope window, allows
you to freely resize the dimension up to the maximum
screen resolution; also for this window a quick menu
will be available by clicking the right mouse button; in
that menu you can select the help button for further

details about the floating spectrum window. See also


the help related to the Setting/Spectrum window.
The Phase button, allows to invoke the phase window.
This is a window not normally displayed during the
standard mode use of VA, i.e. not directly visible in the
main window of VA. This window allows to visualize the
phase of the signal(s) currently displayed in the
spectrum and scope window. The phase will be
normally visualized in degree, and you may want
visualize it together with the spectrum window. The X
scale is the same of the X scale for spectrum window,
allowing you to tile the two windows for visualizing a
complete "bode diagram". Also this window is freely
resizeable, allowing you to resize up to the maximum
screen resolution. A quick menu is available by right
clicking the mouse, with an help item to get further
details about the phase window itself. NOTE: this
window is intended to be still a beta version. No valid
feedback for now...
The Wave button allows to invoke the wave generator
window; this is one of the most powerful function of VA.
It cannot be freely resized, and can be closed while
running without affecting the selected function ; the

"on" button can be invoked directly from the main


window, for simplicity of use. That is, you can invoke
the wave window, select the function of interest, then
close the wave window and subsequently start/stop the
wave generation from the main window (by clicking the
on button between the "capture scope" button and the
"wave gen" checkbox). This will not be possible if you
are in floating windows mode, altought you can still
close the window without stopping the function
generation (if on selected). See the help included in the
window itself for further details.
The Freq. Meter button allows to invoke the frequency
meter window. This is a window not normally displayed
during the standard mode use of VA, i.e. not directly
visible in the main window of VA. This window allows to
detect the frequency of the harmonic with the maximun
amplitude in the whole spectrum of the input signal, as
a true frequency meter. This window starts a new
dedicated thread; the red flashing indicator in the upper
left corner of the window indicate the moment in
which frequency meter is reading data from the
spectrum; the frequency will be computed between two
red flashing. Click the help button in frequency meter
window for further details about the frequency meter.

The Filter button allows to invoke the settings window,


opening directly the subsection "filters". See help on
settings window for further details.
The Floating windows mode / Standard mode button
allows to switch between the two modalities "floating"
and "standard". Normally, the default mode for VA is
"standard mode", that is, the button will indicate
"Floating windows mode"; conversely, after the switch
in floating windows mode the button will indicate
"Standard mode".
The Help button will invoke this text.

The listbox Input selection allows to select the input


source. The behaviour of this control is different
according to the operating system. In fact, using XP the
meaning is selecting the input of the selected input
board. This latter can be selected in the Setting
window, in the Device TAB. On the contrary, Windows
Vista/Seven does not allow to select a device and of
that device a particular input; Instead, Seven allow to
select only an Input, independently from the actual

device who is hosting the input. So, when VA run


under an operating system from Vista on, the meaning
of the input listbox is the same all over the program
(hence, also in the setting window): input source.
The trackbar Input level allows to modify the input
sensivity of the selected input source; for maximum
generality, the scale is calibrated from 0 to 100.
The trackbar Output level allows to modify the
Output level of the selected output source; for
maximum generality, the scale is calibrated from 0 to
100.
Due to the large number of instruments implemented in
VA, in many section and window of VA there are slider
(trackbar) similar (identical) to the Input Level and
Output level main slider, present in main window. This
is for practical reasons; and fully synchronised each
other. For example, one can find the same trackbar of
the Input Level (present in main window) in the
Settings/Calibrate window, simplifying the calibration
procedure itself (if one need to change the input
sensivity, it is not necessary to switch between two
windows); in addition, in calibrate window the Input

Level trackbar has been duplicate, allowing to manage


separately the two channels (left and right) allowing, as
further option, a complete indipendent calibration for
the two channels.

The remaining options can be divided into two main


groups: the spectrum options, to the right of the
spectrum window, and the oscilloscope options, to the
right of the oscilloscope window. The spectrum options
contains also some setting of the oscilloscope.

Spectrum options
that options are subdivided into four main groups:
1) Main
2) More
3) Cepstrum
4) THD
5) Uncert

(1) - Main tab


This important group of options comprises the main
setting for the spectrum analyzer. They are reported
also in the setting window, and here repeated for
commodity when necessary; see Setting/Spectrum
help for further information.

Y-axis group: in this group it is possible to set the most


important feature of the Y axis of the Spectrum

Analyzer instrument. In particular the trackbar allows


to set the zoom scale factor; the button auto allows
to set automatically the zoom scale factor, finding the
maximum and minimum value of the spectrum
amplitude and adjusting the zoom trying to fit the
spectrum entirely in the window. The Log checkbox
allow to switch from the linear representation to the
logarithmic representation. This latter is obtained
plotting the ordinate in dB relative. The value
considered as zero dB can be adjusted manually by
clicking on the scale with the right mouse button and
selecting Zero Adjust option from the popup menu
(Zero Adjust, Reset zero, Auto : see below); then, the
zero value can be modified by dragging with the mouse
cursor holding down the left mouse button. In this case
the color of the scale will flash between a blue color
and the standard color selected for the channel. After
finishing with the operation, it is necessary to recall
another time the pop-up menu and de-select the Zero
Adjust option.
The popup menu contains three options, quickly
explained below.
Zero Adjust: enable/disable the Zero adjusting by
mouse
Reset Zero: set the zero at the default value

(=maximum allowed from the resolution)


Auto: set automatically the zero level as the harmonic
of maximum amplitude
The same option are available in the Setting/Spectrum
tab of the setting window.
The Hold checkbox activate a function that allows to
maintain only the maximum value reached by the
spectrum (peak hold) for each point of the graphic; that
is, for each frequency is plotted the higher amplitude
continously from the moment of the activation on. After
a long time interval the graphic will be most probabily a
static curve unless new peak is detected.
The Lines option allow to switch (when expected)
between the bar representation and line
representation. This latter kind of plot is obtained
simply joining the points with a segment (no
interpolation).
The Info option activate a further set of information
immediately below the frequency indicator in spectrum
analyzer window, at the upper left corner. The
frequency indicator show the frequency of the
harmonic selected by mouse when left mouse button is

hold down and the mouse moved on the spectrum: with


this latter function it is possible to display in a special
window, locked near the mouse cursor the list of all the
harmonic represented in that particular pixel with
amplitude, frequency and units. Moreover, in the upper
left corner is displayed the frequency of the first
harmonic of the list, and if the info option checked also
the amplitude in dB relative.
The average listbox allows to select among a series
of possible average factors, from 1 to 200 (and shortly
will be added the infinite option). The operating
principle is simple and powerful; the average is
computed on the last n buffer, with n varying, as said,
from 1 to 200. The average operate in a modalities
first-in, last-out, meaning that the average is
computed on the latest n buffer, that is, for instance, if
n = 10 this mean that after the available buffer are > 10
each new buffer is added at the tail of the queue and
the buffer at the head of the queue discarded. In this
way are maintained only the latest 10 buffers, and the
average is computed exclusively on them.
The Step option allows simply to define the step of
the vertical division in dB or Volt when allowed.

X-axis group: in this group it is possible to set the


most important feature of the X axis of the Spectrum
Analyzer instrument.
The log checkbox allows to change the
representation from linear to logarithmic of the X axis;
the 3D option allows to activate a special modality
(waterfall) enabled on almost all the standard
representation of the spectrum. It is still beta and under
construction (2011 version).
The true X checkbox allows to switch between two
different modalities to round the written numbers; when
selected, means that the values plotted on the scale
are exactly the values that the pixel represent;
otherwise it is a rounded value.
The combobox below the true X option allows to
select among the following option:

Fitscreen
x1
x2
x4
x8
x16
Octaves

CUSTOM

The Fitscreen option allows to plot the spectrum with


ALL the information available, adapting the plot to the
visible screen. This according to the following rules.
VA compute the harmonics according to the number of
points of the input buffer actually available (i.e. the half
of the dimension of the input buffer); and taking into
account that, as stated before, the number of pixel of
the X-axis is general different from the points to be
plotted. For example, having a window with 512 pixel:
1 pixel = 1 harmonic if the number of harmonics is
512 (buffer of 1024 points), the spectrum can be
plotted simply linking two consecutive points with a
line;
1 pixel = two harmonics if the number of harmonics
is 1024 (buffer of 1024x2 = 2048 points); this
means that in some way VA must use only one
pixel for two points;
1 pixel = representative of three harmonics if the
number of harmonics is 2048 (buffer of 2048x2 =
4096 points)
...and so on..

if the number is less than 512:


2 pixel = 1 harmonic if the number of harmonics is
256 (buffer of 256x2 =512 points)
4 pixel = 1 harmonic if the number of harmonics is
128 (buffer of 128x2 =256 points)
...and so on..
The general rule of VA is: DO NOT LOST or CONFUSE
harmonics. Apparently it is not possible to display more
harmonics than the number of pixel actually available;
nevertheless VA is able to do this without lost a single
bit of information. Having n pixel with m harmonic (m
greater than n) the trick is to display precisely more
than one harmonic with a single pixel. NOT by
summing the harmonics or (even worse) calculate the
average value or simply by displaying only the
harmonic with the higher level (this latter possibility is
indeed allowed only if desired, by selecting an
appropriate option in the more TAB of the main option
described far below).
The trick is to plot all the harmonics and hence
obtaining a vertical line giving the idea that the pixel is
representative of more than one harmonic; moreover,
you can distinguish exactly amplitude and frequency of

each harmonic by means of the mouse and a special


window: simply by clicking with the left button over the
desired harmonic (holding the button pressed). A
special window appear locked near the mouse cursor,
displaying the list of ALL the harmonics contained
(frequency and amplitude) in that point.
The x1..x16 options are exactly the opposite of the
fitscreen. In fact, simply means that the harmonic are
plotted each n pixel, where n vary from 1 to 16. For
example, if we select n = 4 (x4) this means that the
harmonics will be plotted each for pixel; if we select x1
we obtain 1pixel=1harmonic and so on. In this way
probably the complete spectrum does not fit the
available window (as number of pixel) and a trackbar
will appear at the bottom of the spectrum window
allowing to navigate horizontally in the spectrum
amplitude.
The Octaves option allows to plot the spectrum in
Octaves, enabling the combobox the allows to select
among 1, 1/3, 1/6, 1/9, 1/12 and 1/24 of octave.
The CUSTOM spectrum should be not confused with
Octaves representation, although similar at first look. It

allow in fact to define a spectrum arbitrarily, with the


value of the computed harmonic NOT obliged by the
frequency sampling and buffer length pair. In fact
normally, the computed harmonics are at a predefined
frequency distance, determined by the step computed
as :
Step = (frequency sampling) / (buffer dimension)
For instance, for a frequency sampling of 40960 Hz
and a buffer dimension of 4096 points we get: Step =
40960/4096 = 10 Hz. That is the first computed
harmonic is 10 Hz, the second 20Hz, the third 30Hz
and so on up to 40960/2 = 20480 Hz. Using the
CUSTOM option it is possible to define up to 1000
harmonic at ARBITRARY frequency. To define (and
save) the list of desired frequency, you should open the
definition window in Setting window and Spectrum tab
(Setting/Spectrum) by means of the button Custom.
See help in the window itself for the explanation of the
definition process.

Channel(s):
Channel(s) combobox allows the selection of the
channel to be plotted on almost all the windows of VA.
The indicated colors are referred to the default; A
channel is to be intended the left channel and B as
the right channel if a soundcard is used.
Ch A: (green color) select the left channel of the
acquisition device. The oscilloscope will display
only the left channel, the same for the spectrum,
for the volt-meter and the frequency-meter. The
window of "Capture spectrum" and "Capture
scope" functions will be filled only with left channel
samples.
Ch B: (red color) The same of Ch A but changing
left with right.
Ch A and B: (green and red color) By selecting this
option you will be able to view both the left and
right channel on the scope window and the
spectrum window. The frequency meter will show
the left channel frequency while the voltmeter both.
Ch A/B (B/A): This is a special modality that allows
to display the transfer function of a device if
properly connected. Normally used to compute the

frequency response of an audio device. In


particular the A(B) input channel should be
connected to the input of the device under test
(DUT) and the B(A) channel should be connected
to the output of the DUT. The program will
compute the transfer function of the device by
calculating the difference in dB of the two channel
(A-B or B-A, that using dB units is equivalent to
compute the ratio A/B or B/A) or directly the ratio if
linear scale used. The voltmeter will display both
the channel and the frequency meter only the left
channel.
Ch A - B: The displayed spectrum is the spectrum
of the difference of the channel. DO NOT
CONFUSE with the transfer function option; in fact
in this case the two channel are subtracted before
the FFT, in the time domain. In this way, the signal
is a single one and treated as a standard channel.
Ch B - A: The same of the previous point with the
channel swapped
X Y: This is an x-y visualization as a true
oscilloscope. The X-axis is the LEFT channel, the
Y-axis is the RIGHT channel. The spectrum
analyser windows will show both the channels, as
the volt-meter. The frequency meter will show the

left channel.
Ch A + B: Selecting the Ch A + B item the scope
windows will show the sum of the two channel
(yellow color), as the spectrum window, the volt
meter windows and the frequency meter window.
Ch A cross B: The signal displayed by the
spectrum analyzer window is the spectrum of the
cross-correlation between the A and B channel
(left and right); the signal displayed by the scope
window is the correlation signal.
Ch B cross A: The same of the previous point with
the channel swapped.

Wait, Req., Used indication. The numbers plotted in


this little windows, are the core of the acquisition
process of VA and very important indicator of the
correct running of the data acquisition thread. Req.
stand for Requested and is the time requested to get
two consecutive buffers of data. If we select a buffer
dimension of 4096 point, at the frequency sampling of
40960 Hz, the time to get two consecutive buffers is
4096/40960 = 0.1 seconds, that is 100mS. Naturally
during this time VA has a buffer available and, waiting

for the next, can in the meantime implement all the


necessary computation to implement all the activated
instruments (for example compute the FFT and
manage the user interface). The Used indication is in
fact the time actually used by VA to do the jobs, while
the Wait is the difference between the actually used
time and the Req time, that is the time NOT USED
from VA. When the time not used from VA is higher
than zero, and this means that VA is running on a PC
with a sufficient number of resource to execute the job,
the wait written remains gray, otherwise it became
RED. In this latter case means that VA is overloading
the processor.
Capture Scope: this button allows to activate one of
the most important function of VA; the so called time
domain capture function. It allows to capture in a
separate window all the acquired from the time the
button was pressed (and compute spectrum, save on
file, explore, convert from digital to analogue, etc). See
the help in Capture scope itself for further details, and
the Setting/capture window help for the capture main
option.
Capture Spectrum: this button allows, as the previous

described function, to capture directly the computed


spectrum of the spectrum analyzer in a separate
window. See the help in Capture scope itself for further
details, and the Setting/capture window help for the
capture main option.
WaveOn : this is a shortcut to the On/Off button of the
waveform generator; it allows also to distinguish if the
function generator is running in loop modality or not.
In fact, when in loop modality, after activating the
generator the caption of the button will switch from
WaveOn to WaveOff. If not in loop mode, it again
will switch but the caption will flash according to each
buffer passed to the acquisition/generator board. In
other words, if the real time mechanism of waveform
generation has been used, the caption will flash each
time a new buffer is passed to the hardware.
The Info button allows to open a simple window with
the main parameters listed in a table.
A group of checkbox, listed below, allows to invoke all
the instruments implemented in VA; except the first,
conceived to switch on/off the stay on top attribute of
the VA window, according to user needs. The complete

list of the checkbox:


1. Stay on Top
2. VoltMeter
3. Freq. Meter
4. Wave Gen.
5. Phase
6. THD view
7. THD+noise view
8. ZRLC meter
(1)
Has been already described;
(2)
The frequency meter window appear;
(3)
The Waveform generator window appear;
(4)
The Phase window appear;
(5)
Allows to enable the automatic THD (Total
Harmonic Distortion) calculus using the harmonic
with maximum amplitude taken as start point. The
results are displayed on the Spectrum Analyzer
window, with the same color of the activated
channel (displayed at the upper left border);
(6)
The same of (5) but for THD plus noise
calculus;
(7) The ZRLC window appear; this function require a
simple hardware to be connected to the dual channel

acquisition board or soundcard; an example is reported


in VA, see Setting/ZRLC window, checkbox Sch, or
see
www.sillanumsoft.org
<http://www.sillanumsoft.org> ZRLC section.

(1) - More tab

More stands in this case for more option and


historically born when VA needed to manage more
options than the standard options present in main tab.
They are related to Spectrum Analyzer and
Oscilloscope function, plus a viewer for the data saved
in standard Capture functions and ZRLC capture. It
includes a lot of new powerful options as the
frequency compensation, the definition of the X axis
extent, the screenshot and uncertainty. Moreover there
is the possibility to change the philosophy of plotting
modality for spectrum and scope (point/pix options).
Log viewers: the capture function, both in time domain
and in frequency domain, offer the possibility to save
the acquired data in many way (i.e. as text, in clipboard

and in .tee format). Saving the graph in .tee format is


the preferred method, allowing to save all the
information of the graphics (including color, number of
graphics, titles etc). To plot real time all over the
program have been used proprietary routines, except in
the capture window, where has been used the
TeeChart
standard
(see
www.steema.com
<http://www.steema.com>) shipped with the compiler
used to develop VA. This graphic Class allows to save
the graphics in a standard format with .tee extension.
VA used to add some extra data to distinguish between
the type of data saved (Spectrum, Time series, THD
etc all in common .tee format but related ad different
kind of data) and allowing to optimize the process of
backup and off-line analysis. In other words, you can
save the data and re-open it at any time using the
Open Graph button, without care if data has been
saved from ZRLC/THD or Capture Scope or Capture
Spectrum or whatever. In case the data were saved
with an older version of VA, it is possible to select the
Manual option allowing to select manually the type of
graphic to be loaded (buttons Scope, Spectrum,
Thd/ZRLC).

Points/pix: this first group of option, located


approximately to the left below the Log Viewer group, is
related to the Spectrum Analyzer. It allows to select one
of the following three options:

Full
Single
MinMax

Full means that the graphics, when (and only) the


option Fitscreen selected, is plotted as described for
the fitscreen option (described in detail elsewhere in
this help). As reminder, the fitscreen modality implies
thet in some cases more than one harmonic is plotted
for each pixel of the screen.
If instead the Single option is selected, only one
harmonic of the group of the harmonic represented by
the pixel is actually plotted: in particular ONLY the one
with the higher amplitude. In this way the Spectrum will
be plotted in the fastest way. In fact, sometime, due to
the large number of harmonics to be plotted with a
limited number of pixel, in a single pixel the graphic
routine must iterate a lot of times to plot all the
associated harmonics. Getting nothing more than a
vertical segment. By selecting the single option will be

plotted only a single pixel (related to the maximum


amplitude harmonic) and only one time.
In other words, the key difference between Full and
Single is that with the Full method the graphic will be
composed (also) of a lot of vertical line (similar to bars)
in correspondence of multiple harmonics per pixel; in
single the graphic will be composed ONLY of a set of
consecutives line linking single pixels.
The third option (MinMax) allows to plot a graphics
identical to Full but plotting exclusively the harmonic
of the multiple group having the minimum and
maximum amplitude. Obtaining in such way (a)
resource saving (b) same information and appearence
of Full. It should be the preferred method for
Spectrum graphic with a lot of harmonics and a
logarithmic scale selected for X-axis.
Points/pix: the second similar group, located at the
lower right corner of the more option tab, has the
same meaning of that of the Spectrum, but related to
the Oscilloscope instrument. In this case the single
option is NOT present as nonsense for an oscilloscope
(time domain and with sign).

X Freq Range group: exploiting this option it is


possible to define arbitrarily the range of the X axis; the
automatic modality allows to select the automatically
the maximum range allowed from the choosen
sampling frequency. Two preset button are present as
further facility.
Screenshot: the screenshot group contains a button to
capture an hardcopy (bitmap) of the Spectrum window
and of the Scope window. The third button allows to
invoke a simple bitmap viewer; in the open file window
a preview of the selected file is available.
(3) - Cepstrum
TBD
(4) - THD
TBD
(5) - Uncert

Statistical (A) uncertainty SPECTRUM Group:


allows to choose the value of an harmonic and to select
if compute the uncertainty of A-type (statistical) for
Spectrum Analyzer. The selection of the checkbox
Spectrum will invoke the uncertainty window
estimator, described in detail in local help. Note that the
A-uncertainty estimator work in a separate thread and
in real time. At the moment of writing this help, the
uncertainty estimator windows works only for left (A)
channel, or right channel (B). When both channel are
selected, only the left channel uncertainty will be
computed. The enable checkbox allows to invoke the
uncertainty window. Note that the list of available
harmonic will be updated if custom spectrum or
standard spectrum selected. The uncertainty may be
computed on the amplitude or phase spectrum.
Statistical (A) uncertainty SCOPE Group: The
selection of the checkbox Scope will invoke the
uncertainty window estimator, described in detail in the
proper local help. Note that the A-uncertainty estimator
work in a separate thread and in real time. At the
moment of writing this help, the uncertainty estimator
windows works only for left (A) channel, or right

channel (B). When both channel are selected, only the


left channel uncertainty will be computed. The
uncertainty may be computed on true RMS value,
MEAN value (both computed only on one input buffer)
or directly on the input sample (ALL points option). In
this latter case the number of samples will be very high,
and then the uncertainty estimator window maximum
number of samples reached quickly. In fact, if true rms
or mean value is selected, for each input buffer a single
measurement is performed, and then a single sample
sent to the uncertainty window. If all points option
selected, all the points in the input buffer are sent as
separate measurements. For example, for a 4096
buffer points, choosing a true rms uncertainty
calculation, a single value is sent to the uncertainty
windows each 4096 samples. Choosing all points,
4096 different values are sent to the uncertainty
windows. The safety limit of internal points
memorization of the uncertainty window is one million
points. After this value the histogram will not be
updated anymore while the uncertainty calculus, mean
and standard deviation will continue indefinitely to be
updated.

Scope options

The option of the oscilloscope instrument are located to


the right of the scope window itself; they are replicated
in the setting window. The setting window contains
further options. Each channel has its own separate
options, although exactly the same. Indeed the right
channel group has one more option (trig left
checkbox) allowing to trigger the left channel by means
of the right channel parameters (see next sections for
further details). The following controls description must
be intended for both channels except when explicitly
declared.
The scope window has two vertical scale that, as
explained elsewhere in this text and in other help files,
can be calibrated in percent full scale (%FS) and/or
Volt. As for the spectrum analyzer window, the vertical
scale could be enabled or disabled, accordingly with
the channel selection. The background color of the
scale is the same color chosen for the channel (that is,
the same of the graphic color).
Vpos vertical trackbar. Vpos stands for Vertical

position and allows to vary the vertical position of the


graphic track (of the related channel), varying
correspondently the associated vertical scale.
Trig vertical trackbar. Allows to vary the trigger level,
when (and only) the Trig checkbox is enabled. It
allows to display graphically the desired trigger level by
means of a dotted line of the same color associated to
the channel (i.e. if the channel color track is red, the
color of the dotted line will be red). The trigger level has
actually two meanings; the first is the standard one,
that is the level of trigger used by the internal
algorithms to trigger the waveform displayed from the
oscilloscope instrument; the second is related to the
Capture in the domain time (i.e. the Capture scope
function, see elsewhere in this text and the local help of
setting/Capture window). In this case, the trigger
represents (also) the threshold of the capture scope
function, when the proper option has been enabled in
the setting/capture window (after crossing trigger
threshold or only samples > trigger threshold option
selected). Also if used for this second purpose, the
trigger functionality will not be disabled (that is, the
trigger will acts anyway).

ms/d stands for millisecond/division and is the


equivalent of time base of a standard oscilloscope.
The oscilloscope time division is computed keeping in
mind the base concept already used for Spectrum
Analyzer instrument (and for the whole set of
instruments implemented by VA) : do not loss or mess
a single bit of acquired data.
Due to the VA philosophy the time division value
depends also from the dimensions of the oscilloscope
screen dimension, and so it will vary if the window of
VA resize. In other words, if you set a value of, say, 2
mS, and the window is resized, the time division could
be automatically modified (it become lower if the
window horizontal dimension decreases, and vice
versa). The time division displayed by the control is the
time between two adjacent vertical line, and it depends
from the number of pixel between the two vertical line.
Varying the dimension of the window, as the number of
horizontal division will remain the same, the distance
between two adjacent line will vary correspondently. In
fact, as for each pixel is associated a quantum of
time, the time division will vary necessarily.

The idea behind the time division mechanism is as


follows.
The default time division setting (that you can set
quickly by clicking on the zero button, the small button
at the upper left corner of the ms/d edit box) mean that
for each pixel a single sample is plotted. The internal
value of time division variable is in this case equal to 1
(one). By clicking the up button of the updown
control (at the right of the ms/d edit box) it will be
incremented by one; on the contrary decremented by
the same quantity. For positive values the meaning is
the number of samples plotted for pixel. So, as we
know the distance in pixel from two adjacent vertical
bars (dist variable), and the frequency sampling
(freq_sampling variable), it is easy to compute the
value of time division, by means of the following
formula:
Displayed time division in mS = ( 1 / freq_sampling ) *
dist * 1000 * num
Where the num variable is a positive number
When the num variable is negative, the meaning is

number of samples plotted each num pixel. For


instance, if num==-5 means that two adjacent samples
will be plotted each five pixel (and connected by a line
segment). The displayed time division will be computed
in this case by means of the formula:
Displayed time division in mS = ( 1 / freq_sampling ) *
dist * 1000 / abs(num)
To modify the number of both horizontal and vertical
division of the Oscilloscope window, one should use
the options located in the setting/scope window; in
particular see the Scope grid groupbox, and give a
look to the local help.
Zoom control allows to zoom the Y axis of the
oscilloscope instrument; it simply multiply the samples
for a zoom factor (the integer number defined in the
zoom edit box). The zoom factor can be varied from 1
to 256, and the corresponding Y-scale modified
accordingly.
Trig checkbox allow to enable/disable the trigger
function; it enables/disables the corresponding trackbar
controls.

Inv checkbox simply invert the


corresponding channel when checked.

sign

of

the

Trigger groupbox. Allows to define the main


parameters of the trigger function; in particular, the
slope of the wave form which the trigger should occur
( positive, negative ) and the threshold factor,
expressed in a scale from 1 to 1000 (i.e. expressed in a
per Thousand scale) . So, the trigger level threshold
will be considered reached by the input signal if the
value of the current sample is within a range computed
as follow:
Trigger interval = [ TrigLev, TrigLev + MaxAmplitude *
ThFact ]
Where TrigLev is defined by means of the Trigger
trackbar and graphically displayed on the oscilloscope
screen; MaxAmplitude is the Maximum amplitude of the
input signals (in internal units, i.e. if the resolution is 16
bit the maximum amplitude is 216 varying from -32768
to 32767) and ThFact is the Threshold in per Thousand
of the MaxAmplitude. Also TrigLev has to be
considered as having the same unit of MaxAmplitude.

The threshold parameter is useful because of the


different nature of the input waveform and related edge.
In general with a very steep edge will be recommended
a higher value of Threshold, conversely with a smooth
waveform edge will be recommended a lower one. In
any case it should be determined experimentally from
case to case. Leave to the default value for most
practical cases.
D/A checkbox. D/A stands for Digital to Analogue
conversion option. It is one of the most important
option of VA; in fact, there are a couple of threads
dedicated to that function.
In standard use, without the D/A option checked, the
samples are plotted on the screen simply linking them
with a line; that is, no interpolation routines are used.
This is a common way to display data in program
similar to VA. For most practical case it is the fastest
and practical way to implement a digital oscilloscope;
but, as we will see in the next lines, it is not practically
useable under certain condition. Lets do a little
preamble.
The acquired samples must be acquired under the
Nyquist theorem conditions. That is, the frequency

sampling must be at least double the maximum


harmonic component of the input signal. To avoid
problems, normally before the A/D conversion a filter
called anti-aliasing filter is used to limit the band of the
input signal according the frequency sampling. In that
way we are sure that the acquired samples are
meaningful and aliasing do not occur. In other words,
using the sampling process under the Nyquist theorem
condition, we are assured to get a digital sequence that
represent completely the original signal without any
loss.
However, this signal, stored in RAM and used by all the
instruments implemented from VA it is NOT the original
analogue signal, although mathematically equivalent; it
is composed only of a discrete sequence of samples
(that is, a sequence of values of the signal captured at
predefined time instant). Problems could arise trying to
plot the signal on the oscilloscope screen, as VA try to
plot an analogue signal by means of a numeric one. As
already said previously, the signal is plotted on the
screen simply linking two consecutives digital samples
by means of a line. When the sampling frequency is
considerably higher than the frequency of the input
signal, the result on screen is almost indistinguishable

from the analogue signal; on the contrary, when the


frequency sampling is comparable to the signal
frequency, the result is (apparently) a signal completely
different from the original. For example, if we try to plot
a sinusoidal signal at 1000 Hz sampled ad 2000 Hz,
we would get only two samples for a single sinusoidal
cycle; although sufficient to rebuild mathematically the
original analogue signal, the plotted signal obtained
with the simple line linking technique will be similar to
a triangular-trapezoidal wave form instead of a
sinusoid.
So it is necessary to rebuild the original signal applying
another time (and in reverse manner) the sampling
theorem (Nyquist). Or, in other words, implementing via
software a complete Digital to Analogue converter.
For this purpose, VA implement a signal reconstruction
applying the Nyquist theorem; enabled only when D/A
checkbox is checked. A new thread is instantiated to
compute the original analogue signal in real time.
Naturally, approximations has been made due to the
limited number of samples available during the real
time computation.

The D/A thread is resource consuming, and then to


avoid useless waste of resources, an automatic routine
determines, by checking the frequency sampling, buffer
dimension and requested time division, if the D/A
routine have to be actually enabled. In other words,
also if D/A has been checked the D/A thread will not be
actually executed if the standard displayed signal (with
raw line-link) is undistinguishable from the
reconstructed one.
DCremoval checkbox allows to insert along the flow of
the input signal a digital filter to eliminate the DC
component. It is a simple IIR high pass filter with the
cut off frequency set to 0.01 Hz.
Trig Left is an often misunderstood option that allows
to trigger the left (A) channel by means of the
parameters of the right (B) channel and its input signal.
In other words, the trigger mechanism of the right
channel acts on the waveform actually read from the
right input, and in contemporary the same computed
trigger point is applied to the left channel.
In general when the desired trigger level (and with the
desired trigger threshold) is reached the right channel

is triggered simply starting to plot the right channel from


the point which fall in the trigger interval (this is a
general mechanism, true for both channels). The
difference, using Trig Left option is that the same
trigger point is applied also to the left channel,
independently from the waveform actually measured.
Allowing a functionality similar to the external trigger
of a standard oscilloscope.

You might also like