Science&Enigneering

Fourier transform

##- 2023. 3. 12. 12:58
728x90

The Fourier transform is a mathematical tool used to analyze signals in the frequency domain. It decomposes a signal into its constituent frequencies, allowing us to analyze the frequency components of the signal.

 

The Fourier transform takes a signal in the time domain, such as a function of time, and converts it into a function of frequency. This allows us to see the frequency content of the signal and identify the dominant frequencies present.

 

The formula for the Fourier transform of a signal f(t) is:

F(ω) = ∫ f(t) e^(-iωt) dt

where F(ω) is the Fourier transform of f(t) and ω is the frequency. The integral is taken over all time.

 

The inverse Fourier transform is used to convert a function in the frequency domain back into the time domain. It is given by:

f(t) = (1/2π) ∫ F(ω) e^(iωt) dω

where f(t) is the signal in the time domain and F(ω) is its Fourier transform.

 

The Fourier transform has many applications in physics, engineering, and signal processing. It is used in fields such as digital signal processing, image processing, and communication systems.

 

import numpy as np

def DFT(x):
    """
    Compute the discrete Fourier Transform of the 1D array x
    :param x: (array) array of values to be transformed
    :return: (complex array) the transformed values
    """
    N = x.size
    n = np.arange(N)
    k = n.reshape((N, 1))
    e = np.exp(-2j * np.pi * k * n / N)
    return np.dot(e, x)

# example usage
x = np.array([1, 2, 3, 4])
print("Input sequence: ", x)
y = DFT(x)
print("Fourier Transform: ", y)
300x250