Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Re: optimize th...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 6 Topic 45809 of 47006
Post > Topic >>

Re: optimize this ****fting code ?

by "Steven G. Johnson" <stevenj@[EMAIL PROTECTED] > May 8, 2008 at 09:45 PM

On May 8, 9:07 pm, Jerry Coffin <jcof...@[EMAIL PROTECTED]
> wrote:
> Since you're doing an FFT, I'd guess you don't care about the
> possibility of N being odd.

(There are plenty of FFT algorithms that work for odd N, although it's
true that FFT users often restrict themselves to the even case, and
most implementations are optimized primarily for sizes with many
factors of 2.)

I would say that, if the original poster really cares about
performance, he should just arrange his code so that he doesn't need
the swap/****ft -- he should work with the FFT output in the natural
DFT order, with the origin at the left of the array, rather than
trying to ****ft the origin to the center.

****fting the origin to the center (like in Matlab's fft****ft function)
is just a convenience for visualization, and is not necessary for any
high-performance computational application of the FFT.  (If you are
just plotting the data and want to ****ft it to make a prettier plot, I
would be surprised if the time to ****ft it is a serious performance
bottleneck.)

Steven

PS. For even N, the fastest way to ****ft by N/2 is almost certainly
just a loop of N/2 swaps in-place as another poster pointed out.  For
odd N, or for an arbitrary cyclic ****ft of the array, in the past
we've found that the fastest scheme is to do two in-place p***** over
the array: one to reverse the order, and one to un-reverse the two
segments before and after the ****ft.
 




 6 Posts in Topic:
optimize this Shifting code ?
Matthias Pospiech <mat  2008-05-08 14:23:56 
Re: optimize this Shifting code ?
lunar_lty <penglu96@[E  2008-05-08 05:56:56 
Re: optimize this Shifting code ?
"Victor Bazarov"  2008-05-08 20:53:03 
Re: optimize this Shifting code ?
Jerry Coffin <jcoffin@  2008-05-08 19:07:22 
Re: optimize this Shifting code ?
"Steven G. Johnson&q  2008-05-08 21:45:11 
Re: optimize this Shifting code ?
Jerry Coffin <jcoffin@  2008-05-09 07:54:26 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 2:12:34 CDT 2008.