Commandline audio analysis utility? |
![]() ![]() |
Commandline audio analysis utility? |
Nov 4 2012, 18:37
Post
#1
|
|
![]() Group: Members Posts: 89 Joined: 3-November 04 Member No.: 17971 |
Can anyone suggest a utility that takes an audio file as input, and can output to a text/CSV file various data (RMS, peaks, dominant frequencies, etc.) per each N ms of the input, for both time and frequency domains?
Windows is my main target, but *nix as well. It seems SoX has a few features in this direction, but not flexible enough (e.g., data per N ms, frequency domain resolution). |
|
|
|
Nov 5 2012, 01:47
Post
#2
|
|
|
Group: Members Posts: 42 Joined: 27-November 11 Member No.: 95439 |
It seems SoX has a few features in this direction, but not flexible enough (e.g., data per N ms, frequency domain resolution). For the time-domain values, you could use something like this: CODE sox input.wav -n trim 0 0.012 stats : restart (change 0.012 s = 12 ms into the desired block length). You are right, however, regarding the frequency domain; there is not much support for that.
|
|
|
|
Nov 5 2012, 20:03
Post
#3
|
|
![]() Group: Members Posts: 89 Joined: 3-November 04 Member No.: 17971 |
It won't be efficient, executing it thousands of times.
|
|
|
|
Nov 5 2012, 21:11
Post
#4
|
|
|
Group: Members Posts: 4131 Joined: 2-September 02 Member No.: 3264 |
|
|
|
|
Nov 5 2012, 21:25
Post
#5
|
|
|
Group: Members Posts: 2114 Joined: 24-August 07 From: Silicon Valley Member No.: 46454 |
If you don't want to write an application yourself, Your best bet is probably MATLAB or a MATLAB Clone.
Of course, you'd need to understand the math required for what you want to accomplish. I've never used any of these programs, but I believe FFT is "built-in" (and simpler things like average & RMS algirithms) so you shouldn't have to develop all of the math from scratch. This post has been edited by DVDdoug: Nov 5 2012, 21:27 |
|
|
|
Nov 5 2012, 22:30
Post
#6
|
|
![]() Group: Members (Donating) Posts: 761 Joined: 12-March 05 From: Kiel, Germany Member No.: 20561 |
As a free alternative to MATLAB I'd suggest to try Python + Numpy/Scipy. I've never used it myself, but there is also a scikit for audio processing around.
-------------------- Audiophiles live in constant fear of jitter.
|
|
|
|
Nov 5 2012, 22:38
Post
#7
|
|
|
Group: Members Posts: 42 Joined: 27-November 11 Member No.: 95439 |
It won't be efficient, executing it thousands of times. CODE $ soxi data.wav Input File : 'data.wav' Channels : 2 Sample Rate : 44100 Precision : 16-bit Duration : 01:12:00.91 = 190551984 samples = 324068 CDDA sectors File Size : 762M Bit Rate : 1.41M Sample Encoding: 16-bit Signed Integer PCM $ time (sox data.wav -n trim 0 0.055 stats : restart 2>&1 | wc) 1256737 5733870 45242573 real 0m23.383s user 0m20.849s sys 0m5.960s $ So that’s less than half a minute for 78562 blocks. For a block length of 0.009 seconds (480101 blocks), it takes four minutes. The processor is a 1 GHz AMD 4850e, nothing extreme. |
|
|
|
Nov 5 2012, 22:49
Post
#8
|
|
|
Group: Members Posts: 25 Joined: 26-September 12 Member No.: 103446 |
If you don't want to write an application yourself, Your best bet is probably MATLAB or a MATLAB Clone. +1. i've never used Matlab for audio but it should come with all necessary functionality. it can read WAV files, write CSV files, and has the most essential libraries such as FFTW built-in. |
|
|
|
Nov 6 2012, 04:32
Post
#9
|
|
![]() Group: Members Posts: 89 Joined: 3-November 04 Member No.: 17971 |
Thanks for the suggestions.
So that’s less than half a minute for 78562 blocks. For a block length of 0.009 seconds (480101 blocks), it takes four minutes. The processor is a 1 GHz AMD 4850e, nothing extreme. Is that a realistic concern given how trivial the processing you are doing is? Interesting. I'm wonder if execution overhead is that trivial on a webhost, or at least, in terms of what they'd consider valid use. But then again, there's also the missing features with SoX. Your best bet is probably MATLAB or a MATLAB Clone Although I'd rather use something existing made for the specific job, rather than semi-program, I'll check this direction too.As a free alternative to MATLAB I'd suggest to try Python + Numpy/Scipy. I've never used it myself, but there is also a scikit for audio processing around. Sounds like this might need some customization, but I'll check it out. I wonder how well Python performs, but there are also potential advantages to Python for running on a shared webhost.
This post has been edited by sheh: Nov 6 2012, 04:49 |
|
|
|
Nov 6 2012, 13:00
Post
#10
|
|
![]() Group: Members Posts: 607 Joined: 16-January 09 Member No.: 65630 |
As a free alternative to MATLAB I'd suggest to try Python + Numpy/Scipy. I've never used it myself, but there is also a scikit for audio processing around. Sounds like this might need some customization, but I'll check it out. I wonder how well Python performs, but there are also potential advantages to Python for running on a shared webhost.In case you aren't aware, and for reference, NumPy/SciPy provide C level BLAS/LAPACK routines in Python interface, all around Numpy's multidimension (nd)array object. Many packages depend on it. Further performance boost on matrix manipulation, linear algebra and some other things, can be applied by compiling/installing (depending on platform) with Intel MKL or ATLAS libraries (roughly x30 boost, but that also is different from case to case) Then take performance test with other suggested/possible solutions For reading PCM WAV files, SciPy can do it. Audiolab scikit, provides additional formats through sndfile library, and was made as SciPy extension (like many others scikits) -------------------- Scripts (mainly foobar2000 related): http://goo.gl/yje3h
|
|
|
|
Nov 6 2012, 14:23
Post
#11
|
|
|
Group: Members Posts: 139 Joined: 14-February 12 Member No.: 97162 |
|
|
|
|
Nov 6 2012, 14:59
Post
#12
|
|
![]() Group: Members Posts: 879 Joined: 18-June 06 From: Singapore Member No.: 31980 |
Another alternative might be Praat, that has basic scripting capabilities and allows to easily extract low to mid level audio features.
-------------------- http://freemusi.cc/
|
|
|
|
Nov 7 2012, 16:55
Post
#13
|
|
![]() Group: Members Posts: 89 Joined: 3-November 04 Member No.: 17971 |
No, I'm not aware of the specifics of SciPy/NumPy. Sounds like the plot thickens, at least with shared webhosting.
I also wasn't aware initially of SoX's restart command. Praat is intriguing. I wonder why they seem very intent on not showing any screenshots in their site. |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 20th May 2013 - 09:04 |