Skip to main content

Chirp Z-transform implemented in Python

Project description

Chirp z-Transform (CZT)

From Wikipedia:

The chirp Z-transform (CZT) is a generalization of the discrete Fourier transform (DFT). While the DFT samples the Z plane at uniformly-spaced points along the unit circle, the chirp Z-transform samples along spiral arcs in the Z-plane, corresponding to straight lines in the S plane. The DFT, real DFT, and zoom DFT can be calculated as special cases of the CZT.

Example

Consider the following time-domain signal:

This is an exponentially decaying sine wave with some distortion from higher-order frequencies. We can convert the signal to the frequency-domain to investigate the frequency content using the Inverse Chirp z-Transform (ICZT):

Note that the ICZT also allows us to calculate the frequency response over an arbitrary frequency range:

We can see that the signal has frequency components at 1 kHz, 2.5 kHz and 3.5 kHz. To remove the distortion and isolate the 1 kHz signal, we can apply a simple window in the frequency-domain:

Finally, we can use the CZT to transform back to the time domain:

As we can see, we were able to remove the higher-order frequencies that were distorting our 1 kHz signal.

You can find this example and others in the examples/ directory.

References

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

czt-0.0.1.dev0.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

czt-0.0.1.dev0-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page