View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Dana DeLouis Dana DeLouis is offline
external usenet poster
 
Posts: 947
Default Analysis ToolPaks VBA Fast Fourier Transform

Excel 2003. The only differences is in Analysis ToolPaks -


ATPVBAEN.XLAM!Fourier in Excel 2007 and ATPVBAEN.XLA!Fourier in Excel 2003. I


Hi. Actually, 2003 should be much slower because Microsoft left in Debug.Print statements in the Analysis ToolPak that caused the programs to run very, very, slow.
They refused to fix this for some unknown reason. Having said that, my times in Excel 2007 are around 4.3 seconds vs your 12 seconds. (for size 4096)
You are right, this is still very slow! I don't have a reason for it being so slow.
You may want to consider your own vba Fourier Program. The advantages are that you can keep the Real & Imaginary values in two separate arrays. When Calling FFT, you do not have to waste time joining each into a string, and them placing them on a worksheet. It is much faster this way.

I get 4.3 seconds with Windows Vista and Excel 2007.

Sub Demo()
Const FFT As String = "ATPVBAEN.XLAM!Fourier"
Const Forward As Boolean = False
Const Inverse As Boolean = True
Const NoLabels As Boolean = False
Const HasLabels As Boolean = True

Dim Tme As Double
Dim Rng As Range

'// Set up
[A:C].Clear
Set Rng = [A1].Resize(2 ^ 12)

With Rng
.Formula = "=Rand()"
.Copy
.PasteSpecial xlPasteValues
Application.CutCopyMode = False
End With

'// Timing Test
Tme = Timer 'Start time
Run FFT, Rng, [C1], Forward, NoLabels
MsgBox Timer - Tme
End Sub


--
HTH :)
Dana DeLouis


"Dimitry" wrote in message ...

Fast Fourier Transform (FFT) in Excel 2007 is 10 to 30 times slower than in
Excel 2003. The only differences is in Analysis ToolPaks -
ATPVBAEN.XLAM!Fourier in Excel 2007 and ATPVBAEN.XLA!Fourier in Excel 2003. I
have a doubt about compression in *.xlam format. It seems like these files
are unwrapped every time when a macro calls them. I have to calculate more
than 12800 FFTs in one workbook. Each one takes 12 seconds. The macro with
FFT should work more than two days. Any suggestions how to accelerate FFT in
Excel 2007?
Thanks