The [dirac~] object generates a unit impulse (at the sample position given by its input)
I'm trying to think of simple ways to do it in plain vanilla. Frank gave a one way before, differentiating a step impulse with [rzero~], can anyone think of other ways (I'm sure there's more than one)
cheers,
Andy
# Hi Andy, # There is a abstraction "citpit" I made in the attachment to produce glitch sounds. ("cit" and "pit" is the sound of glitch in Turkish :) ) It's an audio object which outputs 0 all the time. But when you bang it, it outputs 1's for N samples long. It gives a barrier function. # When you let N=1 by putting 1 to its second inlet, it becames a dirac function. (Err... Not dirac but Kronecker Delta really, Dirac gives not 1 but infinity) # Hope this helps... -uğur-
On Nov 16, 2007 11:23 PM, Andy Farnell padawan12@obiwannabe.co.uk wrote:
The [dirac~] object generates a unit impulse (at the sample position given by its input)
I'm trying to think of simple ways to do it in plain vanilla. Frank gave a one way before, differentiating a step impulse with [rzero~], can anyone think of other ways (I'm sure there's more than one)
cheers,
Andy
-- Use the source
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Okay, a sample delay and [vline~] , that's one very good way, thanks a lot. I like the abs name too.
Any others? Must be vanilla only so you can't use [z]
all best,
Andy
On Fri, 16 Nov 2007 12:35:50 +0200 "U__ur Güney" ugurguney@gmail.com wrote:
# Hi Andy, # There is a abstraction "citpit" I made in the attachment to produce glitch sounds. ("cit" and "pit" is the sound of glitch in Turkish :) ) It's an audio object which outputs 0 all the time. But when you bang it, it outputs 1's for N samples long. It gives a barrier function. # When you let N=1 by putting 1 to its second inlet, it becames a dirac function. (Err... Not dirac but Kronecker Delta really, Dirac gives not 1 but infinity) # Hope this helps... -u__ur-
On Nov 16, 2007 11:23 PM, Andy Farnell padawan12@obiwannabe.co.uk wrote:
The [dirac~] object generates a unit impulse (at the sample position given by its input)
I'm trying to think of simple ways to do it in plain vanilla. Frank gave a one way before, differentiating a step impulse with [rzero~], can anyone think of other ways (I'm sure there's more than one)
cheers,
Andy
-- Use the source
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
there is actually no need at all for doing a samplewise delay with [z~], since you can schedule everything (also the startpoint) with [vline~]. you really only need a [vline~]. i just haven't time to make an example patch, but i can make one in a few hours, if there is still need for it.
roman
On Sat, 2007-11-17 at 04:54 +0000, Andy Farnell wrote:
Okay, a sample delay and [vline~] , that's one very good way, thanks a lot. I like the abs name too.
Any others? Must be vanilla only so you can't use [z]
all best,
Andy
On Fri, 16 Nov 2007 12:35:50 +0200 "U__ur GÃŒney" ugurguney@gmail.com wrote:
# Hi Andy, # There is a abstraction "citpit" I made in the attachment to produce glitch sounds. ("cit" and "pit" is the sound of glitch in Turkish :) ) It's an audio object which outputs 0 all the time. But when you bang it, it outputs 1's for N samples long. It gives a barrier function. # When you let N=1 by putting 1 to its second inlet, it becames a dirac function. (Err... Not dirac but Kronecker Delta really, Dirac gives not 1 but infinity) # Hope this helps... -u__ur-
On Nov 16, 2007 11:23 PM, Andy Farnell padawan12@obiwannabe.co.uk wrote:
The [dirac~] object generates a unit impulse (at the sample position given by its input)
I'm trying to think of simple ways to do it in plain vanilla. Frank gave a one way before, differentiating a step impulse with [rzero~], can anyone think of other ways (I'm sure there's more than one)
cheers,
Andy
-- Use the source
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
___________________________________________________________ Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
Hallo, Andy Farnell hat gesagt: // Andy Farnell wrote:
Okay, a sample delay and [vline~] , that's one very good way, thanks a lot. I like the abs name too.
Any others? Must be vanilla only so you can't use [z]
Attached is another one. The idea is to play a [table] with an impulse stored. Use [tabread~] not [tabread4~] to avoid interpolation..
Frank Barknecht _ ______footils.org__
Nice one.
Okay, one for the mathematicians, as Ugur mentioned the proper name this is Kronecker Delta. Is it correct to say that the Dirac impulse preserves energy, as it tends towards zero time length the amplitude goes to infinity and if we squashed its amplitude to zero it would be infinitely long? In which case Dirac impulses are theoretical and not practical digital signals?
cheers,
Andy
On Fri, 16 Nov 2007 19:12:55 +0100 Frank Barknecht fbar@footils.org wrote:
Hallo, Andy Farnell hat gesagt: // Andy Farnell wrote:
Okay, a sample delay and [vline~] , that's one very good way, thanks a lot. I like the abs name too.
Any others? Must be vanilla only so you can't use [z]
Attached is another one. The idea is to play a [table] with an impulse stored. Use [tabread~] not [tabread4~] to avoid interpolation..
Ciao
Frank Barknecht _ ______footils.org__
Quoting Andy Farnell padawan12@obiwannabe.co.uk:
In which case Dirac impulses are theoretical and not practical digital signals?
dirac impulses are _theoretical_ _analog_ signals.
fmgasd. IOhannes
This message was sent using IMP, the Internet Messaging Program.
On Fri, 16 Nov 2007, zmoelnig@iem.at wrote:
Quoting Andy Farnell padawan12@obiwannabe.co.uk:
In which case Dirac impulses are theoretical and not practical digital signals?
dirac impulses are _theoretical_ _analog_ signals.
And yet, if you discretise them using Fourier theory, using sampling as a sharp cut-off frequency, with a finite block size, they become quite normal signals, with finite energy. For each block size there is a different spectrum which is just a continuation of the spectrum of any Dirac impulse with a smaller block size. I think that this is a fair enough version of Dirac in the discrete domain. (see my previous mail in this thread for more details)
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada
# What is preserved is the area under the function, it is equal to one (its just 1, with no physical dimensions like energy. So, if x axis has the dimensions of L(ength), y-axis has the dimension of 1/L). When you let the bottom side's length of a triangle shaped function to go to zero, for preserving its area, its height goes to infinity. Dirac Delta Function is defined as this limiting case, other limiting case where the height goes to zero and so length goes to infinity is unrelated to Dirac Delta Function. (actually it is not a function, but a distribution. :-) Its behavoir is very pathologic for a function. Distributions are more general.) # The idea behind all of this cumbersome things become useful when you multiply a function with Dirac Delta and take the integral:
integral{f(t)*delta(t-a)*dt} = f(a)
# So, Delta function takes a sample (a snapshot) from the function at time a. # It can be used as a mathematical approximations of some real signals (there can't be any physical quantity of which amplitude is infinity) or a tool for solving problems. -uğur-
On Nov 17, 2007 11:01 AM, Andy Farnell padawan12@obiwannabe.co.uk wrote:
Is it correct to say that the Dirac impulse preserves energy, as it tends towards zero time length the amplitude goes to infinity and if we squashed its amplitude to zero it would be infinitely long? In which case Dirac impulses are theoretical and not practical digital signals?
Personally, I like to use the sinc/rectangular impulse functions to define the dirac delta, because it has a handy symmetry with fourier analysis.
our rectangular function, in the time domain is g(t)={1/(2T) , -T<t<T 0 , elswhere which has fourier transform, G(f)=sinc(f*T)
in the lim T->0 g(t)->dirac(t) and lim T->0 G(f)=lim T->0 sinc(f*T) -> 1 for all f
likewise for h(t)=fs*sinc(fs*t) H(f)={ 1, -fs/2 < f < fs/2 0, elsewhere
and in the lim fs->infinity g(t)->dirac(t) G(f)-> 1 for all f
Chuck
On Nov 16, 2007 6:03 PM, Uğur Güney ugurguney@gmail.com wrote:
# What is preserved is the area under the function, it is equal to one (its just 1, with no physical dimensions like energy. So, if x axis has the dimensions of L(ength), y-axis has the dimension of 1/L). When you let the bottom side's length of a triangle shaped function to go to zero, for preserving its area, its height goes to infinity. Dirac Delta Function is defined as this limiting case, other limiting case where the height goes to zero and so length goes to infinity is unrelated to Dirac Delta Function. (actually it is not a function, but a distribution. :-) Its behavoir is very pathologic for a function. Distributions are more general.) # The idea behind all of this cumbersome things become useful when you multiply a function with Dirac Delta and take the integral:
integral{f(t)*delta(t-a)*dt} = f(a)
# So, Delta function takes a sample (a snapshot) from the function at time a. # It can be used as a mathematical approximations of some real signals (there can't be any physical quantity of which amplitude is infinity) or a tool for solving problems. -uğur-
On Nov 17, 2007 11:01 AM, Andy Farnell padawan12@obiwannabe.co.uk wrote:
Is it correct to say that the Dirac impulse preserves energy, as it tends towards zero time length the amplitude goes to
infinity and if we
squashed its amplitude to zero it would be infinitely long? In which case
Dirac impulses
are theoretical and not practical digital signals?
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Sat, 17 Nov 2007, Uur Güney wrote:
When you let the bottom side's length of a triangle shaped function to go to zero, for preserving its area, its height goes to infinity. Dirac Delta Function is defined as this limiting case,
It can also be defined using any of a variety of functions of various shapes. You could do it by making a sequence of Gaussian distributions whose variances converge to zero, for example.
(actually it is not a function, but a distribution. :-) Its behavoir is very pathologic for a function. Distributions are more general.)
Yeah, you can actually write it as being the derivative of the step function, but you can't compute that derivative, as long as you need to stick with continuous functions, so you have to get rid of it algebraically, with some identities that make the nonsensical computations disappear.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada
On Sat, 17 Nov 2007, Andy Farnell wrote:
Okay, one for the mathematicians, as Ugur mentioned the proper name this is Kronecker Delta.
a Dirac impulse and Kronecker Delta are not the same thing. Kronecker Delta is a function of two variables, which is the indicatrix of equality: for example, [==] is the Kronecker Delta, as it gives 1 when two inputs are equal, and 0 when they aren't. (See below for the link between Dirac and Kronecker)
a Dirac impulse is defined as something whose ordinary integral is 1, but which is zero everywhere except at point zero. This makes it impossible as an ordinary real function, so over a real domain it has to be defined as a special operator that pretends to be a function. Over a discrete domain you will approximate it using a spike, but the spike will not be of height 1 unless you consider 1 sample to be the unit of the time axis. If you count 1 second = 44100 samples as being the unit, then you have to make a spike of 44100 high, so that when multiplied with 1/44100 duration it gives an integral of 1.
Is it correct to say that the Dirac impulse preserves energy, as it tends towards zero time length the amplitude goes to infinity and if we squashed its amplitude to zero it would be infinitely long?
I don't understand what this means. A signal does not "preserve" anything. An operator may preserve a property, and a two-input operator may preserve a property if it has a particular input on the left or right side. But what is it that you mean?
In which case Dirac impulses are theoretical and not practical digital signals?
It's possible that you have a continuous ("real") version of the Dirac impulse, which is only theoretical, but if you make an extended definition that is both compatible with the original continuous definition and with discrete domains, then the discrete version will be an ordinary function (a true digital signal) whereas the continuous version cannot be an ordinary function.
You could think of the Dirac impulse as being the identity element of the convolution operator, or as being the limit of impulses of integral 1 where the width is reduced as close as possible to 0. With continuous functions there is no "closest possible" so you get a freaky result, but for continuous functions you get something which is a particular special case of Kronecker Delta (with $2 = the time of the impulse) times a compensation constant.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada
with [vilne~] you can generate whatever signal you like. you probably need to take the current [samplerate~] into account in order to correctly imitate [dirac~] from zexy, since [vline~] measures in ms and your desired signal is based on samples.
roman
On Fri, 2007-11-16 at 21:23 +0000, Andy Farnell wrote:
The [dirac~] object generates a unit impulse (at the sample position given by its input)
I'm trying to think of simple ways to do it in plain vanilla. Frank gave a one way before, differentiating a step impulse with [rzero~], can anyone think of other ways (I'm sure there's more than one)
cheers,
Andy
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
Andy Farnell skrev:
The [dirac~] object generates a unit impulse (at the sample position given by its input)
I'm trying to think of simple ways to do it in plain vanilla. Frank gave a one way before, differentiating a step impulse with [rzero~], can anyone think of other ways (I'm sure there's more than one)
cheers,
Andy
I end up doing something like this. just add convolution mvhStef
#N canvas 229 64 494 513 12; #X obj 131 202 tabplay~ dirac; #X obj 126 30 table dirac 64; #X msg 144 139 ; dirac const 0 , $1 1; #X floatatom 131 85 5 0 64 0 - - -; #N canvas 0 0 450 300 (subpatch) 0; #X array vu 64 float 0; #X coords 0 1 63 -1 200 140 1; #X restore 129 305 graph; #X obj 131 175 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 107 231 tabwrite~ vu; #X connect 0 0 6 0; #X connect 3 0 2 0; #X connect 3 0 5 0; #X connect 5 0 0 0; #X connect 5 0 6 0;
hi again..
ok.. now i also had to do my version of it..... :-) you'll find it in the attachment.
a few notes on the collection: the one that i saw from uğur güney [ciprit] works only as expected at a fixed samplingrate (44100). steffens proposal is behaves exactly as the original [dirac~], as far as i can see it, whereas frank's approach [vimpulse~] does the time-to-sample conversion automatically, which is, i think, probably rather the behaviour, that someone usually wants. the helpfile states, that [vimpulse~] is subsample accurate. as far as i can see, this is wrong (it is only sample accurate) and also not a behaviour that someone would want. if it would be truely subsample accurate, then most of the time the dirac impulse would need to be interpolated and composed of two subsequent samples (which would it turn unusuable for many applications). my attached version behaves similar to franks version, but instead of writing first the signal into a table, it uses directly [vline~] to create the impulse.
On Sun, 2007-11-18 at 00:38 +0100, Steffen Leve Poulsen wrote:
Andy Farnell skrev:
The [dirac~] object generates a unit impulse (at the sample position given by its input)
I'm trying to think of simple ways to do it in plain vanilla. Frank gave a one way before, differentiating a step impulse with [rzero~], can anyone think of other ways (I'm sure there's more than one)
i missed this one and i also didn't quite get how it works. can someone send me this one?
roman