I think the standard way of convolution - or at least the one I use - which gives ok results, is to have one 'carrier' signal, which is filtered by the 'modulator' signal. (I think that's what they're called.) Basically, first get the magnitude of the modulator: sqrt(real^2 + imag^2). Then:
output real = carrier real * modulator magnitude output imag = carrier imag * modulator magnitude
The outputs go into a [rifft~].
Remember, both carrier and modulator must be windowed first, e.g. with hanning, and you must overlap-and-add by a factor of 4. Good block sizes are around 4096, e.g. [block~ 4096 4].
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com
Stefan Turner wrote:
sqrt(real^2 + imag^2). Then:
output real = carrier real * modulator magnitude output imag = carrier imag * modulator magnitude
The outputs go into a [rifft~].
This sounds like just using the magnitude of one signals frequency bins to amplitude-modulate a second signals frequency bins. I thought convolution actually affected the frequencies in a slightly different way. Or rather convolution was multiplying the frequancy magnitudes but also multiplying the two frequency values as well.
e.g. [block~ 4096 4].
I know you can use block~ to change sample block size, but I have never seen the second argument. What does this second argument do (its not in the pd help)?
Thanks, -thewade
Or rather convolution was multiplying the
frequancy magnitudes but also multiplying the two frequency values as well.
Convolution is multiplication in the frequency domain. This free guide is quite good for explaining this and more: http://www.dspguide.com/
I know you can use block~ to change sample block size, but I have never seen the second argument. What does this second argument do (its not in the pd help)?
"The block~ and switch~ objects set the block size, overlap, and up/down-sampling ratio for the window. (The overlap and resampling ratio are relative to the super-patch.)" From the, er, help :) Using 4, as in this example, means the patch will calculate four different blocks in the time it would normally only calculate one block, with the time each starts being spread out equally, and the output of each outlet~ being the four blocks added together. I think it is designed especially for FFT stuff.
___________________________________________________________ Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com
Stefan Turner wrote:
Or rather convolution was multiplying the
frequancy magnitudes but also multiplying the two frequency values as well.
Convolution is multiplication in the frequency domain. This free guide is quite good for explaining this and more: http://www.dspguide.com/
I have the Roads Computer Music Tutorial ( http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&tid=8218 ). It is pritty good about a lot of topics, and it does describe convolution as multiplication in the frequency domain, but I guess I intrepreted that to mean more then just frequency. For example in the xy plane if you add two vectors you don't neccessarily just get a y value back. Multiplication in the frequency domain involves frequency magnitude, but also frequency phase and frequency value. It seems to me that frequency space is 3D where as time space is 2D also. I guess what you are saying is that convolution is just amplitude modulation of two signals frequency values, right? Mag1(freq)=Mag1(freq)*Mag2(freq) - Phi1(freq)=Phi1(freq) I thought it was more (F1,M1,P1)*(F2,M2,P2) like vectors.
(Georg, I would still like to figure out frequency - perhaps I could just use the bin number / block size * sampleing rate, or would this loose resolution?)
I know you can use block~ to change sample block size, but I have never seen the second argument. What does this second argument do (its not in the pd help)?
"The block~ and switch~ objects set the block size, overlap, and up/down-sampling ratio for the window. (The overlap and resampling ratio are relative to the super-patch.)" From the, er, help :)
The help just describes the second parameter as overlap, which I might misunderstand to mean calculating one sample block in half the time for a value of two, and then adding them back togeather with that offset. e.g. (blocksize of 4) 0125 --2452 current block: = 0149 Which doesnt make much sense to me. What I understand you to be saying is that a value of two is: 0125 ----2452 current block: 2577
Is this some way of getting better frequency resolution - more samples in the same ammount of time? If you just had an [inlet~] connected to an [outlet~] with a [block~ 64 4] how would you signal be changed (in the time domain)? Would it have a gain of 4x?
Thank you for being patient with this newbie, -thewade
On Tue, 29 Nov 2005, Stefan Turner wrote:
I think the standard way of convolution - or at least the one I use - which gives ok results, is to have one 'carrier' signal, which is filtered by the 'modulator' signal. (I think that's what they're called.) Basically, first get the magnitude of the modulator: sqrt(real^2 + imag^2). Then: output real = carrier real * modulator magnitude output imag = carrier imag * modulator magnitude
This is not a plain convolution by the modulator signal, though it's close. It's a convolution by the phase-removed modulator signal, because all phase information is removed. A general convolution allows for phase shifts. For example, taking the derivative of a signal using [rzero~] (where dt = 1 sample duration) you get an approximately 90-degree phase advance (in addition to getting incredible trebles-boosting). A derivative performed numerically is a kind of convolution (used extensively in GridFlow in order to e.g. fake reflections and refractions on water).
A general convolution uses complex multiplications, one of which requires four real multiplications in cartesian repr, one real multiplication in polar repr, and no multiplication in log repr.
Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju Freelance Digital Arts Engineer, Montréal QC Canada
--- Mathieu Bouchard matju@artengine.ca wrote:
On Tue, 29 Nov 2005, Stefan Turner wrote:
I think the standard way of convolution - or at
least the one I use -
which gives ok results, is to have one 'carrier'
signal, which is
filtered by the 'modulator' signal. (I think
that's what they're
called.) Basically, first get the magnitude of the
modulator:
sqrt(real^2 + imag^2). Then: output real = carrier real * modulator magnitude output imag = carrier imag * modulator magnitude
This is not a plain convolution by the modulator signal, though it's close. It's a convolution by the phase-removed modulator signal, because all phase information is removed. A general convolution allows for phase shifts.
<snip> > A general convolution uses complex multiplications, > one of which requires > four real multiplications in cartesian repr, one > real multiplication in > polar repr, and no multiplication in log repr.
Yes, thanks for pointing this out. Apologies for this. I have since posted the correct equations, for cartesian.
Stefan Turner
___________________________________________________________ Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com