hi, I currently try to analyse sound input (using microphone) and check if the sound contains a definite frequency range. so if there is a frequency range of 10,000 to 11,000 hz in there it should do a bang for example. So I tried a little bit with fft and tabwrite but at the moment I stuck. Does anyone of you have an idea how to solve the problem? thanks, cheers
Christian Klotz
Christian Klotz wrote:
hi, I currently try to analyse sound input (using microphone) and check if the sound contains a definite frequency range. so if there is a frequency range of 10,000 to 11,000 hz in there it should do a bang for example. So I tried a little bit with fft and tabwrite but at the moment I stuck. Does anyone of you have an idea how to solve the problem? thanks, cheers
yes, try fft and tabwrite....
to be honest: why not using a [bp~] for such a task ? if you really need fft's, be sure that you know that the signals coming out of [rfft~] are real and imaginary parts of a complex signal. since you need the amplitude of the complex signal you will have to calculate it yourself.
mfg.as.dr IOhannes
On 23.07.2004, at 13:17, IOhannes m zmoelnig wrote:
Christian Klotz wrote:
hi, I currently try to analyse sound input (using microphone) and check if the sound contains a definite frequency range. so if there is a frequency range of 10,000 to 11,000 hz in there it should do a bang for example. So I tried a little bit with fft and tabwrite but at the moment I stuck. Does anyone of you have an idea how to solve the problem? thanks, cheers
yes, try fft and tabwrite....
to be honest: why not using a [bp~] for such a task ? if you really need fft's, be sure that you know that the signals coming out of [rfft~] are real and imaginary parts of a complex signal. since you need the amplitude of the complex signal you will have to calculate it yourself.
mfg.as.dr IOhannes
I am new to sound analysis and started using fft because I thought about doing some other things with the sound analysis later. My problem is - even after reading the fft documentation - that I dont know how to handle the real and imaginary data. The main question for me is which objects or arguments have to be set to check if the sound contains the requestd frequency range.
mfg Christian Klotz
Christian Klotz wrote:
On 23.07.2004, at 13:17, IOhannes m zmoelnig wrote:
I am new to sound analysis and started using fft because I thought about doing some other things with the sound analysis later. My problem is - even after reading the fft documentation - that I dont know how to handle the real and imaginary data. The main question for me is which objects or arguments have to be set to check if the sound contains the requestd frequency range.
probably try [bp~ 11000 100] (see help-patch for [bp~]; play with q) then use [env~] to measure the power in the filtered signal. most probably you will have to set the result into relation to the original signal somehow (to make it robust against loudness variance)
as for real and imaginary data: c=x+i*y |c| = sqrt(x^2+y^2) now x and y are your signals; you most likely can skip the sqrt() as it is costy and only "scales" (non-linearily) the result.
mfg.a.sdr IOhannes
bp~ has an annoying shelf, which allows significant leakage of low frequencies which are not of interest.
/\
----------/
__
For a true bandpass, may I suggest a higher order lowpass and
highpass in combination. From IEMLIB, lp10 and hp10 work well
to form a high-slope bandpass, as in this example patch.
/
/
_________/ __
IOhannes m zmoelnig wrote:
Christian Klotz wrote:
On 23.07.2004, at 13:17, IOhannes m zmoelnig wrote:
I am new to sound analysis and started using fft because I thought about doing some other things with the sound analysis later. My problem is - even after reading the fft documentation - that I dont know how to handle the real and imaginary data. The main question for me is which objects or arguments have to be set to check if the sound contains the requestd frequency range.
probably try [bp~ 11000 100] (see help-patch for [bp~]; play with q) then use [env~] to measure the power in the filtered signal. most probably you will have to set the result into relation to the original signal somehow (to make it robust against loudness variance)
as for real and imaginary data: c=x+i*y |c| = sqrt(x2+y2) now x and y are your signals; you most likely can skip the sqrt() as it is costy and only "scales" (non-linearily) the result.
mfg.a.sdr IOhannes
_______________________________________________ PD-list mailing list PD-list@iem.at to manage your subscription (including un-subscription) see http://iem.at/cgi-bin/mailman/listinfo/pd-list
IOhannes m zmoelnig wrote:
Christian Klotz wrote:
On 23.07.2004, at 13:17, IOhannes m zmoelnig wrote:
I am new to sound analysis and started using fft because I thought about doing some other things with the sound analysis later. My problem is - even after reading the fft documentation - that I dont know how to handle the real and imaginary data. The main question for me is which objects or arguments have to be set to check if the sound contains the requestd frequency range.
probably try [bp~ 11000 100] (see help-patch for [bp~]; play with q) then use [env~] to measure the power in the filtered signal. most probably you will have to set the result into relation to the original signal somehow (to make it robust against loudness variance)
as for real and imaginary data: c=x+i*y |c| = sqrt(x^2+y^2) now x and y are your signals; you most likely can skip the sqrt() as it is costy and only "scales" (non-linearily) the result.
mfg.a.sdr IOhannes
PD-list mailing list PD-list@iem.at to manage your subscription (including un-subscription) see http://iem.at/cgi-bin/mailman/listinfo/pd-list
#N canvas 501 44 426 552 10; #X floatatom 111 390 5 0 0 0 - - -; #X obj 101 299 + 0.5; #X obj 101 321 int; #X obj 101 343 change; #X obj 101 365 speedlim 40; #X floatatom 100 137 6 20 10000 0 - - -; #X obj 34 193 hp10_butt~; #X obj 35 246 lp10_butt~; #X obj 101 277 env~; #X obj 101 417 outlet; #X text 140 83 <-- center freq (Hz); #X text 75 61 <-- audio bus in; #X text 159 418 <-- signal level output; #X text 27 12 Symmetrical bandpass filter built with 10th order butterworth highpass and lowpass.; #X msg 282 77 1.4; #X obj 282 55 loadbang; #X obj 100 219 *; #X obj 61 168 /; #X obj 33 61 inlet~; #X obj 100 83 inlet; #X floatatom 178 138 5 0 0 0 - - -; #X obj 178 111 inlet; #X obj 34 417 outlet~; #X text 310 77 1 octave wide; #X text 233 111 <-- sqrt(freq ratio); #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 4 0 0 0; #X connect 4 0 9 0; #X connect 5 0 16 0; #X connect 5 0 17 0; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 7 0 22 0; #X connect 8 0 1 0; #X connect 14 0 20 0; #X connect 15 0 14 0; #X connect 16 0 7 1; #X connect 17 0 6 1; #X connect 18 0 6 0; #X connect 19 0 5 0; #X connect 20 0 17 1; #X connect 20 0 16 1; #X connect 21 0 20 0;
On Jul 23, 2004, at 1:17 PM, IOhannes m zmoelnig wrote:
Christian Klotz wrote:
hi, I currently try to analyse sound input (using microphone) and check if the sound contains a definite frequency range. so if there is a frequency range of 10,000 to 11,000 hz in there it should do a bang for example. So I tried a little bit with fft and tabwrite but at the moment I stuck. Does anyone of you have an idea how to solve the problem? thanks, cheers
yes, try fft and tabwrite....
to be honest: why not using a [bp~] for such a task ? if you really need fft's, be sure that you know that the signals coming out of [rfft~] are real and imaginary parts of a complex signal. since you need the amplitude of the complex signal you will have to calculate it yourself.
mfg.as.dr IOhannes
so I tried a bit with [bp~] but the problem was, that the amplitudes I got were pretty high (after comparision with incoming signal) - dont't know why. So I still don't know how to handle the incoming audio to get to know if a specified frequency range is contained by the the audio in. That's why I tried fft once more, but I have no idea how to calculate the data [rfft~] is giving to me. Does anybody of you have an idea? thanks, mfg Christian