View Single Post
Old 23 September 2015, 09:16   #24
bernd roesch
Registered User
 
Join Date: Apr 2012
Location: germany
Posts: 139
In the chaos pro tests, have you set 3d buffer, and IEEESP and 3d image.

then when click on deep space, this should generate a nice 3d image too

Here i have upload a fft FPu demo. it calc fft in fpu, integer, and report output values and time. so can use to verify fpu and measure speed. all values need same.

http://daten-transport.de/?id=ByHqU2Dtt7Fh

if ok, should output this. i have not written the test, so i do not know what this values mean. source is in amiblitz. i put all in code so post is shorter

Code:
FFT algorithm test (float): 
Permutation Table:
+     0.0 => +     0.0
+     1.0 => +     2.0
+     2.0 => +     1.0
+     3.0 => +     3.0
FFT:
left : +   100.0 o--o +   600.0 +     0.0i
right: +   100.0 o--o +   600.0 +     0.0i
left : +   200.0 o--o -   200.0 +   200.0i
right: +   200.0 o--o -   200.0 +   200.0i
left : +   300.0 o--o +   200.0 +     0.0i
right: +   300.0 o--o +   200.0 +     0.0i
left : +     0.0 o--o -   200.0 -   200.0i
right: +     0.0 o--o -   200.0 -   200.0i
IFFT: 
left : +   100.0 o--o +   600.0 +     0.0i
right: +   100.0 o--o +   600.0 +     0.0i
left : +   200.0 o--o -   200.0 +   200.0i
right: +   200.0 o--o -   200.0 +   200.0i
left : +   300.0 o--o +   200.0 +     0.0i
right: +   300.0 o--o +   200.0 +     0.0i
left : +     0.0 o--o -   200.0 -   200.0i
right: +     0.0 o--o -   200.0 -   200.0i
FFT algorithm test (Integer):
FFT (int):
left : +   100.0 o--o +   600.0 +     0.0i
right: +   100.0 o--o +   600.0 +     0.0i
left : +   200.0 o--o -   200.0 +   200.0i
right: +   200.0 o--o -   200.0 +   200.0i
left : +   300.0 o--o +   200.0 +     0.0i
right: +   300.0 o--o +   200.0 +     0.0i
left : +     0.0 o--o -   200.0 -   200.0i
right: +     0.0 o--o -   200.0 -   200.0i
IFFT: 
left : +   100.0 o--o +   600.0 +     0.0i
right: +   100.0 o--o +   600.0 +     0.0i
left : +   200.0 o--o -   200.0 +   200.0i
right: +   200.0 o--o -   200.0 +   200.0i
left : +   300.0 o--o +   200.0 +     0.0i
right: +   300.0 o--o +   200.0 +     0.0i
left : +     0.0 o--o -   200.0 -   200.0i
right: +     0.0 o--o -   200.0 -   200.0i
FFT algorithm test (Integer 68K ASM):
FFT (int):
left : +   100.0 o--o +   600.0 +     0.0i
right: +   100.0 o--o +   600.0 +     0.0i
left : +   200.0 o--o -   200.0 +   200.0i
right: +   200.0 o--o -   200.0 +   200.0i
left : +   300.0 o--o +   200.0 +     0.0i
right: +   300.0 o--o +   200.0 +     0.0i
left : +     0.0 o--o -   200.0 -   200.0i
right: +     0.0 o--o -   200.0 -   200.0i
IFFT: 
left : +   100.0 o--o +   600.0 +     0.0i
right: +   100.0 o--o +   600.0 +     0.0i
left : +   200.0 o--o -   200.0 +   200.0i
right: +   200.0 o--o -   200.0 +   200.0i
left : +   300.0 o--o +   200.0 +     0.0i
right: +   300.0 o--o +   200.0 +     0.0i
left : +     0.0 o--o -   200.0 -   200.0i
right: +     0.0 o--o -   200.0 -   200.0i
Speed test for FFT + iFFT: (float)
time needed 489ms for 413696 samples, => 9.59188270568847x speed @44100Hz/stereo, RTF=.104254819484703
Speed test for FFT + iFFT: (integer)
time needed 565ms for 413696 samples, => 8.30164718627929x speed @44100Hz/stereo, RTF=.120458022072145
Speed test for FFT + iFFT: (integer handoptimized 68K ASM)
time needed 245ms for 413696 samples, => 19.1446151733398x speed @44100Hz/stereo, RTF=.0522340089338837
and if values wrong it output trashed

