POV-Ray : Newsgroups : povray.binaries.images : Guess what .... Server Time26 Sep 2023 01:50:20 EDT (-0400)
 Guess what .... (Message 1 to 6 of 6)
 From: ingo Subject: Guess what .... Date: 1 Jul 2022 02:55:00 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.62be9924cee0225717bac71e8ffb8ce3%40news.povray.org",
"headline": "Guess what ....",
"dateCreated": "2022-07-01T06:55:00+00:00",
"datePublished": "2022-07-01T06:55:00+00:00",
"author": {
"@type": "Person",
"name": "ingo"
}
}
it was a struggle, but the basics work now.
```

Attachments:

Preview of image 'clipboard01.jpg'

 From: Tor Olav Kristensen Subject: Re: Guess what .... Date: 1 Jul 2022 04:15:00 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.62beacd6f6159f18acf8b7ce89db30a9%40news.povray.org",
"headline": "Re: Guess what ....",
"dateCreated": "2022-07-01T08:15:00+00:00",
"datePublished": "2022-07-01T08:15:00+00:00",
"author": {
"@type": "Person",
"name": "Tor Olav Kristensen"
}
}
"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
```
 From: Tor Olav Kristensen Subject: Re: Guess what .... Date: 1 Jul 2022 04:35:00 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.62beb0ddf6159f18acf8b7ce89db30a9%40news.povray.org",
"headline": "Re: Guess what ....",
"dateCreated": "2022-07-01T08:35:00+00:00",
"datePublished": "2022-07-01T08:35:00+00:00",
"author": {
"@type": "Person",
"name": "Tor Olav Kristensen"
}
}
"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
```
 From: ingo Subject: Re: Guess what .... Date: 1 Jul 2022 04:50:54 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#XnsAEC76E59212C3seed7%40news.povray.org",
"headline": "Re: Guess what ....",
"dateCreated": "2022-07-01T08:50:54+00:00",
"datePublished": "2022-07-01T08:50:54+00:00",
"author": {
"@type": "Person",
"name": "ingo"
}
}
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
```
 From: Bald Eagle Subject: Re: Guess what .... Date: 1 Jul 2022 07:20:00 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.62bed773f6159f181f9dae3025979125%40news.povray.org",
"headline": "Re: Guess what ....",
"dateCreated": "2022-07-01T11:20:00+00:00",
"datePublished": "2022-07-01T11:20:00+00:00",
"author": {
"@type": "Person",
"name": "Bald Eagle"
}
}
"ingo" <nomail@nomail> wrote:
> it was a struggle, but the basics work now.

I had a go at this in 2017:

also in 2D:

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
```
 From: ingo Subject: Re: Guess what .... Date: 1 Jul 2022 08:31:03 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"headline": "Re: Guess what ....",
"dateCreated": "2022-07-01T12:31:03+00:00",
"datePublished": "2022-07-01T12:31:03+00:00",
"author": {
"@type": "Person",
"name": "ingo"
}
}
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
```