comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: All day FFT....
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: All day FFT.... [message #29206] Thu, 07 February 2002 01:15 Go to previous message
Martin Downing is currently offline  Martin Downing
Messages: 136
Registered: September 1998
Senior Member
"Robert Stockwell" <rgs1967@hotmail.com> wrote in message
news:3C61BC7C.4030904@hotmail.com...
> Paul van Delst wrote:
>
>> Hey there,
>
>
> My guess, regarding slowness, is "Prime Number" (number of points
> in your time series). Try zeropadding up to, or truncating
> down to, a nice factorable number.
>
> I've attached my hackware factors.pro which will return the
> factors of a number. (and its recursive, COOL!)`
>

Hi Bob,
Inspired, I wrote a more compact version of your function which will work on
long64 too
cheers

Martin
ps: probably is already in the jpl/cm/df library anyway!

function ifactors, num, factor_start = factor_start
;+
; Returns the prime factors of an integer
; inspired by Bob Stockwell
; MRD 7/2/2002
;-
maxfac = sqrt(abs(num))
if n_elements(factor_start) eq 0 then begin
if maxfac gt 1073741824 then factor_start = long64(2) else factor_start =
2L
endif
; find the lowest factor and return that plus the result of factoring the
remainder
;stop
for f = factor_start, maxfac do begin
if num mod f eq 0 then begin
return, [f, ifactors(num/f, factor_start = f)]
endif
endfor

; or return if prime
return, [num,1]
end
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Variables in SAVE files
Next Topic: log scale of data coloring of IDLgrVolume object, not the axes

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:26:52 PDT 2025

Total time taken to generate the page: 0.00410 seconds