Telecommunications & Signal Processing Laboratory

AFsp Programs and Routines

The AFsp package provides audio file utility programs and a library of routines for reading and writing audio files.

Audio File Utilities:

Compare audio files, producing statistics and signal-to-noise ratio figures.
Copy audio files. This program combines samples from input audio files (an arbitrary linear combination) and writes them to the output file in a user selectable data format. One application is to provide format conversion for an audio file; another is to combine or select samples from multi-channel files.
Filter audio files. This program filters an audio file with an FIR, IIR or all-pole filter. This program can be used with an appropriate filter for sample rate conversion. The AFsp package includes a number of filters from the ITU-T Software Tool Library (G.191) in a form that can be used directly with the FiltAudio program.
Generate noise. This program generates an audio file containing Gaussian white noise.
Generate a sinusoid. This program generates an audio file containing a sine wave of a given amplitude and frequency.
Display information about an audio file (data format, header/data layout, and information strings).
Resample data from an audio file. This process involves interpolating between the samples in the original file to create a new sequence of samples with a new spacing (sampling rate).

Audio File Library Routines:

The audio file open routine automatically senses the input file type. The data format for the file is passed to the audio file reading routines. The audio file reading routine does byte swapping and format conversion on the fly as the file is read. The user sees floating-point data without needing to worry about the underlying data format.

Once a file is opened for writing, the user calls routines which take the user's float/double data and do format conversion and byte swapping of the data.

The library routines supplied in the AFsp package form part of the libtsp signal processing library. These routines are written in C.

Close an audio file
Read data from an audio file (return double values)
Write data to an audio file (double input values)
Open an audio file for reading
Open an audio file for writing
Print the header/data (chunk) structure for an audio file
Print all information records for an audio file
Set the input audio file type
Add an audio file information record
Set defaults for input audio files from a string specification
Set loudspeaker spatial positions

Audio File Formats:

The following file formats are supported for reading.

The following file formats are supported for writing.

Audio File Data Types:

The following (uncompressed) data types are supported.