Super-Alias Virtual Digital: simulation of quantization, vari-speed, sampling, aperture, jitter, and brick-wall band-pass filtering for WAV file
Copyright (c) 2008-2012 by Klaus Michael Indlekofer. All rights reserved.
Note: Special restrictions apply. See disclaimers below and within the distribution.

Release superaliasvd-1.3 (12-JAN-2012)

Email: m.indlekofer@gmx.de



Usage: (if command line version)
------

superaliasvd <wav-in> <wav-out> <fs-sim> [<aperture> <bitnr> [<fc-lo-in> <fc-hi-in> <fc-lo-out> <fc-hi-out> [<vari-speed-t> <vari-speed-f> <vari-speed-sh> <jitteramp>]]]

	<wav-in>	input WAV file (8/16/24bit, any number of channels, any sampling rate)
	<wav-out>	output WAV file (same sampling rate as input)
	<fs-sim>	simulated sampling rate in Hz (indepedent of samprate)
	<aperture>	aperture ratio (0 ... 1, default=0)
	<bitnr>		uniform quantization in bit (1 ... 24)
	<fc-lo-in>	input filter: lower cutoff frequency in Hz
	<fc-hi-in>	input filter: upper cutoff frequency in Hz
	<fc-lo-out>	output filter: lower cutoff frequency in Hz
	<fc-hi-out>	output filter: upper cutoff frequency in Hz
	<vari-speed-t>	vari-speed factor for time-domain algorithm (default=1)
	<vari-speed-f>	vari-speed factor for frequency-domain algorithm (default=1)
	<vari-speed-sh>	"hold-last-sample" vari-speed interpolation
	<jitteramp>	jitter amplitude in fs-sim sample periods (0 ... 0.5, default=0)
	<samprate>	processing and output sampling rate in Hz (default = wav-in sampling rate)



Batch file commands: (if GUI version)
--------------------

	inpwavname   PATH		sets <wav-in>
	outwavname   PATH		sets <wav-out>
	fssrc   UINT			sets <samprate>
	ensrc   BOOL			enables/disables fssrc
	fssim   FFLOAT			sets <fs-sim>
	bitnr   UINT			sets <bitnr>
	aperture   FLOAT		sets <aperture>
	fcloin   FFLOAT			sets <fc-lo-in>
	fchiin   FFLOAT			sets <fc-hi-in>
	fcloout   FFLOAT		sets <fc-lo-out>
	fchiout   FFLOAT		sets <fc-hi-out>
	varispeedt   FFLOAT		sets <vari-speed-t>
	varispeedf   FFLOAT		sets <vari-speed-f>
	varispeedsh   BOOL		enables/disables hold
	jitteramp   FLOAT		sets <jitteramp>
	process				starts processing
	stop				stops batch

with argument data types:
	UINT:		unsigned integer number
	FLOAT:		floating point number
	FFLOAT:		floating point number or "STi" (with signed integer i for semitone steps)
	BOOL:		boolean ("TRUE" or "FALSE")
	PATH:		path/name string (can contain spaces, terminated by end of line)



Notes:
------

This program intends to create typical artefacts that can be found in "old-school" digital audio equipment
of the 1970s-1980s, in particular early samplers and wavetable synthesizers with low bit resolution,
low (and perhaps variable) sampling rates, and non-perfect filters.
In detail, the digital artefacts that we consider are:
* Quantization distortion and/or noise due to quantization (i.e. value-discrete signal).
  This becomes audible with low bit resolution (typically below 8bit or 12bit).
  Sound impression: distorted, rough, noisy.
* Frequency images at the DAC output due to sampling (i.e. time-discrete signal),
  which are supposed to be removed completely by a brick-wall low-pass (interpolation filter) following the DAC.
  If low sampling rates and non-perfect post-DAC filters are used, images (or some parts) may become audible.
  Sound impression: dirty high frequencies, crispy, bright.
* Aliasing within the audio band due to violation of the Nyquist sampling criterion.
  If a non-perfect anti-aliasing filter is used at the ADC input, or if an inadequate
  pitch-change interpolation algorithm is used, aliasing is introduced irreversibly.
  Sound impression: non-harmonic tones, dirty frequencies.

It is a challenge to simulate these (non-LTI) artefacts on digital audio workstations,
which typically use a fixed sampling rate (wordclock).
Frequency images due to sampling with a lower sample clock which is not a simple fraction of the
system's sample clock (wordclock) cannot be generated by simple means.

"superaliasvd" simulates such artefacts. In this sense, we call the idea "virtual digital".
In particular, the following components are incorporated:
* sample rate conversion
* vari-speed, interpolation algorithm in time- and/or frequency-domain
  (Note: this is the typical ingredient to change pitch in normal samplers, might create aliasing)
