time between zero crossings
i am having a whale of a time trying to measure the time between zero crossings in a wave form (in samples).
everytime i think i get close i realise it relies on bangs.. and bangs don’t seem accurate enough :( after all you can fit 44 samples between bangs… more or less :)
basically what i want to do is, have any wave input (complex, sine whatever), then measure the time between every time it crosses zero..( the y-axis i suppose)….
thanks in confusion,
what i mean is,
can anyone suggest a method to help me ?? :)
Here are some ideas (for real time, and for non real time analyse on a
Not sure it is really exact…
----------begin_max5_patcher---------- 1187.3ocyY1zbiZCFG+rymBUN1IaJRBLPmlCs8TO0a8P6tSGLVDqtfvCRra1 rylO6EIAic7Jrkiij4BXKiLO5m9+7hj95MKBV07HgG.9Yv+.Vr3q2rXgpIYC KF99hf57GKpx4pGKnnotlvDA2p+MA4Qgp8+nDH1P.0cBAcaEsHWPaXMk.Dnn gwIEcB5mHb.OudaU+cJG7K2CBuU1IF3yDvl7OQ.4.QaNiSk8c7MTQYjhlNl5 0DMzHcs5k1r5+dWLZ7IKaXBVdMQ8S+EoccNKe72Xc0TVEQnFDv85.m9jpCPz cg6d1lNw3CO151VBuefqFW+aKoPnoVTVReGA3jH4svgKfOL1qbQwFJ6g85QL ZotGoxavXUeVFK6jrOe6lajWt8BmO9SVOMW0UVRZCL.M30EZgJnECskYunCC HCAekHiQ9bOC9Nh8N.zDoBOaRgNGRMhUcShurknGwAToh+XHAonPLRwDL5t3 KAIc0qLJThxbqPAcrg+sffU4rGNJFhCUNdnPEFbixXaau0.deveSZa981FNG rsQGjBPYCgzdefI54qXSSKOhUNNHTlK.C0zXFNucXhR0wcCCuLOFyDQlT6NC TAmNyohVfDszExDAnDrxDTvWofKkUM41EdY.OXrBO3XWfmR.znj4Zk4QSmiR EMHvKGpjwEdR+nYpfVNeoxfVICqtE4BsBmTYrLETrawxjtRJOndOIqBxDmpA jSJeyHVhlogcGKaYfHHW3A08jo7yHjaQB9TJkw61hHTp6xLUyEMx523OahTv qT5IN8AVdkjQ1DJVQIXhJhbpaJyiU17LH+25JMPIniWgP5IShWQ4hcvxxObT nhyTbDpKJBBwtv8Tu37o4Z5ru3nk5UkCSTq8RWW8a9ZuHjONMiRNaFg8aw.n LEURgtfM2e+ySTjjYt7qsTYXEaivCuKNKFllbdnYH30wXCDqkJQJpDMr.92V 1TroW8RLEVG53v5uEjITca4kUBI4o04EFIP3QEAVuGCXcFZX5P0ciWeUVauK U+K1f05ocfZhspDhUw3xLu8tWPvygoZ8eLLxIAH9gepuJJi6GQ5rcUTit.5T vwnKhKSJpRl8IWG3.Ficn.guk9QiAIim85ijv2.8wTIO9RQE4Y4dDZZCNuRn w9zGP8ILkjbQrYxS5iAZI4U.AsenaXaqtZa4MDls6L.bzgD8Dos4Qi4Tu5qU 7LzGC9N3KhP0DNO+Ax2gnVx1p7BSRiH7Ux0wpUwnivFqyGm8JgxpNgX2YWu+ XO5nh.KGHmLqwvJW0WGVBxgUVq5u5b0O3j+U+ex1e4.j2z0VLZAimIJXWQPq IbAkoJbZuGRd1W68PanqWSX66AWSWusgxDCFwD31VaRdrSmzlNvvctMkYgMg 7KmjapE.dp4tL+xoHK3Dzy1D1FaJ0uyc1vonWNA6baJ1VaxebBmZieWrem6V ZgMg8qdBaiFWdLjdTOorInM1zLiSGLA6baJzVaxeycxsi8z5I77Kl4AFtysI YJezol6h7pMoRut7T1jeiiCsolNjmm6rQi62TKVov86DmEwvg90jroLE+l80 lhT7q11lkqbIQk5+x2t4+AjKKDuH -----------end_max5_patcher-----------
On 7 oct. 08, at 12:40, ccjj wrote:
> i am having a whale of a time trying to measure the time between
> zero crossings in a wave form (in samples).
> everytime i think i get close i realise it relies on bangs.. and
> bangs don’t seem accurate enough :( after all you can fit 44 samples
> between bangs… more or less :)
> basically what i want to do is, have any wave input (complex, sine
> whatever), then measure the time between every time it crosses zero..
> ( the y-axis i suppose)….
Centre de Recherches et de Formation Musicales de Wallonie asbl
here is an external that counts the samples between impulses (signal of +1). You can use it with zerox~ to get the number of samples between zero crossings at samplerate
thanks for your replies :)
but i can’t open any :(
i don’t think it helped that i didnt give my details –
Max 4.5.5 on windows xp.
so Patrick Delges, I don’t know if I can use that code.
and oli larkin,
the errors i get with your files are__
error: error 14001 loading external ol.sampletime~
and the sampletimertest.maxpat comes out as code. I don’t know what to do with that.
and to Shea Ako
error: trans_timer~: No such object
there is the trans_timer~.mxo folder, but I have no idea what that is :?
oli, thanks,i installed the visual studio,
now the ol.sampletimer~ works as an object,
but the test patch comes out as text/code.
so basically i can’t work out what/how the ol.sampletimer~ does/works :P
tried connecting a cycle~ into the top, and a signal monitor and flownumber to the bottom. but it doesnt really give me anyhting i can recognise :)
i have however got to a new point in my development.
running the wave through a zerox~, with the click going into a +=~ accumulator.
into a buffer, the accumuluator gives the index and a running counter gives a number into the index, if i deduct previous index point value it gives me a sample value of time !! hooray !!
The problem now is to access these values in useable timing. am trying the play~ object so I can run a signal value in for index, but this creates problem with having to define a buffer~ size…
hmmmm, it will wait until tomorrow
#P user ezdac~ 418 78 462 111 0;
#P window setfont Tahoma 9.;
#P user number~ 254 228 344 242 9 268 2 2 0. 0. 0 0. 250 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont Tahoma 10.;
#P window linecount 1;
#P newex 142 105 39 17563658 zerox~;
#P newex 123 71 46 17563658 cycle~ 1;
#P newex 203 154 78 17563658 ol.sampletimer~;
#P connect 0 0 3 0;
#P connect 2 1 0 0;
#P connect 1 0 2 0;
#P window clipboard copycount 5;
the ol.sampletimer~ works great !! am curious as to the other output ??
of course now i need to know how to get an amplitude figure between zero crossings :P
was initially hoping that i’d make the zero crossing counter object and then use techniques for that ..
Forums > MaxMSP