Hi
I am new to Pure Data,
I downloaded and have played around with it for the last couple of
days and it is rather wonderful.
I can quite happily create a basic synth inside it without too much
strife.
:)
However
The reason I wanted to use Pure Data was to implement some of the
maths that I am learning through a couple of DSP books that I am
studying.
The DSP book I have read gives a simple lowpass filter function as
g(n) = (f(n-1) + f(n) + f(n+1))/3
i.e the average value of three consecutive samples. I understand how
this is in effect a lowpass filter.
How do I implement that in PD?
I can easily connect a Oscillator (phasor) object to a lowpass filter
object to the DAC and hear it working,
However I want to be able to create my own lowpass filter i.e. try to
really understand how things are put together.
Therefore if in the function above I need 3 consecutive samples, I
would have thought that I need some kind of buffer to hold and call
those samples from,
so that I can then call three samples average them and then output
that, however that would have to move at the same rate/freq as the
audio engine is set up i.e. 44100Hz ..... errrr.
So I am thinking about how to solve the problem I just seem to be
missing how to start.
Any guidance appreciated. geoff
Hi Geoff
Yes Pd is wonderfull!
Attached shows how to do your example the naive way in Pd. It uses [tabsend~] to get from sig~ domain to message domain. This is not that efficient but good for testing and development.
More efficient is [z~] from zexy or [delread~] and [delwrite~]. Also look at [biquad~] and the raw filters [czero~] and [cpole~]
mvh/ SLP
Geoff skrev:
Hi I am new to Pure Data, I downloaded and have played around with it for the last couple of days and it is rather wonderful.
I can quite happily create a basic synth inside it without too much strife. :)
However The reason I wanted to use Pure Data was to implement some of the maths that I am learning through a couple of DSP books that I am studying.
*The DSP book I have read gives a simple lowpass filter function as *
*g(n) = (f(n-1) + f(n) + f(n+1))/3*
*i.e the average value of three consecutive samples. I understand how this is in effect a lowpass filter.*
*How do I implement that in PD?*
I can easily connect a Oscillator (phasor) object to a lowpass filter object to the DAC and hear it working, However I want to be able to create my own lowpass filter i.e. try to really understand how things are put together.
Therefore if in the function above I need 3 consecutive samples, I would have thought that I need some kind of buffer to hold and call those samples from, so that I can then call three samples average them and then output that, however that would have to move at the same rate/freq as the audio engine is set up i.e. 44100Hz ..... errrr.
So I am thinking about how to solve the problem I just seem to be missing how to start.
Any guidance appreciated. geoff
#N canvas 296 218 804 451 10; #X obj 34 150 table output 64; #X obj 35 119 table input 64; #X obj 35 191 tabreceive~ output; #X obj 35 305 dac~; #X obj 39 69 tabsend~ input; #X obj 486 37 bang~; #X obj 486 92 64; #X obj 486 117 until; #X obj 486 142 f; #X obj 522 143 + 1; #X obj 486 62 t b b; #X obj 531 91 0; #X obj 344 236 tabread input; #X obj 344 275 list; #X obj 344 304 list split 3; #X obj 344 337 expr ($f1+$f2+$f3)/$f4; #X msg 517 285 3; #X floatatom 517 310 5 0 0 0 - - -; #X obj 486 167 t f f; #X obj 540 422 tabwrite output; #X obj 39 19 noise~; #X obj 35 264 *~ 0; #X obj 109 245 hsl 128 15 0 100 0 0 empty empty empty -2 -8 0 10 -204786 -1 -1 7500 1; #X obj 106 265 dbtorms; #X obj 589 219 loadbang; #X connect 2 0 21 0; #X connect 5 0 10 0; #X connect 6 0 7 0; #X connect 7 0 8 0; #X connect 8 0 9 0; #X connect 8 0 18 0; #X connect 9 0 8 1; #X connect 10 0 6 0; #X connect 10 1 11 0; #X connect 11 0 8 1; #X connect 12 0 13 0; #X connect 13 0 14 0; #X connect 14 0 13 1; #X connect 14 0 15 0; #X connect 14 2 13 1; #X connect 15 0 19 0; #X connect 16 0 17 0; #X connect 17 0 15 3; #X connect 18 0 12 0; #X connect 18 1 19 1; #X connect 20 0 4 0; #X connect 21 0 3 0; #X connect 21 0 3 1; #X connect 22 0 23 0; #X connect 23 0 21 1; #X connect 24 0 16 0;
Hi
I have tried to find this in the manual and google searched for a
couple of hours but I can;t find it.
How do you put your patches up in text form on this forum?
How do you then load text patches in PD from this forum?
i.e. I have tried things like copying and pasting them into TEXT edit
saving, changing the, file extension to a pure data one but no joy.
guidance appreciated as I can't find the answer from googling etc.
cheers geoff
Hi Geoff
What operating system and mail client do you use?
Pd files are text files anyway. They can simply be attched to an email as a something.pd file. When you see that attachment in a message just "save as" something.pd. You can then load it from the file->load menu of Pd GUI.
It's not encouraged to paste patches as text to a mail message body (except for small examples between deveopers) because the text format is not designed as human readable. However, if you do see a Pd patch as plain text any place, just select, copy and paste it to a text editor and then save as something.pd, then you should be able to load it normally.
a.
On Tue, 27 Jan 2009 16:56:53 +0000 Geoff geoffspuredata@googlemail.com wrote:
Hi I have tried to find this in the manual and google searched for a
couple of hours but I can;t find it.How do you put your patches up in text form on this forum?
How do you then load text patches in PD from this forum?
i.e. I have tried things like copying and pasting them into TEXT edit
saving, changing the, file extension to a pure data one but no joy.guidance appreciated as I can't find the answer from googling etc.
cheers geoff
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Thanks for confirming the procedure made me realise
that it was because I was saving it as a textfile in textedit then
changing extension to .pd textedit was somehow messing up the file.
When I used word saved as textfile then change ext to .pd it worked fine. cheers geoff
On 27 Jan 2009, at 17:07, Andy Farnell wrote:
Hi Geoff
What operating system and mail client do you use?
Pd files are text files anyway. They can simply be attched to an email as a something.pd file. When you see that attachment in a message just "save as" something.pd. You can then load it from the file->load menu of Pd GUI.
It's not encouraged to paste patches as text to a mail message body (except for small examples between deveopers) because the text format is not designed as human readable. However, if you do see a Pd patch as plain text any place, just select, copy and paste it to a text editor and then save as something.pd, then you should be able to load it normally.
a.
On Tue, 27 Jan 2009 16:56:53 +0000 Geoff geoffspuredata@googlemail.com wrote:
Hi I have tried to find this in the manual and google searched for a couple of hours but I can;t find it.
How do you put your patches up in text form on this forum?
How do you then load text patches in PD from this forum?
i.e. I have tried things like copying and pasting them into TEXT edit saving, changing the, file extension to a pure data one but no joy.
guidance appreciated as I can't find the answer from googling etc.
cheers geoff
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
-- Use the source
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
Geoff wrote:
Hi I have tried to find this in the manual and google searched for a
couple of hours but I can;t find it.How do you put your patches up in text form on this forum?
How do you then load text patches in PD from this forum?
i.e. I have tried things like copying and pasting them into TEXT edit
saving, changing the, file extension to a pure data one but no joy.guidance appreciated as I can't find the answer from googling etc.
the difference why some patches show up as attachments while others show up as text is (i guess) mainly, because some mail clients attach them as "real" attachments, while others do so as "inline" attachments. some clients may let you chose which kind of attachment you want to use.
and then there is always the question, how a reader's MUA will display these different kinds of attachments...
i guess few people actively make a decision which attachment type they actually send. i don't think it's necessary to spend too much thoughts on that...
fgmasdr IOhannes
On Thu, Jan 22, 2009 at 1:45 PM, Geoff geoffspuredata@googlemail.com wrote:
The DSP book I have read gives a simple lowpass filter function as g(n) = (f(n-1) + f(n) + f(n+1))/3
Have a look at fexpr~. You can write FIR and IIR filters using fexpr~. It should be a good learning tool.
Difference equations like these are nearly trivial--I say nearly becuase you have to note the part that is non-causal above, f(n+1). Make this into a causal filter with 1 additional sample latency. e.g. g(n) = (f(n-2) + f(n-1) + f(n))/3
Chuck
Hallo, Geoff hat gesagt: // Geoff wrote:
The DSP book I have read gives a simple lowpass filter function as
g(n) = (f(n-1) + f(n) + f(n+1))/3
i.e the average value of three consecutive samples. I understand how
this is in effect a lowpass filter.How do I implement that in PD?
A lot of that is explained in Miller's book: http://crca.ucsd.edu/~msp/techniques/latest/book-html/node127.html You better read the previous chapter on Delays first, it contains important info as well.
Generally the basic objects for filter design are [rzero~], [rpole~] and [czero~], [cpole~] and another one is [biquad~].
With the zero/pole objects you directly give the location of poles and zeroes of your filter while the biquad~ is an alternative way to express two zero and two pole objects in one.
I don't know the meaning of the variables in your formula, especially the f(n+1) looks strange: Is this a value of the future or an output value, like the "y" variables in many other filter equations? Anyway you can sum up the current and the previous samples easily with rzero~:
[sig~ 1] | [rzero~ -1] | [snapshot~] | [2 \
For more complex filters check out Miller's book and the examples included in Pd.
I recently also wrote a lot of filter abstractions for the RjDj library: see http://trac.rjdj.me/browser/trunk/rjlib/rj The interesting objects there are e_beequad.pd as a biquad~ clone and these for calculating various coefficients: u_lowpass, u_lowpassq, u_highpass, u_highpassq, ...
e_lop4.pd also is interesting: It's a 4 pole resonant lowpass filter, good for moogish synths, when combined with the bandlimited oscillators of s_osc.pd there. All these filtes use zero/pole objects inside.
RjDj abstractions are for Pd vanilla, so they run everywhere.
Frank Barknecht
Hi
Just wanted to say thanks to everyone for their guidance,
I am on chapter three of Millers wonderful book which I have printed
out.
and am just beginning to try out the all stuff you have suggested.
It will take me a while to get to grips with it as I am an absolute
beginner on both PD and DSP concepts.
Thanks geoff
On 22 Jan 2009, at 23:56, Frank Barknecht wrote:
Hallo, Geoff hat gesagt: // Geoff wrote:
The DSP book I have read gives a simple lowpass filter function as
g(n) = (f(n-1) + f(n) + f(n+1))/3
i.e the average value of three consecutive samples. I understand how this is in effect a lowpass filter.
How do I implement that in PD?
A lot of that is explained in Miller's book: http://crca.ucsd.edu/~msp/techniques/latest/book-html/node127.html You better read the previous chapter on Delays first, it contains important info as well.
Generally the basic objects for filter design are [rzero~],
[rpole~] and [czero~], [cpole~] and another one is [biquad~].With the zero/pole objects you directly give the location of poles and zeroes of your filter while the biquad~ is an alternative way to
express two zero and two pole objects in one.I don't know the meaning of the variables in your formula,
especially the f(n+1) looks strange: Is this a value of the future or an output
value, like the "y" variables in many other filter equations? Anyway you
can sum up the current and the previous samples easily with rzero~:[sig~ 1] | [rzero~ -1] | [snapshot~] | [2 \
For more complex filters check out Miller's book and the examples included in Pd.
I recently also wrote a lot of filter abstractions for the RjDj
library: see http://trac.rjdj.me/browser/trunk/rjlib/rj The interesting objects there are e_beequad.pd as a biquad~ clone and these for calculating various coefficients: u_lowpass, u_lowpassq, u_highpass,
u_highpassq, ...e_lop4.pd also is interesting: It's a 4 pole resonant lowpass filter, good for moogish synths, when combined with the bandlimited
oscillators of s_osc.pd there. All these filtes use zero/pole objects inside.RjDj abstractions are for Pd vanilla, so they run everywhere.
Ciao
Frank Barknecht
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list