The Discrete Fourier Transform (DFT) of One Variable

The Discrete Fourier Transform (DFT) is a mathematical technique that plays a crucial role in signal processing, data analysis, and many fields of engineering. By transforming a sequence of values into components of different frequencies, DFT allows for the analysis of signals in the frequency domain rather than just the time domain. This is particularly useful for identifying patterns, compressing data, and filtering noise from signals.

In its simplest form, the DFT of one variable takes a finite sequence of equally spaced data points, usually obtained through sampling a continuous function or signal, and decomposes it into a sum of sinusoids with different frequencies and amplitudes. The resulting frequency spectrum provides insight into the underlying periodic components of the signal, which is often much more revealing than the original time-based sequence.

This transformation is especially efficient when applied to problems like audio processing, image compression, and solving partial differential equations. One of the key algorithms for computing DFT is the Fast Fourier Transform (FFT), which significantly reduces computational complexity and makes it practical for real-world applications.

In this article, we will delve into the concept of the DFT, explore its mathematical foundation, and examine its practical applications, with a focus on understanding how it operates for one variable. We will also discuss common use cases where the DFT proves indispensable, and how it provides the framework for further advancements in digital signal processing.

Obtaining the DFT from the Continuous Transform of a Sampled Function

The Discrete Fourier Transform (DFT) is a powerful tool that allows us to analyze discrete signals in the frequency domain. It bridges the gap between continuous-time signal processing and discrete-time signal processing. Understanding how the DFT is derived from the continuous Fourier Transform (CFT) of a sampled function provides deep insights into signal analysis, sampling theory, and the limitations imposed by discrete representations.

Mathematical Concepts

  1. Continuous-Time Signal and Its Fourier Transform

    A continuous-time signal x(t)x(t) can be analyzed in the frequency domain using the continuous Fourier Transform (CFT):

    X(f)=x(t)ej2πftdtX(f) = \int_{-\infty}^{\infty} x(t) e^{-j2\pi f t} dt

    where:

    • X(f)X(f) is the continuous frequency spectrum,
    • ff represents continuous frequency,
    • jj is the imaginary unit.
  2. Sampling a Continuous-Time Signal

    Sampling involves capturing the signal x(t)x(t) at discrete time intervals TsT_s (sampling period), resulting in:

    xs(t)=x(t)n=δ(tnTs)x_s(t) = x(t) \cdot \sum_{n=-\infty}^{\infty} \delta(t – nT_s)

    where δ(t)\delta(t) is the Dirac delta function, and xs(t)x_s(t) is the sampled signal.

  3. Fourier Transform of a Sampled Signal

    The Fourier Transform of the sampled signal xs(t)x_s(t) is given by:

    Xs(f)=1Tsk=X(fkTs)X_s(f) = \frac{1}{T_s} \sum_{k=-\infty}^{\infty} X\left(f – \frac{k}{T_s}\right)

    This expression shows that Xs(f)X_s(f) is a periodic replication of X(f)X(f) with period 1Ts\frac{1}{T_s}.

  4. Discrete-Time Signal and the Discrete Fourier Transform

    The discrete-time signal x[n]x[n] is obtained by sampling x(t)x(t):

    x[n]=x(nTs)x[n] = x(nT_s)

    The DFT of x[n]x[n] is defined as:

    X[k]=n=0N1x[n]ej2πNknX[k] = \sum_{n=0}^{N-1} x[n] e^{-j \frac{2\pi}{N} kn}

    where:

    • NN is the total number of samples,
    • k=0,1,,N1k = 0, 1, \dots, N-1 indexes the discrete frequencies.

