POV-Ray : Newsgroups : povray.binaries.images : Guess what .... Server Time
15 Oct 2024 17:13:35 EDT (-0400)
  Guess what .... (Message 1 to 6 of 6)  
From: ingo
Subject: Guess what ....
Date: 1 Jul 2022 02:55:00
Message: <web.62be9924cee0225717bac71e8ffb8ce3@news.povray.org>
it was a struggle, but the basics work now.


Post a reply to this message


Attachments:
Download 'clipboard01.jpg' (170 KB)

Preview of image 'clipboard01.jpg'
clipboard01.jpg


 

From: Tor Olav Kristensen
Subject: Re: Guess what ....
Date: 1 Jul 2022 04:15:00
Message: <web.62beacd6f6159f18acf8b7ce89db30a9@news.povray.org>
"ingo" <nomail@nomail> wrote:
> it was a struggle, but the basics work now.

Hi Ingo

I guess that you are doing Fast Fourier Transform and Inverse Fast Fourier
Transform in POV-Ray SDL. That's interesting.

What will you use it for ?


Here's a little suggestion:

You can replace this:

    #if (BinPower[i] > Pmax)
        #declare Pmax = BinPower[i];
    #end

- with this:

    #declare Pmax = max(BinPower[i], Pmax);

--
Tor Olav
http://subcube.com
https://github.com/t-o-k


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Guess what ....
Date: 1 Jul 2022 04:35:00
Message: <web.62beb0ddf6159f18acf8b7ce89db30a9@news.povray.org>
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
>...


You may also replace this:


#declare Pmax = -999;

#for (i, 0, Samples-1)


- with this:


#declare BinPower[0] = Cabs2(data[0]);
#declare Pmax = BinPower[0];

#for (i, 1, Samples-1)


--
Tor Olav
http://subcube.com
https://github.com/t-o-k


Post a reply to this message

From: ingo
Subject: Re: Guess what ....
Date: 1 Jul 2022 04:50:54
Message: <XnsAEC76E59212C3seed7@news.povray.org>
in news:web.62beacd6f6159f18acf8b7ce89db30a9@news.povray.org Tor Olav 
Kristensen wrote:

> What will you use it for ?
> 

The reason to get a go at it is speeding up audio synthesis: 
https://ingoogni.nl/povray/sounds-of-povray/povray-ans/

Also for audio synthesis, faster convolution(filters). A long way to go 
still.

Once 1D is running 2D is just doing it once for rows and then columns over 
te result. Again convolution comes to mind. I remember you doing that with 
functions? Here also the basics work, Input FFT -> IFFT results in an 
output == input.

What I'm using is the Stockham algorithm as shown at 
http://wwwa.pikara.ne.jp/okojisan/otfft-en/stockham2.html

As some complex number stuff is needed I also made a complex.inc. I used 
2d vectors for the numbers <real, im>.

I uploded the inc's to bin.scenefiles 

<web.62beb5288957c93017bac71e8ffb8ce3@news.povray.org>

Ingo

-- 
https://ingoogni.nl


Post a reply to this message

From: Bald Eagle
Subject: Re: Guess what ....
Date: 1 Jul 2022 07:20:00
Message: <web.62bed773f6159f181f9dae3025979125@news.povray.org>
"ingo" <nomail@nomail> wrote:
> it was a struggle, but the basics work now.

I had a go at this in 2017:

https://news.povray.org/povray.binaries.images/thread/%3Cweb.58b816d4bb134ad1c437ac910@news.povray.org%3E/

also in 2D:

https://news.povray.org/povray.binaries.images/thread/%3Cweb.58bd5ea376ca50b7c437ac910@news.povray.org%3E/

For image processing, I guess there's a little more to be done that just columns
and rows.   Some kind of +/- grid or something to shift everything and "get the
data centered".  Sorry -it's early, that was a while ago, and I forget the
specific terms and techniques.

Looking good so far - hope you manage to crank out the 2D version as well!

- Bill


Post a reply to this message

From: ingo
Subject: Re: Guess what ....
Date: 1 Jul 2022 08:31:03
Message: <XnsAEC793AD279E4seed7@news.povray.org>
in news:web.62bed773f6159f181f9dae3025979125@news.povray.org Bald Eagle
wrote: 

Bill, I remember your postings.


> For image processing, I guess there's a little more to be done that
> just columns and rows.   Some kind of +/- grid or something to shift
> everything and "get the data centered".

Just having a working FFT isn't enough. 

To make good use of it more is needed. For 2D, indeed, shifting the 
quadrants to get the corners in the centre is one of them. It gives 
'crisper' results in the image.

Proper automatic zero padding is another one.

Many of this "tooling" I have in snippets in other languages. Slowly 
putting it all together, while preventing a melting brain.

ingo

-- 
https://ingoogni.nl


Post a reply to this message

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