On 6/20/06, Piotr Majdak piotr@majdak.com wrote:
Chuckk Hubbard wrote:
On 6/20/06, Chuckk Hubbard badmuthahubbard@gmail.com wrote:
On 6/20/06, Piotr Majdak piotr@majdak.com wrote:
Another question: if I just ran rfft~ on a signal, and then ran ifft~ on the transform, would that create the same signal as a complex signal?
Using [rfft~] you can process real signals only...
I meant like: [readsf~] (for instance) | [rfft~] | | [ifft~] [num\ [num
| | | | [czero~] | [dac~]I suppose I could just try it and see if it works...
You transform the signal from [readsf~] to the frequency domain (it's complex now), then transform it back to the time domain (now it's real again and identical to the signal from [readsf~]). Why do you do that?
The inverse transform is complex, from a real forward transform. I'm just trying to find out what the imaginary part should be.
According to the help patch, [czero~] does: y[n] = x[n] - a[n] * x[n-1]. To get a consistent filtering with [czero~] the imaginary part of the result should be zero (the real part can be the input for [dac~], as you did it), which means, that a[n] must be conj(x[n]), or in this case the imag(a)=0. Of course, you can use a chain of [czero~]s, where the intermediate results are complex. However, after the last [czero~], the result should be real.
To play with [czero~], try the [pd test] subpatch in the help file of [czero~].
If I understand you correctly, this is similar to what Miller's book talks about. Pairing every complex filter with another with the conjugate of its coefficient, so that the real signal can be treated as the sum of two complex signals which are conjugates of each other. Hallelujah, I just made it work. Not so hard. Far easier than trying to make a real signal complex.
It doesn't. Nor does: [osc~] | [rfft~] [sig~ 0] | | [ifft~]
Can you tell me, what are you trying to do? You know, this patch works (no errors), but I don't know how to interpret the resulting signals...
Writing the original signal and the real and imaginary parts of the output to graphs shows lots of alterations. It is fine with a block containing an integer number of cycles, but otherwise gets weird results. See attached.
-Chuckk