Skip to main content

Topic: Command line utilities for generating test signals, processing, and an (Read 6822 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • stv014
  • [*]
Command line utilities for generating test signals, processing, and an
The attached package is a collection of simple command line utilities. These can be freely used for any purpose, and the source code is also included (although it is not very well commented). However, they are not really user friendly, and for some of the analysis utilities, it is important to understand how they work to be able to use them with reliable results. The programs included are:

Signal generator:

testgen - generates various test tones (sine sweeps, colored noise, maximum length sequences, jitter test, and some simple waveforms) using a text file as input, which describes the set of signals to be generated and their parameters. It can only write stereo WAV format files with 8, 16, 24, or 32 bit PCM samples.

Processing:

convolve - convolves an audio file with another one. Both the input and the impulse response files can have multiple channels, which may also be different in the two files (the allowed combinations are 1*N, N*1, N*N, and N*N^2 channels - in the last case, the impulse response contains a full channel matrix). There are a number of built-in filters, including lowpass, highpass, bandpass, band-reject, and "comb" versions of the latter two, as well as maximum length sequences. Furthermore, the impulse response can be processed by making it inverse, minimum phase, or linear phase.

resample - yet another sample rate converter. It can resample by any fractional ratio, and has options for setting the delay (which can be a fractional number of samples) and gain, as well as several parameters for controlling the quality and filtering. It is capable of fairly good accuracy, and - with "simple" resample ratios - is reasonably fast as well.

Analysis:

sinetest - measures the frequency, amplitude, and phase of a sine wave using a large FFT with a Gaussian window. It can be used with the resample utility to correct the pitch, level, and delay of a loopback recording, which includes test tone(s) for this purpose

fft - creates an FFT (magnitude vs. frequency) plot from one or more audio input files, and writes it as a BMP format image file. It has several options, and supports large FFT sizes. It can also be used to visualize the output of some other utilities.

csd - creates a 3D spectrogram (in BMP format) from a single audio input file. It is mostly useful for visualizing the impulse response of a headphone or speaker

noise - measures and prints signal and noise levels in a test tone using a large windowed FFT. It supports multiple signal frequencies (e.g. for IMD+noise tests), A and R 468 weighting, and - with the signal level at 0 dBFS specified - absolute levels in Vrms and dBu.

groupdel - analyzes the phase response, phase delay, or group delay of an impulse response input. The output can be visualized with 'fft'.

thd_test - using a long sine sweep (exponentially increasing frequency or amplitude), it analyzes frequency response, THD vs.frequency, linearity (level error vs. input level), and THD vs. level. The output can be visualized with 'fft'.

  • stv014
  • [*]
Command line utilities for generating test signals, processing, and an
Reply #1
Updated version: a new impedance utility has been added for impedance measurements, and some bugs have been fixed.

  • julf
  • [*][*][*][*]
Command line utilities for generating test signals, processing, and an
Reply #2
Thanks for posting the package, but...

It would be nice if people posting software would state what OS/environment their software is written for, so that we don't download them unnecessarily just to find out they are not portable to our environments.

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
Command line utilities for generating test signals, processing, and an
Reply #3
I agree. Still, if the archives were in a more universal format, it would only take 2–3 seconds to open them and find out.  But since I already have 7-Zip, that’s easier for me than it might be for many other users. So, I can answer that the binaries are in exe format for Windows.

  • julf
  • [*][*][*][*]
Command line utilities for generating test signals, processing, and an
Reply #4
I agree. Still, if the archives were in a more universal format, it would only take 2–3 seconds to open them and find out.  But since I already have 7-Zip, that’s easier for me than it might be for many other users. So, I can answer that the binaries are in exe format for Windows.


Thanks! Yes, I had to actually install 7-zip to be able to find out that not only are the binaries Windows exe files, but that the source relies on some .dll libraries for which there is no source included, so porting is not feasible.

  • lvqcl
  • [*][*][*][*][*]
  • Developer
Command line utilities for generating test signals, processing, and an
Reply #5
but that the source relies on some .dll libraries for which there is no source included, so porting is not feasible.

What libraries? I can see only libsndfile dependency.

  • julf
  • [*][*][*][*]
Command line utilities for generating test signals, processing, and an
Reply #6
but that the source relies on some .dll libraries for which there is no source included, so porting is not feasible.

What libraries? I can see only libsndfile dependency.


I stand corrected. I was assuming the libsndfile used in this package was a non-standard one as a .dll was provided. You are right - seems the only dependency was the standard libsndfile library, and the package does compile OK on linux.

  • julf
  • [*][*][*][*]
Command line utilities for generating test signals, processing, and an
Reply #7
the package does compile OK on linux.


Just wanted to confirm that the package not only compiles, but runs very nicely on linux.

  • stv014
  • [*]
Command line utilities for generating test signals, processing, and an
Reply #8
The source code is intended to be portable to any 32 or 64 bit system that is supported by libsndfile (I actually use Linux/x86_64). There are no other dependencies. It was only tested with GCC, although no GCC specific feature is intentionally used in the code, except for one optimization that is enabled only if the USE_SIMD macro is defined. The programs can be compiled with "make", but also individually with a single g++ command like
Code: [Select]
g++ -Wall -O2 -ffast-math -DUSE_SIMD=1 -DUSE_OOURA_FFT=1 convolve.cpp -o convolve -lsndfile -lm -s


By the way, there is a minor update that fixes a few bugs:
  • Last Edit: 31 March, 2013, 03:08:01 PM by stv014

  • stv014
  • [*]
Command line utilities for generating test signals, processing, and an
Reply #9
Some additional information can be found at another forum here and here. I guess I should add more documentation to the package.

  • stv014
  • [*]
Command line utilities for generating test signals, processing, and an
Reply #10
With the latest version of MinGW, a minor change seems to be needed to fix a compile error. In headers.hpp, add the following line:
Code: [Select]
#define _GLIBCXX_USE_C99  1

at the beginning of the file near the other similar #define line that is already there.

The "unknown conversion type character" warning can be ignored, it does not actually cause problems in any of the programs.