[pd] hanning window + fft

Mathieu Bouchard matju at artengine.ca
Thu Sep 7 20:52:54 CEST 2006


On Mon, 4 Sep 2006, Chuckk Hubbard wrote:

> His explanation is more accurate, but confusing nonetheless.  The only 
> time the result isn't zero is if you are multiplying a sine or cosine or 
> a zero-frequency part by itself at the same frequency.

The explanation that works for me is that in the complex plane a sine or 
cosine wave is the average of two points spinning around the origin, one 
counterclockwise (positive speed) and one clockwise (negative speed). When 
multiplying two sines or cosines, you are averaging all products of their 
components, a component being something that travels in a perfect circle 
around the origin. The product of two components is a component and it 
spins at a speed which is the sum of the two speeds.

I believe that some things about waves are easier to understand using 
trajectories in the complex plane than by ordinary graphs of real numbers.

Here's an example of multiplying two cosines algebraically. While you read 
it you may imagine trajectories and average positions and stuff.

cos(at) = (exp(+ait) + exp(-bit))/2
cos(bt) = (exp(+bit) + exp(-bit))/2
cos(at)cos(bt) = (
   exp((+a+b)it) +
   exp((+a-b)it) +
   exp((-a+b)it) +
   exp((-a-b)it)) /4
  = (
   cos((a+b)t) +
   cos((a-b)t)) /2

Then what can make the integral non-zero is that it contains a 
zero-frequency which is because the result contains a frequency a-b but 
a=b.

Another neat trick for visualizing is that the integral is proportional to 
the average position of a point over some time.

  _ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju
| Freelance Digital Arts Engineer, Montréal QC Canada


More information about the Pd-list mailing list