
- NumPy - Home
- NumPy - Introduction
- NumPy - Environment
- NumPy Arrays
- NumPy - Ndarray Object
- NumPy - Data Types
- NumPy Creating and Manipulating Arrays
- NumPy - Array Creation Routines
- NumPy - Array Manipulation
- NumPy - Array from Existing Data
- NumPy - Array From Numerical Ranges
- NumPy - Iterating Over Array
- NumPy - Reshaping Arrays
- NumPy - Concatenating Arrays
- NumPy - Stacking Arrays
- NumPy - Splitting Arrays
- NumPy - Flattening Arrays
- NumPy - Transposing Arrays
- NumPy Indexing & Slicing
- NumPy - Indexing & Slicing
- NumPy - Indexing
- NumPy - Slicing
- NumPy - Advanced Indexing
- NumPy - Fancy Indexing
- NumPy - Field Access
- NumPy - Slicing with Boolean Arrays
- NumPy Array Attributes & Operations
- NumPy - Array Attributes
- NumPy - Array Shape
- NumPy - Array Size
- NumPy - Array Strides
- NumPy - Array Itemsize
- NumPy - Broadcasting
- NumPy - Arithmetic Operations
- NumPy - Array Addition
- NumPy - Array Subtraction
- NumPy - Array Multiplication
- NumPy - Array Division
- NumPy Advanced Array Operations
- NumPy - Swapping Axes of Arrays
- NumPy - Byte Swapping
- NumPy - Copies & Views
- NumPy - Element-wise Array Comparisons
- NumPy - Filtering Arrays
- NumPy - Joining Arrays
- NumPy - Sort, Search & Counting Functions
- NumPy - Searching Arrays
- NumPy - Union of Arrays
- NumPy - Finding Unique Rows
- NumPy - Creating Datetime Arrays
- NumPy - Binary Operators
- NumPy - String Functions
- NumPy - Matrix Library
- NumPy - Linear Algebra
- NumPy - Matplotlib
- NumPy - Histogram Using Matplotlib
- NumPy Sorting and Advanced Manipulation
- NumPy - Sorting Arrays
- NumPy - Sorting along an axis
- NumPy - Sorting with Fancy Indexing
- NumPy - Structured Arrays
- NumPy - Creating Structured Arrays
- NumPy - Manipulating Structured Arrays
- NumPy - Record Arrays
- Numpy - Loading Arrays
- Numpy - Saving Arrays
- NumPy - Append Values to an Array
- NumPy - Swap Columns of Array
- NumPy - Insert Axes to an Array
- NumPy Handling Missing Data
- NumPy - Handling Missing Data
- NumPy - Identifying Missing Values
- NumPy - Removing Missing Data
- NumPy - Imputing Missing Data
- NumPy Performance Optimization
- NumPy - Performance Optimization with Arrays
- NumPy - Vectorization with Arrays
- NumPy - Memory Layout of Arrays
- Numpy Linear Algebra
- NumPy - Linear Algebra
- NumPy - Matrix Library
- NumPy - Matrix Addition
- NumPy - Matrix Subtraction
- NumPy - Matrix Multiplication
- NumPy - Element-wise Matrix Operations
- NumPy - Dot Product
- NumPy - Matrix Inversion
- NumPy - Determinant Calculation
- NumPy - Eigenvalues
- NumPy - Eigenvectors
- NumPy - Singular Value Decomposition
- NumPy - Solving Linear Equations
- NumPy - Matrix Norms
- NumPy Element-wise Matrix Operations
- NumPy - Sum
- NumPy - Mean
- NumPy - Median
- NumPy - Min
- NumPy - Max
- NumPy Set Operations
- NumPy - Unique Elements
- NumPy - Intersection
- NumPy - Union
- NumPy - Difference
- NumPy Random Number Generation
- NumPy - Random Generator
- NumPy - Permutations & Shuffling
- NumPy - Uniform distribution
- NumPy - Normal distribution
- NumPy - Binomial distribution
- NumPy - Poisson distribution
- NumPy - Exponential distribution
- NumPy - Rayleigh Distribution
- NumPy - Logistic Distribution
- NumPy - Pareto Distribution
- NumPy - Visualize Distributions With Sea born
- NumPy - Matplotlib
- NumPy - Multinomial Distribution
- NumPy - Chi Square Distribution
- NumPy - Zipf Distribution
- NumPy File Input & Output
- NumPy - I/O with NumPy
- NumPy - Reading Data from Files
- NumPy - Writing Data to Files
- NumPy - File Formats Supported
- NumPy Mathematical Functions
- NumPy - Mathematical Functions
- NumPy - Trigonometric functions
- NumPy - Exponential Functions
- NumPy - Logarithmic Functions
- NumPy - Hyperbolic functions
- NumPy - Rounding functions
- NumPy Fourier Transforms
- NumPy - Discrete Fourier Transform (DFT)
- NumPy - Fast Fourier Transform (FFT)
- NumPy - Inverse Fourier Transform
- NumPy - Fourier Series and Transforms
- NumPy - Signal Processing Applications
- NumPy - Convolution
- NumPy Polynomials
- NumPy - Polynomial Representation
- NumPy - Polynomial Operations
- NumPy - Finding Roots of Polynomials
- NumPy - Evaluating Polynomials
- NumPy Statistics
- NumPy - Statistical Functions
- NumPy - Descriptive Statistics
- NumPy Datetime
- NumPy - Basics of Date and Time
- NumPy - Representing Date & Time
- NumPy - Date & Time Arithmetic
- NumPy - Indexing with Datetime
- NumPy - Time Zone Handling
- NumPy - Time Series Analysis
- NumPy - Working with Time Deltas
- NumPy - Handling Leap Seconds
- NumPy - Vectorized Operations with Datetimes
- NumPy ufunc
- NumPy - ufunc Introduction
- NumPy - Creating Universal Functions (ufunc)
- NumPy - Arithmetic Universal Function (ufunc)
- NumPy - Rounding Decimal ufunc
- NumPy - Logarithmic Universal Function (ufunc)
- NumPy - Summation Universal Function (ufunc)
- NumPy - Product Universal Function (ufunc)
- NumPy - Difference Universal Function (ufunc)
- NumPy - Finding LCM with ufunc
- NumPy - ufunc Finding GCD
- NumPy - ufunc Trigonometric
- NumPy - Hyperbolic ufunc
- NumPy - Set Operations ufunc
- NumPy Useful Resources
- NumPy - Quick Guide
- NumPy - Cheatsheet
- NumPy - Useful Resources
- NumPy - Discussion
- NumPy Compiler
NumPy - Inverse Fourier Transform
NumPy Inverse Fourier Transform
The Inverse Fourier Transform is the process of converting a frequency-domain representation of a signal back into the time-domain.
In NumPy, the Inverse Fourier Transform can be computed using the numpy.fft.ifft() function for one-dimensional arrays and numpy.fft.ifftn() function for multi-dimensional arrays.
The inverse transform is essential when you need to reconstruct a signal after manipulating its frequency components, such as in filtering, noise reduction, or spectral analysis.
Inverse Fast Fourier Transform
The numpy.fft.ifft() function computes the Inverse Fast Fourier Transform (IFFT) of a one-dimensional array. It transforms a signal from the frequency domain back to the time domain, essentially reconstructing the original signal.
ifft(x) = Inverse FFT of the input array x
Example: Computing the Inverse FFT
In the following example, we compute the Inverse Fast Fourier Transform of a one-dimensional array (frequency-domain signal) using the ifft() function −
import numpy as np # Define a frequency-domain signal (computed via FFT previously) fft_signal = np.array([10+0j, -2+2j, -2+0j, -2-2j]) # Compute the Inverse Fast Fourier Transform time_signal = np.fft.ifft(fft_signal) print("Reconstructed time-domain signal:", time_signal)
We get the output as shown below −
Reconstructed time-domain signal: [1.+0.j 2.+0.j 3.+0.j 4.+0.j]
IFFT for Real Signals
The numpy.fft.irfft() function is used to compute the inverse FFT for real-valued signals. This function is optimized for reconstructing the original time-domain signal from its non-negative frequency components, which is particularly useful for real-valued input data.
irfft(x) = Inverse FFT of a real-valued input array x
Example: Inverse FFT for Real Signals
In the following example, we compute the inverse FFT for a real-valued frequency-domain signal −
import numpy as np # Define a real-valued frequency-domain signal (computed via rfft previously) fft_real_signal = np.array([10+0j, -2+2j]) # Compute the Inverse FFT of the real-valued signal reconstructed_real_signal = np.fft.irfft(fft_real_signal) print("Reconstructed real-valued time-domain signal:", reconstructed_real_signal)
The result produced is as follows −
Reconstructed real-valued time-domain signal: [4. 6.]
IFT in Multi-dimensional Arrays
For multi-dimensional arrays, NumPy provides the numpy.fft.ifftn() function to compute the n-dimensional inverse FFT. This function can be used to reconstruct signals in multiple dimensions (e.g., 2D or 3D signals).
ifftn(x) = N-dimensional Inverse FFT of the input array x
Example: 2D Inverse FFT
In the following example, we compute the 2-dimensional inverse FFT of a 2D frequency-domain array −
import numpy as np # Define a 2D frequency-domain signal (computed via fftn previously) fft_2d_signal = np.array([[10+0j, -2+2j], [-2+0j, -2-2j]]) # Compute the 2D Inverse Fast Fourier Transform reconstructed_2d_signal = np.fft.ifftn(fft_2d_signal) print("Reconstructed 2D time-domain signal:", reconstructed_2d_signal)
After executing the above code, we get the following output −
Reconstructed 2D time-domain signal: [[1.+0.j 3.+0.j] [3.+1.j 3.-1.j]]
Important Considerations for IFT
Following are the important considerations for inverse Fourier Transforms −
- When performing an inverse Fourier transform, the result may contain complex numbers, even if the input was real-valued. The real part of the result can be extracted using np.real() function, or the imaginary part can be discarded if it is negligible.
- The inverse FFT is highly sensitive to the quality of the frequency-domain data. If any data is lost or corrupted in the frequency domain, the reconstruction in the time domain may be inaccurate.
- The sampling rate and spacing between points in the original signal (before applying FFT) are important when interpreting the reconstructed signal, as they determine the frequency resolution and the temporal resolution of the transform.