cupyx.scipy.signal.CZT#

class cupyx.scipy.signal.CZT(n, m=None, w=None, a=1 + 0j)[source]#

Create a callable chirp z-transform function.

Transform to compute the frequency response around a spiral. Objects of this class are callables which can compute the chirp z-transform on their inputs. This object precalculates the constant chirps used in the given transform.

Parameters:
  • n (int) – The size of the signal.

  • m (int, optional) – The number of output points desired. Default is n.

  • w (complex, optional) – The ratio between points in each step. This must be precise or the accumulated error will degrade the tail of the output sequence. Defaults to equally spaced points around the entire unit circle.

  • a (complex, optional) – The starting point in the complex plane. Default is 1+0j.

Returns:

f – Callable object f(x, axis=-1) for computing the chirp z-transform on x.

Return type:

CZT

See also

czt

Convenience function for quickly calculating CZT.

ZoomFFT

Class that creates a callable partial FFT function.

scipy.signal.CZT

Notes

The defaults are chosen such that f(x) is equivalent to fft.fft(x) and, if m > len(x), that f(x, m) is equivalent to fft.fft(x, m).

If w does not lie on the unit circle, then the transform will be around a spiral with exponentially-increasing radius. Regardless, angle will increase linearly.

For transforms that do lie on the unit circle, accuracy is better when using ZoomFFT, since any numerical error in w is accumulated for long data lengths, drifting away from the unit circle.

The chirp z-transform can be faster than an equivalent FFT with zero padding. Try it with your own array sizes to see.

However, the chirp z-transform is considerably less precise than the equivalent zero-padded FFT.

As this CZT is implemented using the Bluestein algorithm [1], it can compute large prime-length Fourier transforms in O(N log N) time, rather than the O(N**2) time required by the direct DFT calculation. (scipy.fft also uses Bluestein’s algorithm’.)

(The name “chirp z-transform” comes from the use of a chirp in the Bluestein algorithm [2]. It does not decompose signals into chirps, like other transforms with “chirp” in the name.)

References

Methods

__call__(x, *, axis=-1)[source]#

Calculate the chirp z-transform of a signal.

Parameters:
  • x (array) – The signal to transform.

  • axis (int, optional) – Axis over which to compute the FFT. If not given, the last axis is used.

Returns:

out – An array of the same dimensions as x, but with the length of the transformed axis set to m.

Return type:

ndarray

points()[source]#

Return the points at which the chirp z-transform is computed.

__eq__(value, /)#

Return self==value.

__ne__(value, /)#

Return self!=value.

__lt__(value, /)#

Return self<value.

__le__(value, /)#

Return self<=value.

__gt__(value, /)#

Return self>value.

__ge__(value, /)#

Return self>=value.