Fwd: [PD] basic DSP stuff
czhenry at gmail.com
Sat Nov 12 22:36:12 CET 2005
I apologize to chuckk, for not sending these posts to the right place.
About frequency analysis......
It gets hard to explain how we use complex numbers in frequency
analysis without going to higher mathematics. Simply shifting the
signal by a constant does not get rid of complex numbers! The complex
numbers do not necessarily come from "conservation of energy": the
complex numbers are the eigenvalues of your basic oscillator x'' + w^2
* x = 0
w is the angular frequency of oscillation, and the eigen values of the
solution are i*w and -i*w
(the eigenfunctions of this equation are e^iwx and e^-iwx, there is
another type (the damped harmonic oscillator, which has complex rather
than imaginary eigenvalues))
When we perform frequency analysis we partition up the energy in the
signal into waves (with very specific phases), with distinct
eigenvalues (the frequencies). The energy is directly related to the
square of the magnitude of each coefficient, and the square of w.
Shifting by a constant only adds more energy to the "constant" signal (w=0).
The Fourier transform is at the heart of DSP for a specific reason. Any signal
can be *exactly* represented through a change of basis (change of
basis here means a transformation from one set of numbers to another
through a one-to-one function that preserves energy (the metric))
R= set of real numbers
C= set of complex numbers
R2= a two-dimensional set of real numbers
Everybody knows what R2 is, the x-y plane, so it's a good starting
point. A distance between the origin and (x,y) is sqrt(x^2 + y^2).
This is called a metric, a measure of distance.
Okay, so suppose we have sqrt(x) where x is R. (I'll use "is" to
denote "belongs to")
For each x in R, we get back a number, which means it belongs to a "set."
sqrt(x) is (0,inf), when x is (0,inf) , I'll abbrev. inf for infinity
The result which produces the complex numbers is analytic
continuation. When x is R, the result may or may not belong to R, but
is definitely a number. When x is negative, we have a sqrt(negative
number in R), which is defined as an imaginary number (just a name,
still a number).
again, analytic continuation:
So, then we can have the sqrt(x) when x is imaginary! And the result
is a number halfway inbetween the imaginary numbers and R. It is not
one or the other!!! If you work this out, you can show, simply by
definitions, that it is the sum of an imaginary number and a real
number. Therefore, we can define the complex numbers as the sum of
real and imaginary numbers.
R2 is a 2-dimensional vector space, meaning that it takes two linearly
independent (not the same line) vectors to span the entire space with
linear combinations a*w+b*z, where w and z are vectors. Now, to make
things useful, we define an inner product on R2,
the metric, or norm, is sqrt(<w,w>) = sqrt(a^2 + b^2)
A very similar thing happens when we define an inner product and a metric on C
for A and B in C, <A,B>=A*(conj(B)) (conj(B) stands for conjugate of B)
and the norm, or metric, is |A| = sqrt( <A, conj(A)> )
|A| = sqrt( A1^2 - i^2 * A2^2)=sqrt( A1^2 + A2^2)
meaning the definition of a metric space on C is isometric (has the
same norm) as the metric space defined on R2. Notice that the two
spaces have different inner products, but the same norm?
In R2, the inner product of two vectors (w,x) and (y,z) is
<(w,x),(y,z)>= w*y + x*z
In C, the inner product of w+ix and y+iz is
<w+ix,y+iz>= (w+ix)*(y-iz) = (w*y + x*z) + i*(x*y - w*z)
The difference between the two is:
Over the set of R2, we can have perpedicular vectors which cover the
space, but in C, none of the vectors are "orthogonal" to one another
unless one of them is identically zero. (This result is not very
interesting I think, but it includes why the product of two complex
numbers is a "rotation").
The *real* result that we want comes from the analytic continuation of
e^x, where x is R.
e^x : x |-> (0,inf) when x is R
e^x : x |-> C when x is C
Also, many important properties are present:
z=e^x, then conj(z)=e^conj(x), for x is C
cosh(x)=(e^x + e^-x)/2
cosh(ix)=cos(x) and cos(ix)=cosh(x) for x is R
e^ix = cos(x) + i*sin(x), for x is R
So, any number in R can be represented by e^x when x is C, and any
sinusoid with any phase shift can be represented by a sum of z*e^ix +
To show why a signal can be exactly represented by its transform is
even more tricky, and requires the definition of Hilbert spaces, the
set of continuous functions C0, the polynomials, trigonometric
identities on cos(n*x), and the Lebesgue integral.....I don't want to
go through all the details, right now. It really is a *long*
The result is:
The Fourier transform is an isometry (metric preserving transform)
between C^N (N complex numbers in a vector space) and C^N, where the
coefficients of the transform are the relative phases of e^inx terms.
The real numbers are a special case, where the first N/2 coefficents
in C^N represent the phases and amplitudes, and the other ones are
just complex conjugates of the first N/2.
When you analyze a signal (real-valued), the complex numbers don't
exist as parts of the signal or placeholders for missing energy! They
are only indicators of phases of sinusoids in the frequency domain.
The real place where complex values are: the eigenvalues of harmonic
Charles Zachary Henry
Med student who needs a Mickey's
More information about the Pd-list