Derivation of the DFT from the Continuous Transform

  1. Sampling in Time Domain

    Start with the continuous-time signal x(t)x(t) and sample it at intervals TsT_s:

    xs(t)=x(t)n=δ(tnTs)x_s(t) = x(t) \cdot \sum_{n=-\infty}^{\infty} \delta(t – nT_s)

    The discrete-time sequence is:

    x[n]=xs(nTs)=x(nTs)x[n] = x_s(nT_s) = x(nT_s)
  2. Fourier Transform of the Sampled Signal

    The Fourier Transform of xs(t)x_s(t) is:

    Xs(f)=xs(t)ej2πftdt=n=x(nTs)ej2πfnTsX_s(f) = \int_{-\infty}^{\infty} x_s(t) e^{-j2\pi f t} dt = \sum_{n=-\infty}^{\infty} x(nT_s) e^{-j2\pi f nT_s}

    Recognize that this is a Fourier series representation of Xs(f)X_s(f).

  3. Relating Xs(f)X_s(f) to X(f)X(f)

    Using the properties of the Dirac comb in frequency domain:

    Xs(f)=1Tsk=X(fkTs)X_s(f) = \frac{1}{T_s} \sum_{k=-\infty}^{\infty} X\left(f – \frac{k}{T_s}\right)

    This equation demonstrates that sampling in time causes replication in frequency.

  4. Sampling in Frequency Domain

    To obtain discrete frequencies, sample Xs(f)X_s(f) at f=kNTsf = \frac{k}{NT_s}:

    X[k]=Xs(kNTs)=1Tsm=X(kNTsmTs)X[k] = X_s\left(\frac{k}{NT_s}\right) = \frac{1}{T_s} \sum_{m=-\infty}^{\infty} X\left(\frac{k}{NT_s} – \frac{m}{T_s}\right)

    Simplify the argument:

    kNTsmTs=kmNNTs\frac{k}{NT_s} – \frac{m}{T_s} = \frac{k – mN}{NT_s}
  5. Assuming Bandlimited Signal

    If X(f)X(f) is bandlimited and fs2fmaxf_s \geq 2f_{\text{max}} (Nyquist rate), the replicas do not overlap, and we can consider m=0m = 0:

    X[k]=1TsX(kNTs)X[k] = \frac{1}{T_s} X\left(\frac{k}{NT_s}\right)
  6. Expressing X[k]X[k] in Terms of x[n]x[n]

    Substitute the inverse Fourier Transform of X(f)X(f):

    X[k]=1Tsx(t)ej2πkNTstdtX[k] = \frac{1}{T_s} \int_{-\infty}^{\infty} x(t) e^{-j2\pi \frac{k}{NT_s} t} dt

    Since x(t)x(t) is only known at discrete times nTsnT_s:

    X[k]=n=x(nTs)ej2πkNnX[k] = \sum_{n=-\infty}^{\infty} x(nT_s) e^{-j2\pi \frac{k}{N} n}

    Limiting nn to 00 to N1N-1 for finite signals:

    X[k]=n=0N1x[n]ej2πNknX[k] = \sum_{n=0}^{N-1} x[n] e^{-j \frac{2\pi}{N} kn}

    This is the standard definition of the DFT.


Example: Deriving the DFT from a Sampled Continuous Function

Continuous-Time Signal

Consider the continuous-time signal:

x(t)=cos(2πf0t)x(t) = \cos(2\pi f_0 t)

Let’s choose f0=50f_0 = 50 Hz.

Sampling Parameters

  • Sampling frequency: fs=200f_s = 200 Hz
  • Sampling period: Ts=1fs=0.005T_s = \frac{1}{f_s} = 0.005 s
  • Number of samples: N=8N = 8

Sampling the Signal

Sample x(t)x(t) at t=nTst = nT_s:

x[n]=x(nTs)=cos(2πf0nTs)=cos(2π50n0.005)=cos(πn)x[n] = x(nT_s) = \cos(2\pi f_0 nT_s) = \cos(2\pi \cdot 50 \cdot n \cdot 0.005) = \cos(\pi n)

Compute x[n]x[n] for n=0n = 0 to 77:

  • x[0]=cos(0)=1x[0] = \cos(0) = 1
  • x[1]=cos(π1)=1x[1] = \cos(\pi \cdot 1) = -1
  • x[2]=cos(π2)=1x[2] = \cos(\pi \cdot 2) = 1
  • x[3]=cos(π3)=1x[3] = \cos(\pi \cdot 3) = -1
  • x[4]=cos(π4)=1x[4] = \cos(\pi \cdot 4) = 1
  • x[5]=cos(π5)=1x[5] = \cos(\pi \cdot 5) = -1
  • x[6]=cos(π6)=1x[6] = \cos(\pi \cdot 6) = 1
  • x[7]=cos(π7)=1x[7] = \cos(\pi \cdot 7) = -1

Compute the DFT

Using the DFT formula:

X[k]=n=07x[n]ej2π8knX[k] = \sum_{n=0}^{7} x[n] e^{-j \frac{2\pi}{8} kn}