* sampling (fs-sim=0 ... fS), creates frequency images and possibly aliasing
  (Note: this is mandatory to simulate samplers with pitch-change via variable sample clock).
* uniform quantization (bitnr=1bit ... 24bit)
* aperture effect of DAC
  (Note: determines pulse width, Zero-order hold would be aperture=1)
* jitter in fs-sim, white and uniformly distributed
  (Note: Excessive jitter in fs-sim is typical for sampling clocks that are generated by use of BRMs.)
* brick-wall band-pass filtering, at input and output, with user-defined cutoff frequencies
  (Note: this is useful at the input if one wants to avoid aliasing if fs-sim<fs or vari-speed>1)
The internal resolution of "superaliasvd" is 64bit floating point.
Further LTI-filtering (e.g. a "virtual analog" stage) can be added externally by other programs.

Apart from the simulation (emulation) of the sound of "old-school" equipment,
this program is also useful for the demonstration of quantization, sampling, and aliasing.
As an example, to simulate the sound of an old sample player,
one could generate a set of multi-samples of varying pitch via vari-speed by use of "superaliasvd",
corresponding to the musical notes on a keyboard.
A modern sample player, in turn, could playback these samples, mapped to individual MIDI keys.
As for the employed simulated sampling rate (fs-sim), one could choose a fixed value,
corresponding to a typical "phase-acumulator" sample player.
If a "variable-samplerate" player shall be simulated, the simulated sampling rate (fs-sim) should
be changed proportional to pitch.
The typical "old-school" sound could be achieved with bitnr=8 or 12, fs-sim below 30kHz,
and optionally some amount of jitter.
For the WAV files, the best would be to work with a high sampling rate (e.g. 96kHz or 192kHz) and 24bit resolution.
Note that audio material which was perceptually coded (lossy) might not be suitable for vari-speed
due to the resulting frequency scaling, which renders the initally employed masking calculations inadequate
for the modified material.

Please note that in the current release, some algorithms are still not exact
(from a mathematical point of view). On the other hand, some are not optimized yet.
In particular, concerning the combination of quantization, vari-speed, and sampling,
working in time- and/or frequency-domain.
Improvements are possible, depending on the employed models and the computational resources that are available...



---
The following holds for all files in this distribution (unless stated otherwise on an
individual basis for each file and statement):

These program/data/document/HTML/picture/media files (materials) are distributed in the
hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. In no event shall the author be
liable for any direct, indirect, incidental, special, exemplary, or consequential damages
(including, but not limited to, procurement of substitue goods or services; loss of use,
data, or profits; or business interruption) however caused and on any theory of liability,
whether in contract, strict liability, or tort (including negligence or otherwise) arising
in any way out of the use of data/information/software from this distribution, even if
advised of the possibility of such damage. 

The contents of this distribution are intended for educational, non-commercial purposes
only. Materials contained herein are property of their respective owners. If any
copyrighted works/trademarks have been used, please contact the author K. M. Indlekofer
and the item will be either removed or properly credited (at the copyright/trademark
owner's discretion). We have no intention of violating any copyrights or trademarks.
This distribution might use inlining and deep-linking, i.e. links in this distribution
might lead directly to materials on other web sites/distributions (in which case the
target page normally should be listed/credited in a "links" section). The author does
not take responsibility for the contents of any links referred to. We do not necessarily 
endorse, sanction, support, encourage, verify or agree with the contents, opinions or
statements of/on any of the linked pages. These statements hold for all links/references
in all files in this distribution. We are in no way affiliated with any
companies/institutions/individuals which might be mentioned in any manner in this
distribution.

The author does not take responsibility for incorrect, incomplete or misleading information.
Statements are to be considered as the author's free personal opinion. The author does not
necessarly possess any of the items mentioned in files in this distribution.

Files (and the information therein) created by the author K. M. Indlekofer are copyright
(c) by K. M. Indlekofer. Unless protected/restricted otherwise, the author permits
reproduction/redistribution of material contained in this distribution under the condition
that the item is properly credited. Links to items/materials in this distribution are welcome.
Projects/publications/papers that make use of materials, programs, or generated output
of this distribution must properly credit the author and mention the usage of this distribution.
Please contact the author K. M. Indlekofer for comments or further questions
and permission to use materials/information from this distribution.

Some programs/data files are released under the terms of the GNU General Public License
as published by the Free Software Foundation. (Address: Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Internet: GNU General Public
License (GPL) from The GNU Project) 



---
End of file
