Analyzing frequency of wave?

Jul 23, 2006 at 3:02pm

Analyzing frequency of wave?

Hello
I need to analyze the frequency of a square wave coming in from the adc input. The freq of the wave varies between 50Hz and 20000Hz. I have made a patch that counts the peaks of the wave and measures time between them. This works but only up to 10000Hz.
Is there a better way? Or a msp command or external that does it?
Thanks
Simon

#26896
Jul 23, 2006 at 3:25pm

hi simon

check out the analyzer~ object ( http://www.maxobjects.com/ )

does way more (maybe a bit too much for what you need) , but you’ll be
able to get the freq from it.

cheers
jm

simon wrote:
> Hello
> I need to analyze the frequency of a square wave coming in from the adc input. The freq of the wave varies between 50Hz and 20000Hz. I have made a patch that counts the peaks of the wave and measures time between them. This works but only up to 10000Hz.
> Is there a better way? Or a msp command or external that does it?
> Thanks
> Simon
>
>

#80917
Jul 23, 2006 at 3:26pm

To be more specific: I need to sync the playback speed of a wave file to the incoming signal. The signal is generated by a movie picture camera running at variable speed. So the sync has to be very accurate.

#80918
Jul 23, 2006 at 3:49pm

[zerox~]

-110

#80919
Jul 24, 2006 at 8:53am

#80920
Jul 24, 2006 at 11:45am

Still another option would be to download FTM, and use grb.yin:

http://recherche.ircam.fr/equipes/temps-reel/ftm/index.html

Best,
Trond

> Hello
> I need to analyze the frequency of a square wave coming in from the adc
> input. The freq of the wave varies between
> 50Hz and 20000Hz. I have made a patch that counts the peaks of the wave and
> measures time between them. This
> works but only up to 10000Hz.
> Is there a better way? Or a msp command or external that does it?
> Thanks
> Simon
>

#80921
Jul 24, 2006 at 1:43pm

simon wrote:
> Hello I need to analyze the frequency of a square wave coming in from
> the adc input. The freq of the wave varies between 50Hz and 20000Hz.
> I have made a patch that counts the peaks of the wave and measures
> time between them. This works but only up to 10000Hz. Is there a
> better way? Or a msp command or external that does it? Thanks Simon

analyzer~ and all the other fiddle~ based externals are pretty expensive
for what you want to do. In theory it should be no problem with your
described method to achieve it for higher than 10 kHz. There might be a
bug in your program. You even would not need to look for peaks, if you
clip your signal, you only need to measure the distance between jumps
from 0. to 1. for example. You can multiply the input with a high value
and then send it through a [clip~ 0. 1.]

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#80922

You must be logged in to reply to this topic.