Loading...
Logo
Processing Forum
Hello all,

I'm not really new to Processing, but I am very new to audio. I've searched the old forums and I saw alot of topics on audio, but I never found a good solution for my simple problem.

Basically, the only thing I want, is to know the frequency of incoming sound. I used to write a little program that did this using the krister.Ess library, but that library doesn't seem to work anymore...

I've got two iMacs which both send out a short sinewave on a certain frequency (i.e. 3000 & 5000). When iMac1 receives a tone at +- 3000Hz, it should send out a tone at 5000Hz.. When iMac2 receives a tone at 5000Hz, it should send out at 3000Hz. So they're just ping-ponging a sinewave to eachother... I need a script what will listnen to audio, and DO something once it receives audio from about an certain frequency.

I read alot about FFT and stuff, but I can't really seem to get audio input and fft analyse together...

I hope you understand what I mean. Is there anyone who could give me a lead on this?

Thanks in advance


ps. It doesn't have to use the krister.ess library ofcourse... Anything that will work is fine!

Replies(1)

Hi
Open your examples/minim/forwardFFT script. it can easily be adopted to listening to linein by using "AudioInput in;" instead of "AudioPlayer jingle". (see getLineIn example on how to initialise the input).

Set your buffer to some long value to increase resolution of the FFT. That should give you enough resolution to find two bars to compare agains each other to determine the frequency.

Much more precise solution would involve doing Notch filtering and comparing the amplitude of the output.

quick google gave me that link
which can help you design the filter to your desired characteristics (it will generate a series of values which you convolute your input with) but if you don't know a thing or two about DSP this route will likely just give you headache