l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
November 4: Social gathering
Next Installfest:
TBD
Latest News:
Oct. 24: LUGOD election season has begun!
Page last updated:
2008 Mar 11 10:10

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] Marking Audio file based on Freq.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] Marking Audio file based on Freq.



Alex Mandel wrote:
> Fun challenge if anyone is up for it.
> 
> How do I locate all instances of a particular frequency in an audio file?

Audio file implies noise.... which implies matching, some form of FFT is
likely what you are looking for.  Are you sure you are looking for a single
frequency?  Not multiple tones?  Interference patterns?  Touch tones
are a combination of 6 frequencies I think (or something like that).

> Don't worry about format.
> Preferred solution will use Audacity, Octave, R or some other FOSS 
> software. More points the easier it is to use (really a Audacity plugin 
> at least in concept would be great)

How about python?

Say you have 256 samples of a waveform, we will generate it here since
you didn't post any actual wave forms:

Some initialization:
from Numeric import *
from FFT import *
import Gnuplot, Gnuplot.funcutils

Generate a sample waveform:
x=arange(256.0)
inp=sin(2*pi*(1250.0/10000.0)*x) + sin(2*pi*(625.0/10000.0)*x)

Let's plot it to see what it looks like:
g = Gnuplot.Gnuplot(debug=1)
g('set data style linespoints')
d = Gnuplot.Data(x, inp)
g.plot(d)

Now lets take a FFT:
myFFT = 10*log10(abs(real_fft(inp)))
x=arange(len(myFFT))

And plot that:
d = Gnuplot.Data(x, myFFT)
g.plot(d)

You should see noticeable peaks.  So basically what you are going to need to 
do is figure out what frequencies to look for and how long, then break up the
audio into pieces (say 0.1 seconds) then to find a 0.5 second pulse look for
4 in a row above whatever threshold fits your inputs.

Here's an article with more background, my only complaint about it is that
it uses a proprietary graphing library that I couldn't find the python
bindings for (and I dislike academic use only licenses anyways).  The code
above is a minor adaption of the code from the article.

http://www.onlamp.com/pub/a/python/2001/01/31/numerically.html

> Bonus if it flags all the points in say the marker track of audacity, 
> which would make it easy for me to shuffle through and listen to the 
> identified segments.

Not sure on the audacity file format, but it should be relatively easy to
write out a new .wav file, a list of time stamps, or related markup
for whatever tools you using.

> Really any ideas on how to approach this would be welcome.

I tend towards coding because I often become frustrated with the abilities
(like pattern matching) of preexisting tools.  Certainly a bit more info
about what you are trying to do and how you solve it (programming or existing
applications) would be interesting.
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
O'Reilly and Associates
For numerous book donations.