Get audio sigal's highest frequency/lowest frequency (above certain thresold)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Get audio sigal's highest frequency/lowest frequency (above certain thresold)

seanlee
This post was updated on .
Hi sc users,

I was trying to synthesis some sound based on current audio input's highest frequency /lowest frequency (maybe need to above a thresold), sort of like SpecCentroid but for lowest/highest. I didn't found any existing ugen to do that, is there a good solution to this? Or is this even a valid question to ask?


Thanks in advanced!
Reply | Threaded
Open this post in threaded view
|

Re: Get audo sigal's highest frequency/lowest frequency (above certain thresold)

Nathan Ho
On 2017-02-14 07:15, seanlee wrote:

> Hi sc users,
>
> I was trying to synthesis some sound based on current audio input's
> highest
> frequency /lowest frequency (maybe need to above a thresold), sort of
> like
> *SpecCentroid* but for lowest/highest. I didn't found any existing ugen
> to
> do that, is there a good solution to this? Or is this even a valid
> question
> to ask?

I'm not aware of an FFT UGen that finds the frequency of the
lowest/highest nonzero bins, but using SpecPcile with low and high
percentile values might come pretty close.

(
{
     var snd, chain;
     snd = WhiteNoise.ar;
     snd = BHiPass4.ar(snd, 300, 0.1);
     snd = BLowPass4.ar(snd, 1000, 0.3);
     chain = FFT(LocalBuf(2048), snd);
     SpecPcile.kr(chain, 0.05).poll(label: "min");
     SpecPcile.kr(chain, 0.95).poll(label: "max");
     0
}.play;
)

You can tweak this by prefiltering with e.g. PV_MagAbove.


Nathan

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Reply | Threaded
Open this post in threaded view
|

Re: Get audo sigal's highest frequency/lowest frequency (above certain thresold)

daniel-mayer
In reply to this post by seanlee

Am 14.02.2017 um 16:15 schrieb seanlee <[hidden email]>:

> Hi sc users,
>
> I was trying to synthesis some sound based on current audio input's highest
> frequency /lowest frequency (maybe need to above a thresold), sort of like
> *SpecCentroid* but for lowest/highest.



In addition to a FFT-based analysis, as Nathan suggested, you might want
to use RunningMax / RunningMin for tracking.

Regards

Daniel

-----------------------------
www.daniel-mayer.at
-----------------------------



_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Reply | Threaded
Open this post in threaded view
|

Re: Get audo sigal's highest frequency/lowest frequency (above certain thresold)

seanlee
In reply to this post by Nathan Ho
Thanks so much Nathan, that seems really close! Will try on real microphone to test

On Wed, Feb 15, 2017 at 1:17 AM, Nathan Ho <[hidden email]> wrote:
On 2017-02-14 07:15, seanlee wrote:
Hi sc users,

I was trying to synthesis some sound based on current audio input's highest
frequency /lowest frequency (maybe need to above a thresold), sort of like
*SpecCentroid* but for lowest/highest. I didn't found any existing ugen to
do that, is there a good solution to this? Or is this even a valid question
to ask?

I'm not aware of an FFT UGen that finds the frequency of the lowest/highest nonzero bins, but using SpecPcile with low and high percentile values might come pretty close.

(
{
    var snd, chain;
    snd = WhiteNoise.ar;
    snd = BHiPass4.ar(snd, 300, 0.1);
    snd = BLowPass4.ar(snd, 1000, 0.3);
    chain = FFT(LocalBuf(2048), snd);
    SpecPcile.kr(chain, 0.05).poll(label: "min");
    SpecPcile.kr(chain, 0.95).poll(label: "max");
    0
}.play;
)

You can tweak this by prefiltering with e.g. PV_MagAbove.


Nathan



--
Best regards,
李松, Sean Lee