POV-Ray : Newsgroups : povray.off-topic : DFT and FFT Server Time
6 Sep 2024 13:17:19 EDT (-0400)
  DFT and FFT (Message 11 to 20 of 55)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Orchid XP v8
Subject: Re: DFT and FFT
Date: 18 Jan 2009 06:28:09
Message: <49731249@news.povray.org>
>> So, to undo all this, double both signals, multiply one by a sinewave, 
>> then add them back together. Hence, the butterfly.
> 
> I want you to know that's the first explanation of it I've ever been 
> able to follow.

Shamelessly paraphrased from The DSP Guide. ;-) But thank you.

It seems to be that (in general) there are two ways to explain any 
mathematical result:

- As a sequence of mechanical transformations of symbols.
- As a vague but intuitive examination of *why* this (or at least 
something roughly this shape) should work.

Non-mathematicians tend to respond better to the latter, and it's 
terribly hard to glean from the former.

I still vividly remember the day I figured out why that famous formula 
actually solves quadratic equations. Maybe I'll share it with you?

> I'm not a very mathematical person.

...says the guy who actually knows WTF a nondeterministic Turing machine 
*is*! :-P

> You definitely should write some Haskell documentation. :-)

Heh, yeah.

Sadly, before you can document something, you must comprehend it. Also, 
the Haskell library documentation uses literate proramming - i.e., the 
documentation is inside the library source code, so to update it you'd 
have to submit a patch to the library maintainer, yadda yadda yackt...

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Orchid XP v8
Subject: ax^2 + bx + c = 0
Date: 18 Jan 2009 07:00:48
Message: <497319f0$1@news.povray.org>
Orchid XP v8 wrote:

> I still vividly remember the day I figured out why that famous formula 
> actually solves quadratic equations. Maybe I'll share it with you?

OK, so "everybody knows" (?!) that ax^2 + bx + c = 0 can be transformed 
into the magical expression

   x = (-b +/- Sqrt(b^2 - 4ac)) / 2a

But why is that, exactly? Well, looking in my sister's A-level maths 
book [unlike me, my sister was *taught* mathematics] I discover a long 
sequence of algebraic manipulations that slowly transforms the one into 
the other.

Well, that proves it *works*, but *why* does it work??

One day, I figured it out. Watch this:

The (linear) polynomial (x - A) has one solution: A. And the quadratic 
polynomial (x - A)(x - B) has two solutions: A and B. So here we just 
*constructed* a quadratic with *known* solutions!

(This may seem completely unremarkable, but remember I have no 
mathematical training. It seemed pretty impressive to me!)

Now, if we expand that out, we get

   x^2 - Ax - Bx + AB = 0

and with some rearranging,

   x^2 + (-A-B)x + (AB) = 0

If we match that up against

   x^2 + bx + c = 0

then we have

   b = -A-B
   c = AB

Or, put another way, -b = A+B. In other words, if we take

   ax^2 + bx + c = 0

and divide through a, we now know the sum and product of the solutions!

But how do we figure out the solutions themselves given only their sum 
and product?

Well, given that -b = A+B, there are an infinite number of possible 
solutions. Similarly, c = AB on its own has infinitely many solutions. 
Hopefully there is only two solutions to *both* equations. But what are 
they? Hmm.

The next revelation: Since -b = A+B, then -b/2 = (A+B)/2. In other 
words, the arithmetic mean of A and B. So -b/2 is a point exactly half 
way between the two solutions. If I can just figure out how far apart 
they are, I can compute them!

Clearly you can't determine the seperation from the sum. It's not 
obvious that you can determine it from the product either though. But 
that product must come into the equation somehow. Hmm.

Of course, I already know what the final solution is, just not why. That 
gave me a clue.

So what we have is A+B, but what we *want* is A-B. Well now, what 
happens if we square these?

   (A+B)^2 = A^2 + 2AB + B^2
   (A-B)^2 = A^2 - 2AB - B^2   (A mathematician would know this off by 
heart, but it took me a while to work out.)

Ooo, that's *interesting*... The difference between the two is only in 
the product in the middle! And we *have* that product!

 From here, it's just a matter of tying up loose ends. b^2 = (A+B)^2. 
The difference between sum^2 and difference^2 is exactly 4AB, so we have

   (A-B)^2 = (A+B)^2 - 4AB = b^2 - 4c

Since we want to add/subtract half the difference to half the sum, we have

   x = -b/2 +/- Sqrt(b^2 - 4c)/2
     = (-b +/- Sqrt(b^2 - 4c))/2

Ah, but we already eliminated "a", didn't we? Can we put that right back 
into the main formula? Well, comparing with the "standard" formula and 
shifting a little algebra, it becomes clear that we can.

   x = (-b +/- Sqrt(b^2 - 4ac))/2a

QED.

Bouyed up by this, I immediately set about performing the same trick for 
the cubic. Obviously, this did not end well.

However figured out that you can compute the difference from the sum and 
the product... GENIUS!! o_O I would never have known in a million years...

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: DFT and FFT
Date: 18 Jan 2009 14:34:22
Message: <4973843e$1@news.povray.org>
Orchid XP v8 wrote:
> - As a sequence of mechanical transformations of symbols.

That's the "formal" mechanism I was talking about in the programming 
language thread.

> - As a vague but intuitive examination of *why* this (or at least 
> something roughly this shape) should work.

