Fast Fourier Transforms Using GSL
AUTHORS:
The fast Fourier transform.
EXAMPLES:
sage: a = FastFourierTransform(128)
sage: for i in range(1, 11):
... a[i] = 1
... a[128-i] = 1
sage: a[:6:2]
[(0.0, 0.0), (1.0, 0.0), (1.0, 0.0)]
sage: a.plot().show(ymin=0)
sage: a.forward_transform()
sage: a.plot().show()
The fast Fourier transform.
EXAMPLES:
sage: a = FastFourierTransform(128)
sage: for i in range(1, 11):
... a[i] = 1
... a[128-i] = 1
sage: a[:6:2]
[(0.0, 0.0), (1.0, 0.0), (1.0, 0.0)]
sage: a.plot().show(ymin=0)
sage: a.forward_transform()
sage: a.plot().show()
Bases: object
x.__init__(...) initializes x; see help(type(x)) for signature
Bases: sage.gsl.fft.FastFourierTransform_base
Wrapper class for GSL’s fast Fourier transform.
Compute the in-place backwards Fourier transform of this data using the Cooley-Tukey algorithm. This is the same as “inverse” but lacks normalization so that backwards*forwards(f) = n*f.
EXAMPLES:
sage: a = FastFourierTransform(125)
sage: b = FastFourierTransform(125)
sage: for i in range(1, 60): a[i]=1
sage: for i in range(1, 60): b[i]=1
sage: a.forward_transform()
sage: a.backward_transform()
sage: (a.plot() + b.plot()).show(ymin=0) # long time (2s on sage.math, 2011)
Compute the in-place forward Fourier transform of this data using the Cooley-Tukey algorithm. If the number of sample points in the input is a power of 2 then the function gsl_fft_complex_radix2_forward() is automatically called. Otherwise, gsl_fft_complex_forward() is called.
EXAMPLES:
sage: a = FastFourierTransform(125)
sage: b = FastFourierTransform(125)
sage: for i in range(1, 60): a[i]=1
sage: for i in range(1, 60): b[i]=1
sage: a.forward_transform()
sage: a.inverse_transform()
sage: (a.plot()+b.plot())
Compute the in-place forward Fourier transform of this data using the Cooley-Tukey algorithm. If the number of sample points in the input is a power of 2 then the function gsl_fft_complex_radix2_inverse() is automatically called. Otherwise, gsl_fft_complex_inverse() is called.
EXAMPLES:
sage: a = FastFourierTransform(125)
sage: b = FastFourierTransform(125)
sage: for i in range(1, 60): a[i]=1
sage: for i in range(1, 60): b[i]=1
sage: a.forward_transform()
sage: a.inverse_transform()
sage: (a.plot()+b.plot())
INPUT: - style – (Default: 'rect') Can be one of the following:
- 'rect' – height represents the real part, color represents the imaginary part
- 'polar' – height represents absolute value
EXAMPLES:
sage: a = FastFourierTransform(125)
sage: b = FastFourierTransform(125)
sage: for i in range(1, 60): a[i]=1
sage: for i in range(1, 60): b[i]=1
sage: a.forward_transform()
sage: a.inverse_transform()
sage: (a.plot()+b.plot())