Forums > MaxMSP

Analyzing frequency of wave?

July 23, 2006 | 3:02 pm

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


July 23, 2006 | 3:25 pm

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
>
>


July 23, 2006 | 3:26 pm

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.


July 23, 2006 | 3:49 pm

[zerox~]

-110


July 24, 2006 | 8:53 am


July 24, 2006 | 11:45 am

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
>


July 24, 2006 | 1:43 pm

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


Viewing 7 posts - 1 through 7 (of 7 total)