k-Wave Toolbox Previous   Next

checkFactors

Return the maximum prime factor for a range of numbers

Syntax

checkFactors(min_number, max_number)

Description

checkFactors loops through the given range of numbers and finds the numbers with the smallest maximum prime factors. This allows suitable grid sizes to be selected to maximise the speed of the FFT (this is fastest for FFT lengths with small prime factors).

For example, running the code checkFactors(100, 200) produces the output

Numbers with a maximum factor of 2
128
Numbers with a maximum factor of 3
108  144  162  192
Numbers with a maximum factor of 5
100  120  125  135  150  160  180  200
Numbers with a maximum factor of 7
105  112  126  140  147  168  175  189  196

See Also

fft, factor


© 2009-2012 Bradley Treeby and Ben Cox.