nrad2 - subroutine to determine the first power of 2 larger than npts.
call nrad2(npts, npr2)
Basic Seismic
Utilities (BSU) computes first power of two larger than an
input variable, npts. The subroutine is useful in padding a
signal for radix 2 FFT by Robinson’s nlogn.f code. The
result, npr2, will be the length that one would pad a
complex signal out to.
Fortran Version.
Arguments
npts (int)
Number of samples in a trace
npr2 (int)
Returned value (power of two) just larger than npts.
EXAMPLE:
call nrad2(1000,npr2)
For an input value of 1000, the routine will return 1024 (next power of 2 larger than 1000).
nlogn(3), flist(3), traplt(1)
No known bugs.
Copyright © 2024 by Paul Michaels
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
P. Michaels, PE. <[email protected]>