OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
TestFFT.cpp File Reference

Unit tests for FFT implementation (replacement for gsl_fft) More...

#include <gtest/gtest.h>
#include <cmath>
#include <complex>
#include <vector>
#include "Utilities/GSLFFT.h"
Include dependency graph for TestFFT.cpp:

Go to the source code of this file.

Classes

class  FFTTest
 

Functions

 TEST_F (FFTTest, ComplexFFT_Identity)
 
 TEST_F (FFTTest, RealFFT_Transform)
 
 TEST_F (FFTTest, ComplexFFT_Forward)
 
 TEST_F (FFTTest, ComplexFFT_Inverse)
 
 TEST_F (FFTTest, FFT_InverseRoundTrip)
 
 TEST_F (FFTTest, Radix2Forward)
 
 TEST_F (FFTTest, Radix2Inverse)
 

Detailed Description

Unit tests for FFT implementation (replacement for gsl_fft)

This file contains unit tests for GSL-compatible Fast Fourier Transform (FFT) implementations. The implementation uses the Cooley-Tukey algorithm for computing FFTs of real and complex data.

Test:
FFTTest::ComplexFFT_Identity Tests FFT of a constant signal. Verifies basic FFT functionality for complex data. A constant signal should transform to a DC component in the frequency domain.
Test:
FFTTest::RealFFT_Transform Tests forward FFT for real-valued data. Verifies that real input data is correctly transformed to the frequency domain using the GSL-compatible packed format, where the result is stored as \([r_0, r_1, i_1, r_2, i_2, \ldots]\).
Test:
FFTTest::ComplexFFT_Forward Tests forward FFT for complex data. Verifies that a unit impulse (delta function at \(n=0\)) transforms to a constant in the frequency domain (all components equal to 1).
Test:
FFTTest::ComplexFFT_Inverse Tests inverse FFT for complex data. Verifies that a constant in the frequency domain transforms back to an impulse in the time domain, confirming the inverse relationship between forward and inverse transforms.
Test:
FFTTest::FFT_InverseRoundTrip Tests round-trip FFT operations (forward followed by inverse). Verifies that applying forward FFT followed by inverse FFT recovers the original signal (within scaling factor \(N\)), confirming the mathematical relationship: \(\text{IFFT}(\text{FFT}(x)) = N \cdot x\).
Test:
FFTTest::Radix2Forward Tests radix-2 FFT algorithm for power-of-2 sized data. Verifies that the radix-2 implementation correctly computes FFTs for data sizes that are powers of 2, which allows for optimized computation.
Test:
FFTTest::Radix2Inverse Tests radix-2 inverse FFT algorithm. Verifies that the inverse radix-2 transform correctly recovers time-domain signals from frequency-domain representations.

Definition in file TestFFT.cpp.

Function Documentation

◆ TEST_F() [1/7]

TEST_F ( FFTTest  ,
ComplexFFT_Forward   
)

◆ TEST_F() [2/7]

TEST_F ( FFTTest  ,
ComplexFFT_Identity   
)

Definition at line 59 of file TestFFT.cpp.

◆ TEST_F() [3/7]

TEST_F ( FFTTest  ,
ComplexFFT_Inverse   
)

◆ TEST_F() [4/7]

TEST_F ( FFTTest  ,
FFT_InverseRoundTrip   
)

◆ TEST_F() [5/7]

TEST_F ( FFTTest  ,
Radix2Forward   
)

Definition at line 180 of file TestFFT.cpp.

References gsl_fft_complex_radix2_forward().

Here is the call graph for this function:

◆ TEST_F() [6/7]

TEST_F ( FFTTest  ,
Radix2Inverse   
)

Definition at line 201 of file TestFFT.cpp.

References gsl_fft_complex_radix2_inverse().

Here is the call graph for this function:

◆ TEST_F() [7/7]

TEST_F ( FFTTest  ,
RealFFT_Transform   
)