thats source
Code:
CNIF #__include=0
; Example:
#fft_order    = 2                 ; log2 size of our fft
#fft_npoints  = 1 LSL #fft_order  ; size in samples of our fft

;Goto skip_correctnesstest

Dim td.fftS32(#fft_npoints+2)    ; our time domain (= 32bit mono samples)
Dim fdL.fftCF(#fft_npoints*2+2)  ; our frequency domain (= float complex numbers)
Dim fdR.fftCF(#fft_npoints*2+2)
Dim fdMP.fftCF(#fft_npoints+2)

Dim fdLi.fftCL(#fft_npoints*2+2)  ; our frequency domain (= float complex numbers)
Dim fdRi.fftCL(#fft_npoints*2+2)


td(0)\l =  100    ; some Test data
td(0)\r =  100
td(1)\l =  200
td(1)\r =  200
td(2)\l =  300
td(2)\r =  300
td(3)\l =  0
td(3)\r =  0
td(4)\l =  0
td(4)\r =  0
td(5)\l =  0
td(5)\r =  0
td(6)\l =  0
td(6)\r =  0


td(#fft_npoints)\l = -2,-2
fdL(#fft_npoints)\r = -2,-2
fdR(#fft_npoints)\r = -2,-2

; 1,2,1,0 -> 4,  -2i,0,   2i       ; Test values
; 1,2,3,0 -> 6,-2-2i,2,-2+2i

NPrint "FFT algorithm test (float): "
Format "+#####0.0"
*fft.fftH = fft_Create{#fft_order,#fftmode_float}  ; create our FFT context
If *fft=0
NPrint "Unable to create FFT."
End
End If

NPrint "Permutation Table:"                  ; show us the permutation table
For n.l = 0 To #fft_npoints-1
NPrint n," => ",Peek.l(*fft\ptable+n*4)
Next

NPrint "FFT:"                             ; lets go and do FFT!
;fft_SetHanningWindow{*fft}
fft_Do32s{*fft,&td(0),&fdL(0),&fdR(0)}
For n.l = 0 To #fft_npoints-1
 NPrint "left : ",td(n)\l," o--o ",fdL(n)\r," ",fdL(n)\i,"i"
 NPrint "right: ",td(n)\r," o--o ",fdR(n)\r," ",fdR(n)\i,"i"
Next
If td(#fft_npoints)\r><-2  Then NPrint "td\r trashed !",td(#fft_npoints)\r
If fdL(#fft_npoints)\r><-2 Then NPrint "fdR\r trashed !",fdL(#fft_npoints)\r
If fdR(#fft_npoints)\r><-2 Then NPrint "fdL\r trashed !",fdR(#fft_npoints)\r

NPrint "IFFT: "                           ; transform back to check the correctness
ifft_Do32s{*fft,&fdL(0),&fdR(0),&td(0),False}
For n.l = 0 To #fft_npoints-1
 NPrint "left : ",td(n)\l," o--o ",fdL(n)\r," ",fdL(n)\i,"i"
 NPrint "right: ",td(n)\r," o--o ",fdR(n)\r," ",fdR(n)\i,"i"
Next

If td(#fft_npoints)\r><-2  Then NPrint "td\r trashed !",td(#fft_npoints)\r
If fdL(#fft_npoints)\r><-2 Then NPrint "fdR\r trashed !",fdL(#fft_npoints)\r
If fdR(#fft_npoints)\r><-2 Then NPrint "fdL\r trashed !",fdR(#fft_npoints)\r
Goto skipmagphatest
fft_Do32s{*fft,&td(0),&fdL(0),&fdR(0)}

NPrint "Baseline..."
For n.l = 0 To #fft_npoints-1
 NPrint fdL(n)\r," ",fdL(n)\i,"i <=> ",fdR(n)\r," ",fdR(n)\i,"i"
Next

fft_SinCos2MagPha{*fft,&fdL(0),&fdMP(0)\r,&fdMP(0)\i,8,8}
NPrint "After SinCos2MagPha convert..."
For n.l = 0 To #fft_npoints-1
  NPrint "magpha ",fdMP(n)\r," ... ",fdMP(n)\i
Next

fft_MagPha2SinCos{*fft,&fdMP(0)\r,&fdMP(0)\i,&fdL(0),8,8}

;ifft_DoStereo{*fft,&fdL(0),&fdR(0),&td(0)}

NPrint "After MagPha2SinCos backconv ..."
For n.l = 0 To #fft_npoints-1
 NPrint fdL(n)\r," ",fdL(n)\i,"i <=> ",fdR(n)\r," ",fdR(n)\i,"i"
Next



NPrint "IFFT: "                           ; transform back to check the correctness
ifft_Do32s{*fft,&fdL(0),&fdR(0),&td(0),True}
For n.l = 0 To #fft_npoints-1
 NPrint "left : ",td(n)\l," o--o ",fdL(n)\r," ",fdL(n)\i,"i"
 NPrint "right: ",td(n)\r," o--o ",fdR(n)\r," ",fdR(n)\i,"i"
Next

If td(#fft_npoints)\r><-2  Then NPrint "td\r trashed !",td(#fft_npoints)\r
If fdL(#fft_npoints)\r><-2 Then NPrint "fdR\r trashed !",fdL(#fft_npoints)\r
If fdR(#fft_npoints)\r><-2 Then NPrint "fdL\r trashed !",fdR(#fft_npoints)\r



skipmagphatest:
fft_Free{*fft}



NPrint "FFT algorithm test (Integer):"
Format "+#####0.0"
*fft.fftH = fft_Create{#fft_order,#fftmode_int}  ; create our FFT context
If *fft=0 Then NPrint "Unable to create FFT." : End
td(0)\l =  100    ; some Test data
td(0)\r =  100
td(1)\l =  200
td(1)\r =  200
td(2)\l =  300
td(2)\r =  300
td(3)\l =  0
td(3)\r =  0
td(4)\l =  0
td(4)\r =  0
td(5)\l =  0
td(5)\r =  0
td(6)\l =  0
td(6)\r =  0

td(#fft_npoints)\l = -2,-2
fdL(#fft_npoints)\r = -2,-2
fdR(#fft_npoints)\r = -2,-2

 

NPrint "FFT (int):"                             ; lets go and do FFT!
;fft_SetHanningWindow{*fft}
fft_Do32s{*fft,&td(0),&fdLi(0),&fdRi(0)}
For n.l = 0 To #fft_npoints-1
 NPrint "left : ",td(n)\l," o--o ",fdLi(n)\r," ",fdLi(n)\i,"i"
 NPrint "right: ",td(n)\r," o--o ",fdRi(n)\r," ",fdRi(n)\i,"i"
Next
NPrint "IFFT: "                           ; transform back to check the correctness
ifft_Do32s{*fft,&fdLi(0),&fdRi(0),&td(0),True}
For n.l = 0 To #fft_npoints-1
 NPrint "left : ",td(n)\l," o--o ",fdLi(n)\r," ",fdLi(n)\i,"i"
 NPrint "right: ",td(n)\r," o--o ",fdRi(n)\r," ",fdRi(n)\i,"i"
Next
If td(#fft_npoints)\r><-2  Then NPrint "td\r trashed !",td(#fft_npoints)\r
If fdL(#fft_npoints)\r><-2 Then NPrint "fdR\r trashed !",fdL(#fft_npoints)\r
If fdR(#fft_npoints)\r><-2 Then NPrint "fdL\r trashed !",fdR(#fft_npoints)\r



fft_Free{*fft}



NPrint "FFT algorithm test (Integer 68K ASM):"
Format "+#####0.0"
*fft.fftH = fft_Create{#fft_order,#fftmode_int68k}  ; create our FFT context
If *fft=0 Then NPrint "Unable to create FFT." : End
td(0)\l =  100    ; some Test data
td(0)\r =  100
td(1)\l =  200
td(1)\r =  200
td(2)\l =  300
td(2)\r =  300
td(3)\l =  0
td(3)\r =  0
td(4)\l =  0
td(4)\r =  0
td(5)\l =  0
td(5)\r =  0
td(6)\l =  0
td(6)\r =  0

td(#fft_npoints)\l = -2,-2
fdL(#fft_npoints)\r = -2,-2
fdR(#fft_npoints)\r = -2,-2



NPrint "FFT (int):"                             ; lets go and do FFT!
;fft_SetHanningWindow{*fft}
fft_Do32s{*fft,&td(0),&fdLi(0),&fdRi(0)}
For n.l = 0 To #fft_npoints-1
 NPrint "left : ",td(n)\l," o--o ",fdLi(n)\r," ",fdLi(n)\i,"i"
 NPrint "right: ",td(n)\r," o--o ",fdRi(n)\r," ",fdRi(n)\i,"i"
Next
NPrint "IFFT: "                           ; transform back to check the correctness
ifft_Do32s{*fft,&fdLi(0),&fdRi(0),&td(0),True}
For n.l = 0 To #fft_npoints-1
 NPrint "left : ",td(n)\l," o--o ",fdLi(n)\r," ",fdLi(n)\i,"i"
 NPrint "right: ",td(n)\r," o--o ",fdRi(n)\r," ",fdRi(n)\i,"i"
Next
If td(#fft_npoints)\r><-2  Then NPrint "td\r trashed !",td(#fft_npoints)\r
If fdL(#fft_npoints)\r><-2 Then NPrint "fdR\r trashed !",fdL(#fft_npoints)\r
If fdR(#fft_npoints)\r><-2 Then NPrint "fdL\r trashed !",fdR(#fft_npoints)\r

 



;Format ""
skip_correctnesstest:
XINCLUDE "eclock.include.ab3"
#ffttestsize = 12
z.l  = AllocMem((1 LSL #ffttestsize)*SizeOf.l*2,0)
f1.l = AllocMem((1 LSL #ffttestsize)*SizeOf.f*2*2,0)
f2.l = AllocMem((1 LSL #ffttestsize)*SizeOf.f*2*2,0)


ffth.l = fft_Create{#ffttestsize,#fftmode_float}
fft_SetHanningWindow{ffth}
samples.l = 0
NPrint "Speed test for FFT + iFFT: (float)"
eclock_Start{1000}
For n.l=0 To 100
  For x.l=0 To (1 LSL #ffttestsize)-1:Poke.l z+x*8,x:  Poke.l z+x*8+4,x:Next
  fft_Do32s{ffth,z,f1,f2}
  ifft_Do32s{ffth,f1,f2,z,True}
  samples + (1 LSL #ffttestsize)
Next
time.l = eclock_Stop{}
rtf.f = (samples*10/2/441) / time
Format ""
NPrint "time needed ",time,"ms for ",samples," samples, => ",rtf,"x speed @44100Hz/stereo, RTF=",1/rtf


ffth.l = fft_Create{#ffttestsize,#fftmode_int}
fft_SetHanningWindow{ffth}
samples.l = 0
NPrint "Speed test for FFT + iFFT: (integer)"
eclock_Start{1000}
For n.l=0 To 100
  For x.l=0 To (1 LSL #ffttestsize)-1:Poke.l z+x*8,x:  Poke.l z+x*8+4,x:Next
  fft_Do32s{ffth,z,f1,f2}
  ifft_Do32s{ffth,f1,f2,z,True}
  samples + (1 LSL #ffttestsize)
Next
time.l = eclock_Stop{}
rtf.f = (samples*10/2/441) / time
Format ""
NPrint "time needed ",time,"ms for ",samples," samples, => ",rtf,"x speed @44100Hz/stereo, RTF=",1/rtf
fft_Free{ffth}


ffth.l = fft_Create{#ffttestsize,#fftmode_int68k}
fft_SetHanningWindow{ffth}
samples.l = 0
NPrint "Speed test for FFT + iFFT: (integer handoptimized 68K ASM)"
eclock_Start{1000}
For n.l=0 To 100
  For x.l=0 To (1 LSL #ffttestsize)-1:Poke.l z+x*8,x:  Poke.l z+x*8+4,x:Next
  fft_Do32s{ffth,z,f1,f2}
  ifft_Do32s{ffth,f1,f2,z,True}
  samples + (1 LSL #ffttestsize)
Next
time.l = eclock_Stop{}
rtf.f = (samples*10/2/441) / time
Format ""
NPrint "time needed ",time,"ms for ",samples," samples, => ",rtf,"x speed @44100Hz/stereo, RTF=",1/rtf
fft_Free{ffth}

 

fft_Free{ffth}

End
CEND

Last edited by bernd roesch; 23 September 2015 at 09:24.
bernd roesch is offline  
 
Page generated in 0.05366 seconds with 11 queries