What AuDIT is:
AuDIT is a tool designed to test the accuracy of equipment and software used in the transmission, storage and reproduction of digital audio. AuDIT detects equipment and software that change the audio data that they handle. AuDIT is useful for detecting software bugs, media errors and equipment design flaws that may otherwise go unnoticed.
Why AuDIT was written:
One of the great advantages that digital audio has over analog is that it can be losslessly duplicated and transmitted. It has been found however, that even decades after the advent of digital audio this is often not the case. AuDIT was originally written so that the author would have a method for verifying the accuracy of digital audio equipment and as an aid for determining the need for equipment maintenance. As the author began to test equipment and software, it became alarmingly apparent that this tool should be available to the professional audio community as a whole. AuDIT has been released as FREE software in the hopes that it will be useful to members of the audio community and perhaps help to improve the standards by which equipment and software are produced.
What AuDIT is not:
AuDIT does NOT detect problems with digital audio clock stability (jitter) which can affect the fidelity of audio in the analog to digital and digital to analog conversion process. AuDIT is NOT a tool that can tell you whether your CD pre-masters are bit accurate (but it CAN tell you whether the equipment and methods you use are). AuDIT does NOT tell you if your favorite A/D or D/A is accurate. AuDIT, like any piece of test equipment tells you what it tells you, and nothing else. Remember, the most valuable diagnostic tools you have are your ears and your brain.
How AuDIT is used:
In general, the user first uses AuDIT to create an audio file of the desired format and length. The audio file created by AuDIT (from now on referred to as the 'AuDITfile') is a pseudo-random sequence of samples. It is a full scale (i.e. LOUD) signal which sounds like white noise but is actually completely deterministic. Loosely put, the signals generated by AuDIT have a very specific 'signature'. Once created, the user takes the digital audio signal stored in the AuDITfile on a journey through whatever equipment and/or software she chooses to evaluate, and then returns it to a computer running AuDIT as another AuDITfile. When AuDIT tests the integrity of an AuDITfile, it checks for the correct relationships between consecutive samples and is able to determine whether or not the data has undergone any changes. AuDIT also checks that the correct relationships are maintained between the left and right channels of a stereo file.
HOW AuDIT WORKS
AuDIT uses an algorithm to generate a pseudo-random sequence of data. This data is seemingly random, however it is actually completely deterministic. Given any instantaneous value, the next value in the sequence can be predicted exactly. When analyzing a digital audio signal generated by AuDIT, it only takes a single audio sample for the AuDIT analyzer to synchronize itself to the input signal. Once synchronization is achieved, the AuDIT analyzer will internally generate its own data which should be identical to the AuDIT signal being analyzed. If there are any differences between the signal being internally generated and the signal being analyzed, AuDIT reports these as errors, and attempts to re-synchronize itself.
The pseudo-random data sequence generated by AuDIT repeats once every 65535 samples. It is inherently a 32 bit a sequence, however, AuDIT is also capable of generating 16 and 24 bit signals by truncating the least significant 8 or 16 bits from the 32 bit word.
AuDIT can generate mono or stereo signals. In the case of a stereo signal, the right channel is simply an inverted version of the left channel. This enables AuDIT to detect stereo integrity problems, for example, situations where the data on each channel is preserved, but the left and right channels are reversed, or there is a delay between the left and right channels.
A more complete understanding of how AuDIT works can be achieved by examining the source code (AuDITGenerator.cpp) or by reading on.
AuDIT generates a pseudo-random sequence of data which is a modified version of a 16 bit maximum length sequence. A maximum length sequence is a pseudo-random sequence of numbers that repeats. It is termed 'maximum length' because it steps (pseudo-randomly) through every possible (minus one) combination of ones and zeros capable of being represented by an n-bit word, before repeating. For example, in a 16-bit word, there are 65536 (2^16) different possible combinations of ones and zeroes. A 16-bit maximum length sequence is a sequence of 65535 ((2^16)-1) numbers which are pseudo-randomly ordered. The 65536th number in the sequence is the same as the 1st, i.e. the sequence repeats. The minus one represents the only disallowed value in the sequence - 16 zeros. Maximum length sequences have been used for a long time to generate pseudo-random numbers for a variety of applications.
AuDIT generates 32-bit word sequences that repeat once every 65535 samples. The high order 16 bits of the 32 bit word represent a normal 16-bit maximum length sequence. The low order 16 bits of the 32 bit word are 'trailing' bits from previous iterations.
Here's an example of how we generate the left channel of an AuDIT signal:
The signal generated by AuDIT begins with a 32-bit seed value. For clarity, we will call the left most bit (aka most significant bit or MSB) in the 32-bit word 'bit 31', and we will call the right most bit (aka least significant bit or LSB) 'bit 0'.
Step 1)
First we XOR bit 28 with bit 19 and XOR bit 17 with bit 16. The results of these two operations are then XORed with each other and the resulting bit is stored. XOR (exclusive-OR) is a specific logical operation which takes two binary input values and produces one binary output value. Here's the truth table:
IN1 IN2 OUT ----------- 0 0 0 0 1 1 1 0 1 1 1 0
The logical operation is called 'exclusive-OR' because the output is a 1 if one input OR the other is a 1, but NOT if BOTH of the inputs are 1s.
Step 2)
Next we shift the seed value one bit to the right discarding the LSB (bit 0), and load the MSB (bit 31) with the bit stored in the previous step. The resulting 32 bit word is the output of the algorithm and also becomes the seed value for the next iteration.
If we repeat this 65535 times, we will arrive back at the original seed value. Incredibly enough, all this bit manipulation results in a white noise signal.
If we are analyzing a digital audio signal which was originally generated by AuDIT, we use the first incoming value as a seed, and then generate successive values which will be identical to the incoming signal (if the signal being analyzed has not undergone any changes). Changes in the signal are detected by comparing the internally generated signal to the signal being analyzed.
If we are generating a right channel signal, we invert the seed value before step 1, and then invert the result after step 2.
When AuDIT analyzes a stereo digital signal, it verifies the left channel data, the right channel data and the correlation between the two.
USING AuDIT
File formats:
AuDIT currently creates and analyzes 16, 24 and 32 bit PCM files of the following formats:
Apple/SGI AIFF (.aif)
Microsoft WAVE (.wav)
NeXT/SUN (.au)
Ensoniq PARIS (.paf)
Raw audio data (big-endian byte ordering)
Raw audio data (little-endian byte ordering)
Users may create and analyze stereo or mono files. Mono files can be either a left channel signal or a right channel signal.
Analyzing AuDITfiles:
Stereo AuDITfiles that are not raw audio data can be analyzed without additional user input. When analyzing mono files however, the user must specify whether she is analyzing a left channel or a right channel AuDITfile. The number of channels, byte ordering and PCM wordlength must be specified when analyzing raw audio data. The user may also instruct AuDIT to ignore any digital silence at the beginning of an AuDITfile, which can be useful under some circumstances. The length of the AuDITfile being analyzed is not important nor is the starting point. AuDIT is simply looking for a continuous stream of audio data which bears the correct 'fingerprint'.
Usage:
(This section describes the command line interface and does not apply to MacAuDIT)
audit -c|t [OPTIONS] [FILE]
-p prompt for parameters
-c create AuDIT file
-t test AuDIT file
-A AIFF generation
-w .wav file generation
-a .au file generation
-P PARIS file generation
-R Raw big endian file generation/analysis
-r Raw little endian file generation/analysis
-s SAMPLERATE Specifies samplerate at which to create AuDIT file
-b PCMBITWIDTH Specifies number of bits per sample
-l LENGTH Specifies length of AuDIT file in seconds
-z skip leading silence during analysis
-n mono file generation
-g mono file is right channel (left is default)
-o overwrite existing file
-h displays this help page
-L displays licensing information
UNDERSTANDING AuDIT RESULTS
In order to understand the results of an AuDIT test, it is important to understand how actually AuDIT works. Before continuing, make sure that you have read the section titled HOW AuDIT WORKS.
AuDIT checks for the proper relationship between samples. Left channel and right channel errors are detected by checking for the proper relationship between consecutive samples of the same channel. Because AuDIT needs a starting point from which to check these relationships, the first sample in an AuDITfile is always assumed to be correct.
Stereo correlation errors are detected by checking for the correct relationship between left channel and right channel samples. For example, reported stereo correlation errors could be the result of a delay between the left and the right channel or corruption of either the left or the right channel.
Errors often tend to come in bursts (especially when related to media errors e.g. scratched CDs), so AuDIT also keeps track of statistics relating to error bursts.
When AuDIT analyzes an AuDITfile, it periodically displays its progress by printing '.' or '!'. A '.' represents a portion of the AuDITfile being analyzed in which no errors were detected. A '!' represents a portion of the AuDITfile being analyzed in which one or more errors were detected.
Digital black (silence) which is represented by sample values of 0 is considered a disallowed state in sequence of values generated by AuDIT, and is therefore reported as an error. The user has the option of ignoring any digital silence at the beginning of an AuDITfile, which can be useful in certain circumstances. For example, extracting audio from a redbook audio CD usually results in up to one frame (1/75th of a second) of digital silence at the beginning of the extracted audio file.
Here are descriptions of the statistics reported in the results of an AuDIT test:
Total Skips:
A skip is reported when there is a skip in the sequence of incoming samples. For example, say for the sake of illustration that the AuDIT sequence consists of all of the letters in the alphabet e.g.
ABCDEFGHIJK...
If the incoming data being analyzed was
ABCDGHIJKLM...
AuDIT would report a skip (There are missing samples between D and G).
Total Errors:
AuDIT reports errors when there are samples in the data being analyzed that are not of the correct value in the sequence e.g.
ABCDEFXYZJK...
(The samples XYZ are not the correct values).
Total Error Bursts, Min Burst Length, Max Burst Length, Ave Burst Length:
Because often times errors come in runs or bursts, AuDIT reports the total number of error bursts in the AuDITfile being analyzed. It also reports the minimum, maximum and average burst length.
An example:
Filename: Hard Drive:Desktop Folder:tst.out Samplerate: 44100 Length: 441000 samples (10 seconds) Channels: 2 Number of bits per sample: 24 File format: Apple/SGI AIFF Processing !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Left Right Stereo Channel Channel Correlation Total Skips: 55010 54913 Total Errors: 110606 110688 440999 Total Error Bursts: 55191 55253 1 Min Burst Length: 1 1 440999 Max Burst Length: 13 15 440999 Ave Burst Length: 2 2 440999
The file analyzed here was created by using a popular 2-track editor to open and re-save a 10 second 24 bit stereo AIFF AuDITfile. The editor was obviously changing the data in the AuDITfile quite a bit. Using my ears and some music, I performed the same test. I was not able to discern any noticeable difference between the original music and the re-saved music. I was sure that any changes in the audio data that this program was applying were small. The results tell us a few things:
1) The left and right channel are never perfect inverted versions of each other. It is possible that there is a delay between the left and right channel, or that at each position in time either the left or right channel has been changed.
2) There are many short error bursts (average 2 samples). This suggests to me that we are seeing the results of mathematical round-off or unnecessary dithering.
3) There are many skips, but the length of the file has not changed. This also suggests that we are seeing the results of round-off or unnecessary dithering.
CONCLUSION
AuDIT determines whether digital audio equipment and software change the audio data that they handle. AuDIT does not always provide a clear indication as to why changes occur, but it can be useful in go/no-go testing. It can help users to determine which software and equipment may be best suited to their application. It can also help audio professionals evaluate the condition and quality of their equipment, software and media. Because AuDIT is free software with readily available source code, developers can apply the ideas and techniques employed to their own specific situations.
LICENSE
AuDIT - Audio Data Integrity Test
Copyright (C) 2000 Shea Ako
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
BUGS
Send all bug reports to bugs@hyperspasm.com
CREDITS
AuDIT uses libsndfile (C) Erik de Castro Lopo which is covered under the GNU Lesser GPL.
libsndfile can be obtained from http://www.zipworld.com.au/~erikd/libsndfile/ .