Linux server.edchosting.com 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
LiteSpeed
Server IP : 75.98.162.185 & Your IP : 216.73.216.163
Domains :
Cant Read [ /etc/named.conf ]
User : goons4good
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib64 /
python2.7 /
site-packages /
numpy /
fft /
Delete
Unzip
Name
Size
Permission
Date
Action
tests
[ DIR ]
drwxr-xr-x
2021-09-16 10:54
__init__.py
168
B
-rw-r--r--
2013-04-07 01:04
__init__.pyc
357
B
-rw-r--r--
2018-04-10 19:40
__init__.pyo
357
B
-rw-r--r--
2018-04-10 19:40
fftpack.py
38.34
KB
-rw-r--r--
2013-04-07 01:04
fftpack.pyc
40.47
KB
-rw-r--r--
2018-04-10 19:40
fftpack.pyo
40.47
KB
-rw-r--r--
2018-04-10 19:40
fftpack_lite.so
39.41
KB
-rwxr-xr-x
2018-04-10 19:40
helper.py
4.05
KB
-rw-r--r--
2013-04-07 01:04
helper.pyc
4.68
KB
-rw-r--r--
2018-04-10 19:40
helper.pyo
4.6
KB
-rw-r--r--
2018-04-10 19:40
info.py
6.59
KB
-rw-r--r--
2013-04-07 01:04
info.pyc
6.71
KB
-rw-r--r--
2018-04-10 19:40
info.pyo
6.71
KB
-rw-r--r--
2018-04-10 19:40
setup.py
501
B
-rw-r--r--
2013-04-07 01:04
setup.pyc
758
B
-rw-r--r--
2018-04-10 19:40
setup.pyo
758
B
-rw-r--r--
2018-04-10 19:40
setupscons.py
536
B
-rw-r--r--
2013-04-07 01:04
setupscons.pyc
834
B
-rw-r--r--
2018-04-10 19:40
setupscons.pyo
834
B
-rw-r--r--
2018-04-10 19:40
Save
Rename
""" Discrete Fourier Transforms - helper.py """ # Created by Pearu Peterson, September 2002 __all__ = ['fftshift','ifftshift','fftfreq'] from numpy.core import asarray, concatenate, arange, take, \ integer, empty import numpy.core.numerictypes as nt import types def fftshift(x,axes=None): """ Shift the zero-frequency component to the center of the spectrum. This function swaps half-spaces for all axes listed (defaults to all). Note that ``y[0]`` is the Nyquist component only if ``len(x)`` is even. Parameters ---------- x : array_like Input array. axes : int or shape tuple, optional Axes over which to shift. Default is None, which shifts all axes. Returns ------- y : ndarray The shifted array. See Also -------- ifftshift : The inverse of `fftshift`. Examples -------- >>> freqs = np.fft.fftfreq(10, 0.1) >>> freqs array([ 0., 1., 2., 3., 4., -5., -4., -3., -2., -1.]) >>> np.fft.fftshift(freqs) array([-5., -4., -3., -2., -1., 0., 1., 2., 3., 4.]) Shift the zero-frequency component only along the second axis: >>> freqs = np.fft.fftfreq(9, d=1./9).reshape(3, 3) >>> freqs array([[ 0., 1., 2.], [ 3., 4., -4.], [-3., -2., -1.]]) >>> np.fft.fftshift(freqs, axes=(1,)) array([[ 2., 0., 1.], [-4., 3., 4.], [-1., -3., -2.]]) """ tmp = asarray(x) ndim = len(tmp.shape) if axes is None: axes = range(ndim) elif isinstance(axes, (int, nt.integer)): axes = (axes,) y = tmp for k in axes: n = tmp.shape[k] p2 = (n+1)//2 mylist = concatenate((arange(p2,n),arange(p2))) y = take(y,mylist,k) return y def ifftshift(x,axes=None): """ The inverse of fftshift. Parameters ---------- x : array_like Input array. axes : int or shape tuple, optional Axes over which to calculate. Defaults to None, which shifts all axes. Returns ------- y : ndarray The shifted array. See Also -------- fftshift : Shift zero-frequency component to the center of the spectrum. Examples -------- >>> freqs = np.fft.fftfreq(9, d=1./9).reshape(3, 3) >>> freqs array([[ 0., 1., 2.], [ 3., 4., -4.], [-3., -2., -1.]]) >>> np.fft.ifftshift(np.fft.fftshift(freqs)) array([[ 0., 1., 2.], [ 3., 4., -4.], [-3., -2., -1.]]) """ tmp = asarray(x) ndim = len(tmp.shape) if axes is None: axes = range(ndim) elif isinstance(axes, (int, nt.integer)): axes = (axes,) y = tmp for k in axes: n = tmp.shape[k] p2 = n-(n+1)//2 mylist = concatenate((arange(p2,n),arange(p2))) y = take(y,mylist,k) return y def fftfreq(n,d=1.0): """ Return the Discrete Fourier Transform sample frequencies. The returned float array contains the frequency bins in cycles/unit (with zero at the start) given a window length `n` and a sample spacing `d`:: f = [0, 1, ..., n/2-1, -n/2, ..., -1] / (d*n) if n is even f = [0, 1, ..., (n-1)/2, -(n-1)/2, ..., -1] / (d*n) if n is odd Parameters ---------- n : int Window length. d : scalar Sample spacing. Returns ------- out : ndarray The array of length `n`, containing the sample frequencies. Examples -------- >>> signal = np.array([-2, 8, 6, 4, 1, 0, 3, 5], dtype=float) >>> fourier = np.fft.fft(signal) >>> n = signal.size >>> timestep = 0.1 >>> freq = np.fft.fftfreq(n, d=timestep) >>> freq array([ 0. , 1.25, 2.5 , 3.75, -5. , -3.75, -2.5 , -1.25]) """ assert isinstance(n,types.IntType) or isinstance(n, integer) val = 1.0/(n*d) results = empty(n, int) N = (n-1)//2 + 1 p1 = arange(0,N,dtype=int) results[:N] = p1 p2 = arange(-(n//2),0,dtype=int) results[N:] = p2 return results * val #return hstack((arange(0,(n-1)/2 + 1), arange(-(n/2),0))) / (n*d)