Compute X[k]X[k] for k=0k = 0 to 77:

  1. For k=0k = 0:

    X[0]=n=07x[n]ej0=n=07x[n]=(1)+(1)+(1)+(1)+(1)+(1)+(1)+(1)=0X[0] = \sum_{n=0}^{7} x[n] e^{-j0} = \sum_{n=0}^{7} x[n] = (1) + (-1) + (1) + (-1) + (1) + (-1) + (1) + (-1) = 0
  2. For k=1k = 1:

    X[1]=n=07x[n]ej2π8nX[1] = \sum_{n=0}^{7} x[n] e^{-j \frac{2\pi}{8} n}

    Compute each term:

    • n=0n = 0: x[0]ej0=1x[0] e^{-j0} = 1
    • n=1n = 1: x[1]ejπ4=1ejπ4x[1] e^{-j \frac{\pi}{4} } = -1 e^{-j \frac{\pi}{4}}
    • n=2n = 2: x[2]ejπ2=1ejπ2x[2] e^{-j \frac{\pi}{2} } = 1 e^{-j \frac{\pi}{2}}
    • n=3n = 3: x[3]ej3π4=1ej3π4x[3] e^{-j \frac{3\pi}{4} } = -1 e^{-j \frac{3\pi}{4}}
    • Continue for n=4n = 4 to 77.

    Sum the terms numerically to find X[1]X[1].

  3. For k=4k = 4:

    X[4]=n=07x[n]ej2π84n=n=07x[n]ejπnX[4] = \sum_{n=0}^{7} x[n] e^{-j \frac{2\pi}{8} 4 n} = \sum_{n=0}^{7} x[n] e^{-j \pi n}

    Since ejπn=(1)ne^{-j \pi n} = (-1)^n:

    X[4]=n=07x[n](1)nX[4] = \sum_{n=0}^{7} x[n] (-1)^n

    Compute:

    • For even nn: (1)n=1(-1)^n = 1, x[n]=1x[n] = 1, so x[n](1)n=1x[n] (-1)^n = 1
    • For odd nn: (1)n=1(-1)^n = -1, x[n]=1x[n] = -1, so x[n](1)n=(1)(1)=1x[n] (-1)^n = (-1)(-1) = 1

    Therefore:

    X[4]=n=071=8X[4] = \sum_{n=0}^{7} 1 = 8
  4. DFT Results

After computing X[k]X[k] for all kk:

  • X[0]=0X[0] = 0
  • X[4]=8X[4] = 8
  • Other X[k]X[k] values will be zero or near zero due to the orthogonality of the exponentials.

Interpretation

  • The significant DFT coefficient at k=4k = 4 corresponds to a frequency:

    fk=kfsN=4×2008=100 Hzf_k = \frac{k f_s}{N} = \frac{4 \times 200}{8} = 100 \text{ Hz}
  • However, our original signal was at f0=50f_0 = 50 Hz. This discrepancy is due to aliasing, as the signal frequency is equal to half the sampling frequency (fs/2f_s/2).

  • The frequency at k=4k = 4 actually represents the aliased frequency:

    falias=f0nfs=500×200=50 Hzf_{\text{alias}} = |f_0 – n f_s| = |50 – 0 \times 200| = 50 \text{ Hz}

    But due to periodicity in the DFT, it appears at k=4k = 4.

Understanding Aliasing

  • Since f0=fs/4f_0 = f_s/4, the sampled signal’s frequency content gets mirrored around fs/2f_s/2.
  • This effect highlights the importance of choosing a sampling frequency higher than twice the highest frequency component (Nyquist rate) to avoid aliasing.

Relationship Between the Sampling and Frequency Intervals

In signal processing, the relationship between the sampling interval (or sampling period) and the frequency interval is a fundamental concept that arises from the Nyquist-Shannon sampling theorem. It describes how continuous signals are represented in the discrete domain and the effects of this transformation on the frequency spectrum of the signal.

