>> we have to clean the delay buffers somehow
>> Now, can you do that in pd?
That's a good question!
What you could do is to build a custom delay line with tables and then sum them
as you need.
In meantime: Here's a classic FIR solution for a moving average filter (the
maximum size is hard coded to 256, but you can change this). Here you can set
the number of samples dynamically with clearly less distortion. Note though,
that this kind of filter becomes more and more computationally expensive for
large numbers of samples (anything above 256), because FIR~ (from iemlib)
performs time domain convolution.
The recursive version with [z~] and [rpole~] is certainly the cheapest and
fastest of all, but there's nothing like a free meal :-).
Cheers
Gesendet: Dienstag, 08. Dezember 2015 um 19:10 Uhr
Von: "Alexandre Torres Porres" <[email protected]>
An: "Christof Ressi" <[email protected]>
Cc: "[email protected]" <[email protected]>
Betreff: Re: Re: Re: Re: [PD] Moving Sum object?
> I'm not sure why the other patches don't work but this does.
I got it, you'd need to clear the other delay buffers as well, not the feedback
only!
so we can do this with fexpr~ for up half the block size, we could expand this
limit with delay lines, but if we want to do it with delay lines, we have to
clean the delay buffers somehow
Now, can you do that in pd?
2015-12-08 15:54 GMT-02:00 Alexandre Torres Porres <[email protected]>:
I just wish we could make it work over the half block limit, and I'm not sure
why the other patches don't work but this does.
2015-12-08 15:53 GMT-02:00 Alexandre Torres Porres
<[email protected][[email protected]]>:
here's a better patch
2015-12-08 15:44 GMT-02:00 Alexandre Torres Porres
<[email protected][[email protected]]>:
I've made it work with this design in fexpr, but it's only good up to half the
block size
2015-12-08 15:21 GMT-02:00 Alexandre Torres Porres
<[email protected][[email protected]]>:
As I say in the attached patch; problem is that whenever you change the number
of samples without clearing or clearing the filter, it goes crazy...
not sure how to fix this.
cheers
2015-12-08 10:40 GMT-02:00 Christof Ressi
<[email protected][[email protected]]>:the filter is working perfectly
well for me. send me your testing patch.
Gesendet: Dienstag, 08. Dezember 2015 um 13:36 Uhr
Von: "Alexandre Torres Porres" <[email protected][[email protected]]>
An: "Christof Ressi" <[email protected][[email protected]]>
Cc: "[email protected][[email protected]]"
<[email protected][[email protected]]>
Betreff: Re: Re: Re: [PD] Moving Sum object?
not sure this is working either, I'm getting negative values when testing it
with count~ (only positive values)
2015-12-08 10:30 GMT-02:00 Christof Ressi
<[email protected][[email protected]]>:It certainly is and I have no
idea how that happened :-D. but it has no effect whatsoever. just delete the
connection.
Gesendet: Dienstag, 08. Dezember 2015 um 13:20 Uhr
Von: "Alexandre Torres Porres"
<[email protected][[email protected]][[email protected][[email protected]]]>
An: "Christof Ressi"
<[email protected][[email protected]][[email protected][[email protected]]]>
Cc:
"[email protected][[email protected]][[email protected][[email protected]]]"
<[email protected][[email protected]][[email protected][[email protected]]]>
Betreff: Re: Re: [PD] Moving Sum object?
what was the purpose of the output from the max object into rpole~ in your
patch? that's a bug, right?
cheers
2015-12-08 9:50 GMT-02:00 Christof Ressi
<[email protected][[email protected]][[email protected][[email protected]]]>:
Or are you talking about a object that outputs the sum as a message? In that
case just use [cmavg~] or [maverage~] with [snapshot~]. If you just want the
sum of a signal vector, there are some objects in zexy that will do the job,
like [avg~] or [pack~]+[sum]
Gesendet: Dienstag, 08. Dezember 2015 um 12:41 Uhr
Von: "Christof Ressi"
<[email protected][[email protected]][[email protected][[email protected]]][[email protected][[email protected]][[email protected][[email protected]]]]>
An: "Alexandre Torres Porres"
<[email protected][[email protected]][[email protected][[email protected]]][[email protected][[email protected]][[email protected][[email protected]]]]>
Cc:
"[email protected][[email protected]][[email protected][[email protected]]][[email protected][[email protected]][[email protected][[email protected]]]]"
<[email protected][[email protected]][[email protected][[email protected]]][[email protected][[email protected]][[email protected][[email protected]]]]>
Betreff: Re: [PD] Moving Sum object?
Well, a linear moving average filter is just something that sums a series of
samples. If you don't want the average but rather the true sum, either multiply
the output by the number of samples or take my abstraction and get rid of the
[/~] object.
Gesendet: Dienstag, 08. Dezember 2015 um 12:21 Uhr
Von: "Alexandre Torres Porres"
<[email protected][[email protected]][[email protected][[email protected]]][[email protected][[email protected]][[email protected][[email protected]]]]>
An: "Christof Ressi"
<[email protected][[email protected]][[email protected][[email protected]]][[email protected][[email protected]][[email protected][[email protected]]]]>
Cc: "Matt Barber"
<[email protected][[email protected]][[email protected][[email protected]]][[email protected][[email protected]][[email protected][[email protected]]]]>,
"[email protected][[email protected]][[email protected][[email protected]]][[email protected][[email protected]][[email protected][[email protected]]]]"
<[email protected][[email protected]][[email protected][[email protected]]][[email protected][[email protected]][[email protected][[email protected]]]]>
Betreff: Re: Re: [PD] Moving Sum object?
cool guys, but i was asking for an average "sum" object :)
2015-12-08 9:19 GMT-02:00 Christof Ressi
<[email protected][[email protected]][[email protected][[email protected]]]>:Hey
Matt,
there's no need for the feedback path (and therefore no [block~ 1] ;-))
Just use the following formula:
y[n] = (y[n-1] - x[n-k])/k
where k is the number of samples to be averaged (must be at least 1). see the
patch I sent to Alex in my last mail.
it uses [rpole~ 1] for the y[n-1] part and [z~ k] for the x[n-k] part (you can
replace the latter one with a [delwrite~] [delread~] pair to make it purely
vanilla).
The funny thing about linear moving average filters is, that although it can be
implemented as a recursive filter (like in both our patches), it is still a FIR
filter (and therefore it defeats the notion that recursive filters are always
IIR filters). The impulse response is just a rectangular pulse and therefore
finite.
Gesendet: Dienstag, 08. Dezember 2015 um 07:13 Uhr
Von: "Matt Barber"
<[email protected][[email protected]][[email protected][[email protected]]]>
An: "Alexandre Torres Porres"
<[email protected][[email protected]][[email protected][[email protected]]]>
Cc:
"[email protected][[email protected]][[email protected][[email protected]]]"
<[email protected][[email protected]][[email protected][[email protected]]]>
Betreff: Re: [PD] Moving Sum object?
Something like this? Almost completely untestsed. :D
On Tue, Dec 8, 2015 at 12:20 AM, Alexandre Torres Porres
<[email protected][[email protected]][[email protected][[email protected]]]> wrote:
Talking about averages I wonder if we have an object that sums (in a moving
average fashion) a series of samples
cheers
_______________________________________________
[email protected][[email protected]][[email protected][[email protected]]][[email protected][[email protected]][[email protected][[email protected]]]]
mailing list
UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list[http://lists.puredata.info/listinfo/pd-list][http://lists.puredata.info/listinfo/pd-list%5Bhttp://lists.puredata.info/listinfo/pd-list%5D][http://lists.puredata.info/listinfo/pd-list[http://lists.puredata.info/listinfo/pd-list][http://lists.puredata.info/listinfo/pd-list%5Bhttp://lists.puredata.info/listinfo/pd-list%5D]][http://lists.puredata.info/listinfo/pd-list%5Bhttp://lists.puredata.info/listinfo/pd-list%5D%5Bhttp://lists.puredata.info/listinfo/pd-list%5Bhttp://lists.puredata.info/listinfo/pd-list%5D%5D%5Bhttp://lists.puredata.info/listinfo/pd-list%5Bhttp://lists.puredata.info/listinfo/pd-list%5D%5Bhttp://lists.puredata.info/listinfo/pd-list%5Bhttp://lists.puredata.info/listinfo/pd-list%5D%5D%5D]
_______________________________________________
[email protected][[email protected]][[email protected][[email protected]]]
mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list[http://lists.puredata.info/listinfo/pd-list][http://lists.puredata.info/listinfo/pd-list%5Bhttp://lists.puredata.info/listinfo/pd-list%5D]_______________________________________________[http://lists.puredata.info/listinfo/pd-list[http://lists.puredata.info/listinfo/pd-list][http://lists.puredata.info/listinfo/pd-list%5Bhttp://lists.puredata.info/listinfo/pd-list%5D]_______________________________________________][http://lists.puredata.info/listinfo/pd-list%5Bhttp://lists.puredata.info/listinfo/pd-list%5D%5Bhttp://lists.puredata.info/listinfo/pd-list%5Bhttp://lists.puredata.info/listinfo/pd-list%5D%5D_______________________________________________%5Bhttp://lists.puredata.info/listinfo/pd-list%5Bhttp://lists.puredata.info/listinfo/pd-list%5D%5Bhttp://lists.puredata.info/listinfo/pd-list%5Bhttp://lists.puredata.info/listinfo/pd-list%5D%5D_______________________________________________%5D]
[email protected][[email protected][[email protected]][[email protected][[email protected]]]]
mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list[http://lists.puredata.info/listinfo/pd-list][http://lists.puredata.info/listinfo/pd-list[http://lists.puredata.info/listinfo/pd-list]][http://lists.puredata.info/listinfo/pd-list%5Bhttp://lists.puredata.info/listinfo/pd-list%5D%5Bhttp://lists.puredata.info/listinfo/pd-list%5Bhttp://lists.puredata.info/listinfo/pd-list%5D%5D]
#N canvas 482 353 633 351 10;
#X obj 41 40 inlet~;
#X obj 153 42 inlet;
#X obj 153 71 clip 1 256;
#X obj 153 93 t b f f b;
#X obj 365 188 table \$0-kernel 256;
#X obj 313 153 s \$0-kernel;
#X msg 303 121 const 0;
#X obj 40 207 FIR~ \$0-kernel 256;
#X obj 39 305 outlet~;
#X obj 41 252 /~ 256;
#X obj 232 188 f;
#X obj 270 186 + 1;
#X obj 203 136 until;
#X obj 203 158 t b b;
#X obj 200 232 tabwrite \$0-kernel;
#X msg 197 205 1;
#X msg 255 150 0;
#X obj 63 129 symbol \$0-kernel;
#X obj 62 157 pack s f;
#X msg 57 183 set \$1 \$2;
#X obj 209 10 loadbang;
#X msg 205 38 256;
#X connect 0 0 7 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 17 0;
#X connect 3 1 9 1;
#X connect 3 1 18 1;
#X connect 3 2 12 0;
#X connect 3 3 6 0;
#X connect 3 3 16 0;
#X connect 6 0 5 0;
#X connect 7 0 9 0;
#X connect 9 0 8 0;
#X connect 10 0 11 0;
#X connect 10 0 14 1;
#X connect 11 0 10 1;
#X connect 12 0 13 0;
#X connect 13 0 15 0;
#X connect 13 1 10 0;
#X connect 15 0 14 0;
#X connect 16 0 10 1;
#X connect 17 0 18 0;
#X connect 18 0 19 0;
#X connect 19 0 7 0;
#X connect 20 0 21 0;
#X connect 21 0 2 0;
_______________________________________________
[email protected] mailing list
UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list