Greetings All
I plan on adding a phase shift to a signal/a wave file I import which is easy enough mathematically example: if the signal is x=sin(2*pi*1*t) to do a phase shift I would just multiply x*e(-i*pi) which would phase shift the signal by 90 degrees.
But how does one multiple signals by complex numbers in PD like -i?
note: there will be a several different phase shifts so a simple hibert transform won't work in this instance thanks --
Hello,
you might want to take a look at the help file for [fft~]
----- "Rick T" ratulloch@gmail.com a écrit :
Greetings All
I plan on adding a phase shift to a signal/a wave file I import which is easy enough mathematically example: if the signal is x=sin(2*pi*1*t) to do a phase shift I would just multiply x*e(-i*pi) which would phase shift the signal by 90 degrees.
But how does one multiple signals by complex numbers in PD like -i?
note: there will be a several different phase shifts so a simple hibert transform won't work in this instance thanks --
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Sun, 11 Sep 2011, Rick T wrote:
I plan on adding a phase shift to a signal/a wave file I import which is easy enough mathematically example: if the signal is x=sin(2*pi*1*t) to do a phase shift I would just multiply x*e(-i*pi) which would phase shift the signal by 90 degrees.
But how does one multiple signals by complex numbers in PD like -i?
A complex signal is a pair of signals. One is labelled «real» and the other is labelled «imaginary».
A common way to think of it, is in 3 dimensions, with a time axis, a real signal axis, and an imaginary signal axis.
Multiplying by a real number means multiplying both signals by the same number.
Multiplying by i means the input real becomes the output imaginary, while the input imaginary is negated and becomes the real output.
Multiplying by i is multiplying by both -1 and i, and you can see that you end up with three [*~ -1], of which two cancel each other, so, you can do it with just one [*~ -1].
[*~ -1] can also be replaced with a [-~] because x*-1 = 0-x.
But the phase shift you are talking about is not the same thing.
Multiplying by i only does a phase shift in the frequency domain, because it turns sin into cos, cos into -sin, -sin into -cos and -cos into sin (it's the same sign business as what i wrote about above). The Fourier cos components are labelled «real» and the Fourier sin components are labelled «imaginary», as in Euler's identity :
exp(a+i*b) = exp(a) * (cos(b)+i*sin(b))
The meaning of real vs imaginary, in the time domain, mostly just means you can process two signals at once. Multiplying a real&imaginary signal by an imaginary gain is a form of stereo mixing thought of in a different way. Generally speaking, complex numbers are a way to unify math concepts so that some things become easier to think about in the long run.
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
On Sun, Sep 11, 2011 at 7:33 PM, Rick T ratulloch@gmail.com wrote:
Greetings All I plan on adding a phase shift to a signal/a wave file I import which is easy enough mathematically example: if the signal is x=sin(2*pi*1*t) to do a phase shift I would just multiply x*e(-i*pi) which would phase shift the signal by 90 degrees. But how does one multiple signals by complex numbers in PD like -i? note: there will be a several different phase shifts so a simple hibert transform won't work in this instance
I guess you already know what this is about then--as Patrice said, you'll have to use fft~ on windows of your signal to accomplish different frequency-specific phase shifts.
The Hilbert transform accomplishes one type of complex signal decomposition that applies to phase shifts by complex number multiple: the complex signal c(t)=x(t) + i * Hx(t)
can be written as magnitude(t) and phase(t)
c(t)=magnitude(t) * e^( i * phase(t))
Then, applying multiple of e^( i * (phase shift) ) just adds the phase shift into this decomposition of the signal. As you said, it applies to not just one frequency, and it also doesn't just shift every phase by the same amount.
Now, notice the hilbert~.pd abstraction---This is a pair of all-pass filters that shifts the signal by approximately 90 degrees at each frequency. You'll have to open it up and analyze it yourself to see if it really does what you want--but it's been shown to be a very practical and reliable way to accomplish phase shifts.
Chuck
On Mon, 12 Sep 2011, Charles Henry wrote:
The Hilbert transform accomplishes one type of complex signal decomposition that applies to phase shifts by complex number multiple: the complex signal c(t)=x(t) + i * Hx(t)
and then [hilbert~] is not a hilbert transform, it makes two different transforms on the same input signal such that one output is almost the Hilbert transform of the other output, but i think I recall that the low frequencies' shift differs significantly from 90⁰. Anyway, [hilbert~] is meant as a thing that can be used to make a Hilbert-like effect while taking just a small fraction of the computing power.
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC