STIR  6.3.0
Namespaces | Functions
fftshift.h File Reference

Functions to rearrange Fourier data so that DC (zero frequency) is centered. More...

#include "stir/Array.h"
#include <complex>
#include <utility>

Go to the source code of this file.

Namespaces

 stir
 Namespace for the STIR library (and some/most of its applications)
 

Functions

template<typename T >
void stir::fftshift (Array< 1, T > &a, int size)
 In-place 1D fftshift: swap halves [0..N/2-1] <-> [N/2..N-1].
 
template<typename T >
void stir::fftshift (Array< 2, std::complex< T >> &a, int size)
 In-place 2D fftshift: quadrant swap (left-right, then top-bottom). Accepts complex arrays.
 

Detailed Description

Functions to rearrange Fourier data so that DC (zero frequency) is centered.

Author
Dimitra Kyriakopoulou

These are the familiar "fftshift" operations used around FFTs. 1D: swap the lower and upper halves of a vector. 2D: swap left/right halves, then top/bottom halves (quadrant swap).

Note
Assumes an even size (as in our FFT lengths).