         TESTVSA: Voice Stress Analysis Device Tester.

A VSA lie detector must filter the 8 to 12 Hz frequencies from all the
others, and calculate the average frequency within that range. That
represents the stress level.

TestVSA.exe is a program which creates audio .wav files with simple
tones in them. HZ8.WAV will contain an 8 Hz sine wave, and HZ8_5.WAV
will contain an 8.5 Hz wave. The frequencies contained in an hz file
can be measured by loading it into a sound player and counting the
peaks of the wave that appears on the screen, and dividing by two
since they are each two seconds long.

VSA devices make no distinction between a big sound and a small one:
they are only concerned with the average frequency present. This creates
a problem testing the device, because in the absence of a signal within
the VSA range, frequency leakage from outside that range will produce a
reading that is heavily slanted toward whichever side the leakage is on.

Frequency leakage is unavoidable in any filter: hardware or software.
To correct for it, each hz file created by testVSA.exe has a 10 Hz
wave at 1/16 of the amplitude (volume) of the main wave; It's too small
to be easily seen in an hz file, and doesn't interfere with counting the
peaks of the major wave, but provides a small signal within the VSA
range to overpower the leakage. It weakly pulls the average towards 10
Hz. TVSA3 will produce a reading which is the average of the masking
wave and the portion of the main wave within or leaking into the VSA
range, so an 8.5 Hz main wave does not produce exactly a 8.5 Hz reading,
and the 8 and 12 Hz waves suffer a loss of amplitude from the real cutoff
frequencies being set to 8.5 and 11.5 Hz. 

With this in mind, these are the average frequency readings output by
TVSA3 (contained in tvsa-log.txt) to a set of 4 to 16 hz files created
by testvsa.exe:

Hz4    = 10.0 Hz
Hz4_5  = 10.0 Hz
Hz5    = 10.0 Hz
Hz5_5  = 10.0 Hz
Hz6    = 10.0 Hz
Hz6_5  =  9.9 Hz -
Hz7    =  9.3 Hz ----
Hz7_5  =  8.3 Hz -------
----------------------------
Hz8    =  8.4 Hz           |
Hz8_5  =  8.7 Hz           |
Hz9    =  9.0 Hz
Hz9_5  =  9.5 Hz          VSA
Hz10   = 10.0 Hz
Hz10_5 = 10.5 Hz         Range
Hz11   = 10.9 Hz
Hz11_5 = 11.3 Hz           |
Hz12   = 11.6 Hz           |
----------------------------
Hz12_5 = 11.7 Hz -------
Hz13   = 10.7 Hz ----
Hz13_5 = 10.1 Hz -
Hz14   = 10.0 Hz
Hz14_5 = 10.0 Hz
Hz15   = 10.0 Hz
Hz15_5 = 10.0 Hz
Hz16   = 10.0 Hz

These numbers are not perfect because of frequency leakage, averaging,
and cut-off effects, but are nonetheless close to optimal. They show
more than a 16 to 1 reduction in signal from 1 Hz outside the cutoff
range: Notice that the 13 Hz wave produces a reading of 10.7, which is
closer to 10 Hz than 12. That means the 1/16 amplitude 10 Hz wave is
exerting more pull on the reading average than the major wave at 13 Hz.
That would be an expensive filter in electronic hardware terms, and in
software the cost is processing time. All hz files outside the range
shown here will read 10.0 Hz. Normally, in voice recordings, a 10 Hz
masking frequency is absent, and instead the entire VSA range is full
of signal. That makes the small amount of frequency leakage that exists
irrelevent. If you're into electronics, you'll recognize the exteme
sharpness of the filtering shown here.

To create a set of hz files, run testvsa.exe with the following command
line. Bear in mind that StartFrequency must be less than or equal to the
EndFrequency, and that both values must be in the range of 1 to 5500.

  testvsa OutputPath StartFrequency EndFrequency

To create the set example above, use this:

  testvsa c:\somedir 4 16

Then, to test them, use this:

  tvsa3 c:\somedir\hz*.wav c:\otherdir 80

Each Hz uses 88k of disk space in two files, one being a trans-Hz (.5)
file. The 25 files (12 Hz range) represented in the example take up
1.1 Megs.

