you can do this with a delay of [insert number of samples in signal block here] and a simple feedback system.
First, subtract the delayed signal from the direct (undelayed) signal. This delay controls the number of samples to sum over. Then feed the output of this into a 1-tap IIR filter (this means the output of this filter gets multiplied by a coefficient before getting summed with the input). In a mathematical proof this coefficient is equal to 1 exactly, although this is an IIR filter on the LIMIT of stability and with floating point arithmetic it should rather be set to 0.999999999.
I couldn't be bothered to craft a nice ascii pic of this so I did a gif instead (attached). The delta sign is the delay, and the sigma sign indicates summation. K is the coefficient discussed.
As far as implementing this I am not entirely sure. pipe~ would perform a delay although it would probly not be sample accurate, but using z~ would be a little messy (you would need lots of them). The feedback cannot be implemented directly as I think this would cause a 'DSP loop' which would not be solved by using a z~ in the path (please correct me if I'm wrong), while a send and receive pair would give a delay of 64 samples if that was the size of your signal block. hmmm.
Matt
-=-=-=-=-=-=-=-=-=-=-=- http://www.loopit.org -=-=-=-=-=-=-=-=-=-=-=- ----- Original Message ----- From: "Jacob Last" jacoblast@gmail.com To: "Mathieu Bouchard" matju@artengine.ca Cc: "the PureData - mailinglist" pd-list@iem.at; jamie@postlude.co.uk Sent: Monday, July 18, 2005 4:29 PM Subject: Re: [PD] feature extraction
On 7/15/05, Mathieu Bouchard matju@artengine.ca wrote:
(snip)
you can compute the centroid of signal chunks using a [phasor~] tuned to ramp up exactly synched with each block, one or two [*~] and then summing or averaging all values in each chunk ([lop~] could do it but there are better ways that I can't think of now).
(snip)
How would I do this? I am trying think out how to average all the values in a signal block and output a single float at the end of each DSP cycle...is there an external to do this? I can't think of an abstraction to do it.
Thanks, Jacob
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list