Cython: Fourier Transform

This project demonstrates wrapping C/C++ functions in Cython. It also shows how to pass numpy arrays to C/C++ arrays and vice versa.

There are potential execution speed advantages to this mixed language approach.
The sample source code uses this approach to calculate a Fourier transform from a time history signal.
The scripts on this page require the utility module

The C/C++ source code and its header file are: fourier_ccode.cpp & fourier_ccode.h

The Cython file and its setup script are: fourier_trans.pyx &

The Cython & C/C++ files are compiled in command-line via: python build_ext –inplace

The main Python file is:
This project was developed using the reference material at: Wrapping Cython

Tom Irvine

One thought on “Cython: Fourier Transform

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s