<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: Keep a running average of the last N samples</title>
		<atom:link href="http://cycling74.com/forums/topic/keep-a-running-average-of-the-last-n-samples/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/keep-a-running-average-of-the-last-n-samples/feed</link>
		<description></description>
		<pubDate>Tue, 18 Jun 2013 15:26:06 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/keep-a-running-average-of-the-last-n-samples/#post-47233</guid>
					<title><![CDATA[Keep a running average of the last N samples]]></title>
					<link>http://cycling74.com/forums/topic/keep-a-running-average-of-the-last-n-samples/#post-47233</link>
					<pubDate>Wed, 16 Dec 2009 18:34:49 +0000</pubDate>
					<dc:creator>willyc</dc:creator>

					<description>
						<![CDATA[
						<p>Hello,</p>
<p>I want to keep a running average of the last N samples (or X milliseconds) of an audio stream. The patch below demonstrates exactly what I&#8217;d like to do in Max terms, but I can&#8217;t seem to make a satisfactory solution with MSP objects. There is a proposed solution using [+=~] but as indicated in the patch it is not without creating a potential problem&#8230;.</p>
<p>Any ideas or externals that might help? I want to remain entirely in the signal domain if possible&#8230;.</p>
<p>Cheers<br />
Will</p>
<p>
<div><span id="toggle47233-0" class="patchtoggle" onmousedown="toggleMaxPatch('post47233-0', 'er47233-0');">&#8211; Pasted Max <span id="maxversion47233-0"></span> Patch, click to <span id="er47233-0">expand</span>. &#8211;</span> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  width="110" height="14" class="clippy" ><param name="allowScriptAccess" value="always" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param NAME="FlashVars" value="copied=copied!&#038;copyto=copy to clipboard"/><param name="bgcolor" value="#FFFFFF"/><param name="wmode" value="opaque"/><embed src="/wp-content/plugins/bbpress-copy-compressed/clippy.swf"  width="110" height="14"   name="clippy"  quality="high"  allowScriptAccess="always"  type="application/x-shockwave-flash"  pluginspage="http://www.macromedia.com/go/getflashplayer"  FlashVars="text=----------begin_max5_patcher----------%0A1722.3oc2a00aaaCE84Tf9efvn.cCI0U7KYoBzG5S6kUf.jMfATTLPay3nU8%0Aggj7RZKV9sOJRIGkT6PRaJSsAzJEynPc3g264d4kze%2Bku3rIyKtiWMA7Nvm.%0Amc12EsblrslVNqqgyljwtaQJqR9fSVTjkwyqmbQ6urleWs7W76UbvmN%2B82%2BY%0A.KeInZy75R1hZvs2vpAI0UfhM0q2H9LqB7GfrJ.aUwzoS21OoI47EEaxkcFp%0Aq0qKxqyYYb4a3CkIrzs%2BAIKkMVL%2BudyLx1VWWxqDviUmTj%2Bmk7E0pQGAFOM3%0AB.In4Z2Evm6%2BZpR9l70z7fsMmuIKIOkWKG4vsuBV8haRxW0u6ox9DKuBwzla%0AnY8eChtRP.c8Ufr0%2B4kun4t31EFS%2B7usjs39cRB3I6D2nmA2HJUgaIvIztqt%0AG2h9YNu7Afa3DKR2DKdFQBZLZ2yrUIqj.%2BgIUSlq2xYYEK45HQ7rVdS91QPI%0ARfOyr%2B1NS0V8WWyU8TCZyaXBvjqSKXh9%2ByGLguW%2Bze6FdmuXw0sdr2ljlBVU%0AVbKHI%2B5j7jZd5WmBtTP4axXyS%2BJn9ljJf3eyYKmN0YtsvItxAraNHPdC1NUL%0AHdf6kXujWlTrDTW.X%2BMujsRPyh6feJq5mcBcENSqJWLTM7ICiLGUoehT2hGP%0ARNmeqXH%2BibLa4Ba0PBoNyJifB5YdIjbnGuid6OcDd56iqp3oBjWTdO.YKkQr%0AhxvOmiYaLwH0sfXchiPcb1.vTBs1kY7pJPfsDEVGQcSxxk77GMvLWTSwcgxq%0AzYGNyMDb14.nsjEZxAEC9YrpL0Qb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kyeXfNms3KqJK1ju7Quw9GKvH62vcXuy0W6QERtqxtekyVOZ%0AzloCFJya7Mvi8LN1mDZ%2B.IzhupJpmSd.7e523I4qq4W7DpopXS4hNijtciCz%0A6MtjWUmjKGx8dpluzJ8epGNBvAOb.lVttPnm0hDbDooD3H0deiwp0G%2BnOQTG%0AVz1mT9omyp03gTyA.Q%2BPpYeZsaH4Dv8zW6tAWyoUG.O4fKjZL3PmdvQLZZk5%0Ako0PjwLmG.G1HvA2G3fCJ3LxaMD4Elq4bw12Ob2fq4H14AuUI3zxbMGEcevb%0AFoyQ7D3hLh4BGwL2Sm7OUguhMZZclWbHHQiXaNyRz5oCgSkMmQQHn9I7EwLc%0AN7XdZ0OdqHi.GxOfyLr4mz4PONC2ciMH0KILgLIkDHwaXS6bJD6ErYjDGD4E%0Ar0rYU5AmeT3hGuPKZ7BsYiWnYl3l3gvdAZPSfFxKPKvDnc5y60nUP6m.oFI5%0AhFuPCdzPqoAws%2BEvcbAIP%0A-----------end_max5_patcher-----------&#038;copied=copied!&#038;;copyto=copy to clipboard"  bgcolor="#ffffff"  wmode="opaque" /> </object></div>
<div id="post47233-0" style="display:none;visibility:hidden;" >
<div class="patchtoggleInfo"><small>Copy <b>all</b> of the following text.Then, in Max, select <em>New From Clipboard</em>.</small></div>
<div class="patchtogglediv">
<pre><code id="pastedcode47233-0">----------begin_max5_patcher----------
1722.3oc2a00aaaCE84Tf9efvn.cCI0U7KYoBzG5S6kUf.jMfATTLPay3nU8
ggj7RZKV9sOJRIGkT6PRaJSsAzJEynPc3g264d4kze+ku3rIyKtiWMA7Nvm.
mc12EsblrslVNqqgyljwtaQJqR9fSVTjkwyqmbQ6urleWs7W76UbvmN+82+Y
.KeInZy75R1hZvs2vpAI0UfhM0q2H9LqB7GfrJ.aUwzoS21OoI47EEaxkcFp
q0qKxqyYYb4a3CkIrzs+AIKkMVL+udyLx1VWWxqDviUmTj+mk7E0pQGAFOM3
B.In4Z2Evm6+ZpR9l70z7fsMmuIK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zHZ7.oRi6ue8HenS+Q1c.150kE2kjIG8MJ1hONOkmYMeF3XErGUd8S
Lwb0lrsAuttXS4AF+BFos96JqKT7.Yj05mFS8mQ1utkDaymp501RitK3XaB5
pU6Mj4FcPEvDR0pIolBQACj8RWBRAzdtfGT1CNsXl1xiZS.GEEoVHBbf3Qz+
K3Qrd8qvA0drS45+37HxYBXvvQFgzrGeh058i59XaIo.sFawpJpDdDmfRj1f
CsgHBO7RJOHzosmeFsanMpsBdCEap52QJaZ64FQehbPUMiCgCCaRFy1l1V39
YNdQ79kVNr8p1wqVpMP4wTuGWEgbe6yCHwRNB6ZNp8vIcD6bw.sagy2r3K7Z
fsgLcWZEg8+VCneihw62Q5h1+O.rD+t0kfWk.Am+pDD3bwOhkWI1logUzFQu
cUWNYw94zEslkyeXfNms3KqJK1ju7Quw9GKvH62vcXuy0W6QERtqxtekyVOZ
zloCFJya7Mvi8LN1mDZ+.IzhupJpmSd.7e523I4qq4W7DpopXS4hNijtciCz
6MtjWUmjKGx8dpluzJ8epGNBvAOb.lVttPnm0hDbDooD3H0deiwp0G+nOQTG
Vz1mT9omyp03gTyA.Q+PpYeZsaH4Dv8zW6tAWyoUG.O4fKjZL3PmdvQLZZk5
ko0PjwLmG.G1HvA2G3fCJ3LxaMD4Elq4bw12Ob2fq4H14AuUI3zxbMGEcevb
FoyQ7D3hLh4BGwL2Sm7OUguhMZZclWbHHQiXaNyRz5oCgSkMmQQHn9I7EwLc
N7XdZ0OdqHi.GxOfyLr4mz4PONC2ciMH0KILgLIkDHwaXS6bJD6ErYjDGD4E
r0rYU5AmeT3hGuPKZ7BsYiWnYl3l3gvdAZPSfFxKPKvDnc5y60nUP6m.oFI5
hFuPCdzPqoAws+EvcbAIP
-----------end_max5_patcher-----------</code></pre></div>
</div>
</p>						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/keep-a-running-average-of-the-last-n-samples/#post-169868</guid>
					<title><![CDATA[Re: Keep a running average of the last N samples]]></title>
					<link>http://cycling74.com/forums/topic/keep-a-running-average-of-the-last-n-samples/#post-169868</link>
					<pubDate>Wed, 16 Dec 2009 18:59:57 +0000</pubDate>
					<dc:creator>Tim Lloyd</dc:creator>

					<description>
						<![CDATA[
						<p>Maybe you&#8217;ve already tried this and it isn&#8217;t quite what you mean, but couldn&#8217;t you just adjust the interval time of the average~ object?  It&#8217;s default mode with an argument of 44100 seems to do the same thing as your example patch.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/keep-a-running-average-of-the-last-n-samples/#post-169869</guid>
					<title><![CDATA[Re: Keep a running average of the last N samples]]></title>
					<link>http://cycling74.com/forums/topic/keep-a-running-average-of-the-last-n-samples/#post-169869</link>
					<pubDate>Wed, 16 Dec 2009 19:30:24 +0000</pubDate>
					<dc:creator>willyc</dc:creator>

					<description>
						<![CDATA[
						<p>That would only provide the average amplitude (of the previous seconds audio) once a second.</p>
<p>I want to know the average of the last X ms of audio every single sample&#8230;.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/keep-a-running-average-of-the-last-n-samples/#post-169870</guid>
					<title><![CDATA[Re: Keep a running average of the last N samples]]></title>
					<link>http://cycling74.com/forums/topic/keep-a-running-average-of-the-last-n-samples/#post-169870</link>
					<pubDate>Wed, 16 Dec 2009 21:01:15 +0000</pubDate>
					<dc:creator>MIB</dc:creator>

					<description>
						<![CDATA[
						<p>I haven&#8217;t used it personally, but there is an object out there (ircam??) called [accumulate~]. it might do what you need or at least get you closer&#8230;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/keep-a-running-average-of-the-last-n-samples/#post-169871</guid>
					<title><![CDATA[Re: Keep a running average of the last N samples]]></title>
					<link>http://cycling74.com/forums/topic/keep-a-running-average-of-the-last-n-samples/#post-169871</link>
					<pubDate>Wed, 16 Dec 2009 21:29:06 +0000</pubDate>
					<dc:creator>Tim Lloyd</dc:creator>

					<description>
						<![CDATA[
						<p>I think you&#8217;re referring to the CNMAT accumulate~ object, which very similar to the new +=~.  It still has the 32-bit float accuracy limitation that +=~ has, so after about 6 mins at 44100sr, your patch would become inaccurate. </p>
<p>I do get what you&#8217;re saying that you need now, but I&#8217;m not sure how to go about doing it.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/keep-a-running-average-of-the-last-n-samples/#post-169872</guid>
					<title><![CDATA[Re: Keep a running average of the last N samples]]></title>
					<link>http://cycling74.com/forums/topic/keep-a-running-average-of-the-last-n-samples/#post-169872</link>
					<pubDate>Wed, 16 Dec 2009 21:30:55 +0000</pubDate>
					<dc:creator>ComfortableInClouds</dc:creator>

					<description>
						<![CDATA[
						<p>actually, average~ does exactly what you are looking for. That is, the oldest value leaves the buffer as the newest sample value enters and then the average is recalculated, at every single sample. Thus giving a continuously updated average value. what you described is the avg~ object, not average~. </p>
<p>Using the CNMAT accumulate~ external, you can create a memoryless system to analyze the instantaneous energy in a signal. Look at the leaky-integrator example provided in the accumulate~ help file if you&#8217;re interested.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/keep-a-running-average-of-the-last-n-samples/#post-169873</guid>
					<title><![CDATA[Re: Keep a running average of the last N samples]]></title>
					<link>http://cycling74.com/forums/topic/keep-a-running-average-of-the-last-n-samples/#post-169873</link>
					<pubDate>Wed, 16 Dec 2009 21:40:48 +0000</pubDate>
					<dc:creator>Tim Lloyd</dc:creator>

					<description>
						<![CDATA[
						<p>I nearly suggested that example, but couldn&#8217;t think how to go about changing the number of samples that the integrator &#8220;averages&#8221; over.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/keep-a-running-average-of-the-last-n-samples/#post-169874</guid>
					<title><![CDATA[Re: Keep a running average of the last N samples]]></title>
					<link>http://cycling74.com/forums/topic/keep-a-running-average-of-the-last-n-samples/#post-169874</link>
					<pubDate>Thu, 17 Dec 2009 12:31:20 +0000</pubDate>
					<dc:creator>willyc</dc:creator>

					<description>
						<![CDATA[
						<p>Thanks for all the suggestions. It looks like [average~] actually does exactly what I want.</p>
<p>Looking at the helpfile for it reveals it produces a signal output. The reference manual states a float output, hence my initial reluctance in using it. Cheers</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

