The **Discrete Fourier Transform (DFT)** is a mathematical technique used to convert a discrete-time signal from the time domain into the frequency domain. It is commonly used in digital signal processing applications for spectral analysis and filtering.

The equation for the DFT of a discrete-time signal x[n] of length N is:

\( X[k] = \sum_{n=0}^{ N-1} x[n] e^{(\frac{-j 2 \pi }{N}nk)} \) ---->(1)

for \(0 \leq k \leq N-1\)

where X[k] represents the complex amplitude of the k-th frequency component, and j is the imaginary unit.

In this equation, the sum computes the contribution of each sample of x[n] to the frequency component at index k. The exponential term represents the phase shift of each sample at frequency k. By computing this equation for each value of k, the DFT provides a representation of the signal in the frequency domain.

If the signal x[n] has length L which is less than its DFT X[k] are padded with zeros upto length N.

It is also important to note that there is difference between Fourier transform of x[n] and DFT of x[n]. The Fourier Transform(FT) of x[n] is given by,

\( X[e^{jw}] = \sum_{n=0}^{ N-1} x[n] e^{(\frac{-j 2 \pi }{N}nk)} \) ---->(2)

In the Fourier Transform equation(2), \(w\) represents frequency which is a continuous variable. The DFT of x[n] given by equation (1) above is derived from Fourier Transform equation (2) by sampling the periodic signal \(e^{jw}\) in the interval between 0 and \(2 \pi\) N equally spaced apart. The discrete frequency is then \(w_k = \frac{2 \pi}{N}\) which is the discrete frequency used in Discrete Fourier Transform(DCT) equation (1).

**Applications of the DFT**

- Spectral Analysis: The DFT is commonly used to analyze the frequency content of a signal, allowing the identification of dominant frequencies and harmonic components.
- Filtering: The frequency response of a filter can be computed using the DFT, allowing the design of digital filters for applications such as audio and image processing.
- Compression: The DFT can be used in lossy compression algorithms, such as JPEG image compression, to remove high-frequency components that are less perceptible to the human eye.
- Signal Reconstruction: By applying the inverse DFT, a signal can be reconstructed from its frequency domain representation.

Overall, the DFT is a powerful tool for analyzing and processing discrete-time signals in the frequency domain, and it has numerous applications in fields such as digital signal processing, telecommunications, and audio engineering.

For writing DFT code and graph see DFT in Matlab without built-in function.