Key Concepts

  1. Sampling: This is the process of converting a continuous signal (like an analog signal) into a discrete signal by taking measurements (samples) at regular intervals. The sampling interval is the time between successive samples, denoted by TsT_s.

  2. Sampling Rate (Sampling Frequency): The inverse of the sampling interval TsT_s is the sampling frequency, denoted as fsf_s:

    fs=1Tsf_s = \frac{1}{T_s}

    It represents how many samples per second are taken from the continuous signal.

  3. Frequency Domain Representation: When you sample a signal, it also affects its representation in the frequency domain. A continuous-time signal is analyzed using Fourier transform, while a discrete-time signal is analyzed using the Discrete Fourier Transform (DFT) or Fast Fourier Transform (FFT).

  4. Frequency Interval (Resolution): When a signal is sampled, it is transformed into the frequency domain in discrete steps. The distance between these discrete frequency points is called the frequency interval Δf\Delta f, and it is related to the total sampling time TT, where T=NTsT = N T_s (with NN being the number of samples):

    Δf=1T=1NTs\Delta f = \frac{1}{T} = \frac{1}{N T_s}

    The frequency interval defines how finely spaced the frequency components of the sampled signal are when transformed into the frequency domain.

Relationship Between Sampling Interval and Frequency Interval

The relationship between the sampling interval TsT_s and the frequency interval Δf\Delta f is inversely proportional. Specifically:

  • As the sampling interval TsT_s decreases (sampling rate fsf_s increases), the frequency interval Δf\Delta f increases. This means you capture a wider range of frequencies but with less detail per frequency step.

  • As the sampling interval TsT_s increases (sampling rate fsf_s decreases), the frequency interval Δf\Delta f decreases, which gives a finer frequency resolution but at the cost of a smaller total frequency range.

Mathematically, this can be summarized as:

Δf=1NTs\Delta f = \frac{1}{N T_s}

where NN is the number of samples, and TsT_s is the sampling interval.

Example

Let’s consider a practical example:

  • Suppose we have a signal sampled at a sampling frequency of fs=1000Hzf_s = 1000 \, \text{Hz}, so the sampling interval is Ts=1fs=0.001secondsT_s = \frac{1}{f_s} = 0.001 \, \text{seconds}.

  • We take N=1000N = 1000 samples, so the total time for the samples is T=NTs=1000×0.001=1secondT = N T_s = 1000 \times 0.001 = 1 \, \text{second}.

  • The frequency interval Δf\Delta f is calculated as:

    Δf=1T=11=1Hz\Delta f = \frac{1}{T} = \frac{1}{1} = 1 \, \text{Hz}

    This means that the frequency resolution of the DFT is 1 Hz, and the frequency domain representation will have frequencies at intervals of 1 Hz (e.g., 0 Hz, 1 Hz, 2 Hz, etc.).

Now, if we increase the sampling rate to fs=2000Hzf_s = 2000 \, \text{Hz} (i.e., decrease the sampling interval Ts=0.0005secondsT_s = 0.0005 \, \text{seconds}) but keep N=1000N = 1000 samples:

  • The total sampling time is T=NTs=1000×0.0005=0.5secondsT = N T_s = 1000 \times 0.0005 = 0.5 \, \text{seconds}.

  • The frequency interval Δf\Delta f becomes:

    Δf=1T=10.5=2Hz\Delta f = \frac{1}{T} = \frac{1}{0.5} = 2 \, \text{Hz}

    This means the frequency resolution has worsened (the spacing between frequency points has increased to 2 Hz), but we now have a larger overall frequency range.

Sampling and Frequency
(a) A function, and (b) samples in the x-domain.In (a), t is a continuous variable; in (b), x represents integer values

Conclusion

The Discrete Fourier Transform (DFT) of one variable is a powerful mathematical tool widely used in various fields such as signal processing, data analysis, and image processing. It allows the transformation of discrete time-domain signals into their frequency-domain components, revealing important frequency characteristics that are not easily discernible in the time domain. The DFT’s computational efficiency, particularly when implemented using the Fast Fourier Transform (FFT) algorithm, has made it a cornerstone in modern digital technology. Its applications span from audio and image compression to solving complex differential equations, underscoring its versatility and significance in both theoretical and practical contexts.

References

  • Oppenheim, A. V., & Schafer, R. W. (2009). Discrete-Time Signal Processing. Pearson.
  • Bracewell, R. (2000). The Fourier Transform and Its Applications. McGraw-Hill.
  • Proakis, J. G., & Manolakis, D. G. (1996). Digital Signal Processing: Principles, Algorithms, and Applications. Prentice-Hall.

Leave a Comment