I want to see if there is any interest to include an implementation of czt and iczt in this package. I'm happy to do the work so long as we can agree on the interface and you are willing to provide review.
Theory
The DFT computes the spectral components along the unit circle. The Chirp-z transform (czt) computes components along spiral arcs, which are sometimes aligned along the unit circle. The DFT is a sampling along the y = j \omega straight line in the s-plane. The czt is a sampling of arbitrary straight lines in the s-plane.
My specific interest is in radar, where data from vector network analyzers is measured along the unit circle but not starting at the original. We measure data only from, say, 1 GHz to 5 GHz, and assume the components outside this range are all zeros. We can do this because we provide a band limited signal as input. The iczt method is the primary means of recovering the time domain signal.
Implementation
I generally see the czt and iczt implemented from Bluestein's algorithm. The czt breaks down into convolution, which can be implemented efficiently with fft, multiply, ifft. And fft and ifft are already implemented in this crate.
Design Considerations
I can think of three design considerations:
- Support arbitrary czt
- Support czt aligned on the unit circle
- Support signals not sampled at equidistances
I think we can rule out 3) immediately and implement 1) with a simple interface for 2).
Interface
You probably have a way you want this interface to look. In general, I would like to see something along the lines of the following:
/// Compute the Chirp-z transform
fn czt(buffer: &mut [Complex<T>], a: &Complex<T>, w: &Complex<T>);
/// Compute the inverse Chirp-z transform
fn iczt(buffer: &mut [Complex<T>], a: &Complex<T>, w: &Complex<T>);
/// Compute the Chirp-z transform along the unit circle
///
/// Sampling starts at `theta_start` on the unit circle
fn unit_czt(buffer: &mut [Complex<T>], theta_start: &T);
/// Compute the inverse Chirp-z transform along the unit circle
///
/// Sampling starts at `theta_start` on the unit circle
fn unit_iczt(buffer: &mut [Complex<T>], theta_start: &T);
The fft, multiply, and ifft are performed inside czt and izct using FftPlanner. The samples variable are the z-plane spiral samples as defined in the algorithm. Internally, unit_czt and unit_iczt just create samples and call czt and iczt. czt and iczt are "in place" as is done currently.
At a later date, and if needed, the unit_czt and unit_iczt implementations can be specialized for performance. But generally, we'll see decent performance just by using the excellent implementations in the current crate. However, this interface doesn't follow the style of FftPlanner.
Literature
- Wikipedia
- Press, Mit. "A Linear Filtering Approach to the Computation of the Discrete Fourier Transform." (1969): 171-172.
- Shilling, Steve Alan. A study of the chirp Z-tranform and its applications. Diss. Kansas State University, 1972.
- Rabiner, Lawrence R., Ronald W. Schafer, and Charles M. Rader. "The chirp z‐transform algorithm and its application." Bell System Technical Journal 48.5 (1969): 1249-1292.
- Sukhoy, Vladimir, and Alexander Stoytchev. "Numerical error analysis of the ICZT algorithm for chirp contours on the unit circle." Scientific reports 10.1 (2020): 1-17.
- Sukhoy, Vladimir, and Alexander Stoytchev. "Generalizing the inverse FFT off the unit circle." Scientific reports 9.1 (2019): 1-12.
- MATLAB czt function
I want to see if there is any interest to include an implementation of czt and iczt in this package. I'm happy to do the work so long as we can agree on the interface and you are willing to provide review.
Theory
The DFT computes the spectral components along the unit circle. The Chirp-z transform (czt) computes components along spiral arcs, which are sometimes aligned along the unit circle. The DFT is a sampling along the y = j \omega straight line in the s-plane. The czt is a sampling of arbitrary straight lines in the s-plane.
My specific interest is in radar, where data from vector network analyzers is measured along the unit circle but not starting at the original. We measure data only from, say, 1 GHz to 5 GHz, and assume the components outside this range are all zeros. We can do this because we provide a band limited signal as input. The iczt method is the primary means of recovering the time domain signal.
Implementation
I generally see the czt and iczt implemented from Bluestein's algorithm. The czt breaks down into convolution, which can be implemented efficiently with fft, multiply, ifft. And fft and ifft are already implemented in this crate.
Design Considerations
I can think of three design considerations:
I think we can rule out 3) immediately and implement 1) with a simple interface for 2).
Interface
You probably have a way you want this interface to look. In general, I would like to see something along the lines of the following:
The fft, multiply, and ifft are performed inside
cztandizctusingFftPlanner. Thesamplesvariable are the z-plane spiral samples as defined in the algorithm. Internally,unit_cztandunit_icztjust createsamplesand callcztandiczt.cztandicztare "in place" as is done currently.At a later date, and if needed, the
unit_cztandunit_icztimplementations can be specialized for performance. But generally, we'll see decent performance just by using the excellent implementations in the current crate. However, this interface doesn't follow the style ofFftPlanner.Literature