Thread Subject: FFT and small prime factors

Subject: FFT and small prime factors

From: Rodrigo

Date: 8 Nov, 2009 03:46:02

Message: 1 of 4

I'm writing some code that will be used to convolve large amounts of data in a little time as possible (~1 million 1D ffts, each of of which has a few thousand entries). To make this run as fast as possible I was wondering if anyone knew of an algorithm that approximates a number N with the closest number M such that M=2^a*3^b*5^c (a,b,c integers)

Doing this for a single prime factor is trivial, but the resolution in M is such that you end up padding with too many zeros or throwing away a lot of data. Adding the extra factors improves the resolution and should not reduce the performance of the algorithm too much.

I can think of a direct search algorithm for this using the distance of a point to a hyperplane as a metric, but I was hoping there was a more elegant solution to this.

Cheers

Subject: FFT and small prime factors

From: Rodrigo

Date: 8 Nov, 2009 23:18:01

Message: 2 of 4

"Rodrigo" <guerra.remove.this@physics.harvard.edu> wrote in message <hd5etq$j9f$1@fred.mathworks.com>...
> I'm writing some code that will be used to convolve large amounts of data in a little time as possible (~1 million 1D ffts, each of of which has a few thousand entries). To make this run as fast as possible I was wondering if anyone knew of an algorithm that approximates a number N with the closest number M such that M=2^a*3^b*5^c (a,b,c integers)
>
> Doing this for a single prime factor is trivial, but the resolution in M is such that you end up padding with too many zeros or throwing away a lot of data. Adding the extra factors improves the resolution and should not reduce the performance of the algorithm too much.
>
> I can think of a direct search algorithm for this using the distance of a point to a hyperplane as a metric, but I was hoping there was a more elegant solution to this.
>
> Cheers

Any thoughts?

Subject: FFT and small prime factors

From: TideMan

Date: 8 Nov, 2009 23:42:07

Message: 3 of 4

On Nov 9, 12:18 pm, "Rodrigo" <guerra.remove.t...@physics.harvard.edu>
wrote:
> "Rodrigo" <guerra.remove.t...@physics.harvard.edu> wrote in message <hd5etq$j9...@fred.mathworks.com>...
> > I'm writing some code that will be used to convolve large amounts of data in a little time as possible (~1 million 1D ffts, each of of which has a few thousand entries).  To make this run as fast as possible I was wondering if anyone knew of an algorithm that approximates a number N with the closest number M such that M=2^a*3^b*5^c (a,b,c integers)
>
> > Doing this for a single prime factor is trivial, but the resolution in M is such that you end up padding with too many zeros or throwing away a lot of data.  Adding the extra factors improves the resolution and should not reduce the performance of the algorithm too much.
>
> > I can think of a direct search algorithm for this using the distance of a point to a hyperplane as a metric, but I was hoping there was a more elegant solution to this.
>
> > Cheers
>
> Any thoughts?

I looked at it and couldn't figure out what you were getting at.
Do you want an algorithm that calculates numbers that have primes of
2, 3, 5 (a la Singleton's FFT that takes numbers with primes up to
23), or what?
And if each FFT is for only a few thousand points, I don't know what
you're worried about.
Just use Matlab's FFT on whatever number you have. It is very fast.

Subject: FFT and small prime factors

From: dbd

Date: 9 Nov, 2009 00:28:46

Message: 4 of 4

On Nov 7, 7:46 pm, "Rodrigo" <guerra.remove.t...@physics.harvard.edu>
wrote:
> I'm writing some code that will be used to convolve large amounts of data in a little time as possible (~1 million 1D ffts, each of of which has a few thousand entries).  To make this run as fast as possible I was wondering if anyone knew of an algorithm that approximates a number N with the closest number M such that M=2^a*3^b*5^c (a,b,c integers)
>
> Doing this for a single prime factor is trivial, but the resolution in M is such that you end up padding with too many zeros or throwing away a lot of data.  Adding the extra factors improves the resolution and should not reduce the performance of the algorithm too much.
>
> I can think of a direct search algorithm for this using the distance of a point to a hyperplane as a metric, but I was hoping there was a more elegant solution to this.
>
> Cheers

Rodrigo

I'm not going to suggest an algorithm for you, but I will suggest
reasons why I don't think the algorithm you seek will provide the most
efficient solution to your fft application.
1) solutions should be weighted by the 'efficiency' of the kernels
used
2) the most efficient kernels may well not be primes.
3) the values of the weights depend on the particulars of the hardware
and software implementations considered.

I would suggest that you look at the 'automatic generation of fft
codes' literature to find examples of solutions that might match your
intended implementation. There has been considerable effort towards
optimization specific to implementation characteristics.

A couple of examples for different architectures that include
discussion of the problem and some if the approaches that have been
tried are:

http://vgrads.rice.edu/publications/pdfs/AEOS_Codegenerator_For_FFT.pdf
http://www.iseclab.org/people/pw/papers/vecpar04

Google can find you many more. If you have knowledge of the intended
platform, language, software environment, etc., consider adding that
to your search terms.

Dale B. Dalrymple

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
fft Rodrigo 7 Nov, 2009 22:49:03
prime factors Rodrigo 7 Nov, 2009 22:49:03
approximation Rodrigo 7 Nov, 2009 22:49:03
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com