Yeah. Math tends to go for the "do all the gruntwork first, building bottom 
up to the final statement, and finish", usually without explaining why you 
would care about the final statement. :-)

> I still vividly remember the day I figured out why that famous formula 
> actually solves quadratic equations. Maybe I'll share it with you?

Sure.

>> I'm not a very mathematical person.
> 
> ...says the guy who actually knows WTF a nondeterministic Turing machine 
> *is*! :-P

That's pretty trivial mathematics compared to tensor calculus type stuff. 
:-)  I'm not too bad at discrete math.

> documentation is inside the library source code, so to update it you'd 
> have to submit a patch to the library maintainer, yadda yadda yackt...

Write it, patch it, suck out the docs, say "isn't this great? Here's the patch."

-- 
   Darren New, San Diego CA, USA (PST)
   Why is there a chainsaw in DOOM?
   There aren't any trees on Mars.


Post a reply to this message

From: triple r
Subject: Re: DFT and FFT
Date: 18 Jan 2009 14:55:01
Message: <web.4973884992d55383ef2b9ba40@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:

> That's pretty trivial mathematics compared to tensor calculus type stuff.
> :-)  I'm not too bad at discrete math.

Tensor calculus isn't so bad.  Among other things, I gave my nephew my tensor
calculus book this past summer for his baby shower.  Gotta get kids started
early these days, y'know.

 - Ricky


Post a reply to this message

From: Orchid XP v8
Subject: Re: DFT and FFT
Date: 18 Jan 2009 16:49:09
Message: <4973a3d5$1@news.povray.org>
>> That's pretty trivial mathematics compared to tensor calculus type stuff.
>> :-)  I'm not too bad at discrete math.
> 
> Tensor calculus isn't so bad.  Among other things, I gave my nephew my tensor
> calculus book this past summer for his baby shower.  Gotta get kids started
> early these days, y'know.

I still can't figure out what a "tensor" is. :-P

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: andrel
Subject: Re: DFT and FFT
Date: 18 Jan 2009 17:02:40
Message: <4973A768.2060408@hotmail.com>
On 18-Jan-09 22:49, Orchid XP v8 wrote:
>>> That's pretty trivial mathematics compared to tensor calculus type 
>>> stuff.
>>> :-)  I'm not too bad at discrete math.
>>
>> Tensor calculus isn't so bad.  Among other things, I gave my nephew my 
>> tensor
>> calculus book this past summer for his baby shower.  Gotta get kids 
>> started
>> early these days, y'know.
> 
> I still can't figure out what a "tensor" is. :-P
> 
multidimensional vector.


Post a reply to this message

From: triple r
Subject: Re: DFT and FFT
Date: 18 Jan 2009 17:35:00
Message: <web.4973ad9892d55383ef2b9ba40@news.povray.org>
Orchid XP v8 <voi### [at] devnull> wrote:
> I still can't figure out what a "tensor" is. :-P

scalar = tensor of rank 0
vector = tensor of rank 1

For example, the stress tensor is a rank 2 tensor since you quantify stress in a
plane and thus need two indices to describe which plane you're talking about.
So the (1,3) element if you wrote it as a matrix would correspond to stress in
the x-z plane.  This makes for 9 elements total.  Now if we're talking
relativity and such, it gets a little more complex.  But I guess you already
looked it up on Wikipedia, so I don't know what I'm rambling on about.

 - Ricky


Post a reply to this message

From: nemesis
Subject: Re: DFT and FFT
Date: 18 Jan 2009 18:15:00
Message: <web.4973b72c92d5538357817c010@news.povray.org>
Orchid XP v8 <voi### [at] devnull> wrote:
> >> That's pretty trivial mathematics compared to tensor calculus type stuff.
> >> :-)  I'm not too bad at discrete math.
> >
> > Tensor calculus isn't so bad.  Among other things, I gave my nephew my tensor
> > calculus book this past summer for his baby shower.  Gotta get kids started
> > early these days, y'know.
>
> I still can't figure out what a "tensor" is. :-P
>
> --
> http://blog.orphi.me.uk/
> http://www.zazzle.com/MathematicalOrchid*

meh, from the title thought you were talking about Final Fantasy Tactics and
perhaps some sequel... :)


Post a reply to this message

From: Darren New
Subject: Re: ax^2 + bx + c = 0
Date: 19 Jan 2009 00:07:14
Message: <49740a82@news.povray.org>
Orchid XP v8 wrote:
> However figured out that you can compute the difference from the sum and 
> the product... GENIUS!! o_O I would never have known in a million years...

Very cool. :-)

-- 
   Darren New, San Diego CA, USA (PST)
   Why is there a chainsaw in DOOM?
   There aren't any trees on Mars.


Post a reply to this message

From: scott
Subject: Re: ax^2 + bx + c = 0
Date: 19 Jan 2009 07:17:30
Message: <49746f5a@news.povray.org>
> OK, so "everybody knows" (?!) that ax^2 + bx + c = 0 can be transformed 
> into the magical expression
>
>   x = (-b +/- Sqrt(b^2 - 4ac)) / 2a
>
> But why is that, exactly? Well, looking in my sister's A-level maths book 
> [unlike me, my sister was *taught* mathematics] I discover a long sequence 
> of algebraic manipulations that slowly transforms the one into the other.

It's not that hard or long, just involves dividing by a, completing the 
square for the first two terms, rearranging, taking the square root, and 
rearranging again for x.

But I imagine the cubic is a lot harder.


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.