Author Topic: Multithreading with FFT-IFFT  (Read 31223 times)

guga

  • Member
  • ****
  • Posts: 848
  • Assembly is a state of art.
    • RosAsm
Re: Multithreading with FFT-IFFT
« Reply #135 on: March 26, 2018, 05:59:22 PM »
I´ll wait for the code to study this. I´m a bit confused with the results, though.

If i use, for example, only 16 samples the result i´ve got is diferent from some places i computed online. Ex:
On input
[<16 ComplexData: F$ 0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0]

but, on output i´ve got  32 samples and their values are diferent from the ones i calculated here:

http://www.themobilestudio.net/the-fourier-transform-part-15
or from here
http://scistatcalc.blogspot.com.br/2013/12/fft-calculator.html
« Last Edit: March 28, 2018, 10:14:09 AM by guga »
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

Siekmanski

  • Member
  • *****
  • Posts: 1608
Re: Multithreading with FFT-IFFT
« Reply #136 on: March 26, 2018, 09:52:04 PM »
Hi Guga,

FFT ( Fast Fourier Transform ) comes in all kind of flavours, complex to complex, real to complex, real to real, interleaved or not interleaved, 1D, 2D etc....

My FFT routine posted here is "complex to complex", interleaved input and interleaved output. ( real,imag,real,imag, etc. )

If you insert these 32 ( = FFTsize 16 ) values to "Mark’s FFT Calculator"
http://www.themobilestudio.net/the-fourier-transform-part-15

"Input Samples" set to "Complex Wave"

Copy these values ( = Complex input) as complex wave,
Code: [Select]
0.0
0.0
1.0
0.0
2.0
0.0
3.0
0.0
4.0
0.0
5.0
0.0
6.0
0.0
7.0
0.0
8.0
0.0
9.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0

You get this as FFT results:

REAL: 45.000 -25.452 10.364 -9.064 4.000 -1.279 -2.364 3.795
REAL: -5.000 3.795 -2.364 -1.279 4.000 -9.064 10.364 -25.452
IMAG: 0.000 -16.665 3.293 2.328 -5.000 5.642 -4.707 2.648
IMAG: 0.000 -2.649 4.707 -5.642 5.000 -2.328 -3.293 16.665

Why he outputs the results twice I don't know, 0-15 are the actual results, 16-31 is just a copy of 0-15.

So, if you insert the same values in my FFT routine ( FFTsize equ 16, and do not normalize! )
Complex to Complex, Interleaved input:

Code: [Select]
ComplexData real4 0.0,0.0,1.0,0.0,2.0,0.0,3.0,0.0,4.0,0.0,5.0,0.0,6.0,0.0,7.0,0.0,8.0,0.0,9.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 ; test data

You get this as output,

Interleaved ouput: ( real, Imaginary, not normalized)

 45.000 0.000 -25.452 -16.665 10.364 3.293 -9.064 2.328
 4.000 -5.000 -1.279 5.642 -2.364 -4.707 3.795 2.648
 -5.000 0.000 3.795 -2.649 -2.364 4.707 -1.279 -5.642
 4.000 5.000 -9.064 -2.328 10.364 -3.293 -25.452 16.665

And is exactly the same as calculated in "Mark’s FFT Calculator"

I promised to post my latest FFT code.
But there is an error in the calculations which I need to correct first. This can take some time since I'm really busy at the moment. Sorry...
Creative coders use backward thinking techniques as their strategy.

LordAdef

  • Member
  • ****
  • Posts: 588
Re: Multithreading with FFT-IFFT
« Reply #137 on: March 27, 2018, 02:43:18 PM »
Otimo post!

Nice thread, guys. Replying to follow. Cheers


daydreamer

  • Member
  • ****
  • Posts: 504
Re: Multithreading with FFT-IFFT
« Reply #138 on: March 28, 2018, 06:31:15 PM »
next step is to have 32threads x the number of PC's in a small home LAN,once I had 7 PC's
it is most effective in memoryintensive 3d anmations,first an initial several gb data transfer and after that if you used 5 computers, it rendered 5 times the speed,computer1did frame1,computer2 did frame2etc
Quote from Flashdance
Nick  :  When you give up your dream, you die.
*wears a flameproof asbestos suit*