IPB

Welcome Guest ( Log In | Register )

> Upload forum rules

- No over 30 sec clips of copyrighted music. Cite properly and never more than necessary for the discussion.


- No copyrighted software without permission.


- Click here for complete Hydrogenaudio Terms of Service

 
Reply to this topicStart new topic
Command line utilities for generating test signals, processing, and an
stv014
post Mar 25 2013, 19:14
Post #1





Group: Members
Posts: 47
Joined: 26-February 13
Member No.: 106902



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'.
Attached File(s)
Attached File  dsputils.7z ( 562.7K ) Number of downloads: 112
 
Go to the top of the page
+Quote Post
stv014
post Mar 29 2013, 20:02
Post #2





Group: Members
Posts: 47
Joined: 26-February 13
Member No.: 106902



Updated version: a new impedance utility has been added for impedance measurements, and some bugs have been fixed.
Attached File(s)
Attached File  dsputils.7z ( 570.32K ) Number of downloads: 129
 
Go to the top of the page
+Quote Post
julf
post Mar 30 2013, 14:22
Post #3





Group: Members
Posts: 175
Joined: 14-January 12
Member No.: 96426



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.
Go to the top of the page
+Quote Post
db1989
post Mar 30 2013, 14:51
Post #4





Group: Super Moderator
Posts: 5157
Joined: 23-June 06
Member No.: 32180



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. tongue.gif 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.
Go to the top of the page
+Quote Post
julf
post Mar 31 2013, 11:36
Post #5





Group: Members
Posts: 175
Joined: 14-January 12
Member No.: 96426



QUOTE (db1989 @ Mar 30 2013, 14:51) *
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. tongue.gif 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.
Go to the top of the page
+Quote Post
lvqcl
post Mar 31 2013, 11:44
Post #6





Group: Developer
Posts: 3212
Joined: 2-December 07
Member No.: 49183



QUOTE (julf @ Mar 31 2013, 14:36) *
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.
Go to the top of the page
+Quote Post
julf
post Mar 31 2013, 11:50
Post #7





Group: Members
Posts: 175
Joined: 14-January 12
Member No.: 96426



QUOTE (lvqcl @ Mar 31 2013, 11:44) *
QUOTE (julf @ Mar 31 2013, 14:36) *
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.
Go to the top of the page
+Quote Post
julf
post Mar 31 2013, 11:54
Post #8





Group: Members
Posts: 175
Joined: 14-January 12
Member No.: 96426



QUOTE (julf @ Mar 31 2013, 11:50) *
the package does compile OK on linux.


Just wanted to confirm that the package not only compiles, but runs very nicely on linux.
Go to the top of the page
+Quote Post
stv014
post Mar 31 2013, 20:07
Post #9





Group: Members
Posts: 47
Joined: 26-February 13
Member No.: 106902



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
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:

This post has been edited by stv014: Mar 31 2013, 20:08
Attached File(s)
Attached File  dsputils.7z ( 571.7K ) Number of downloads: 104
 
Go to the top of the page
+Quote Post
stv014
post May 3 2013, 18:05
Post #10





Group: Members
Posts: 47
Joined: 26-February 13
Member No.: 106902



Some additional information can be found at another forum here and here. I guess I should add more documentation to the package.
Go to the top of the page
+Quote Post
stv014
post Oct 23 2013, 11:32
Post #11





Group: Members
Posts: 47
Joined: 26-February 13
Member No.: 106902



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
#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.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th April 2014 - 02:55