Application of Fourier Series in Signal Processing and Image Compression
Abstract
About This Research Topic
Every digital photograph you compress, every voice call you make, and every audio file you stream relies, at some level, on a two-hundred-year-old mathematical idea: that complicated, irregular signals can be broken down into simple, repeating waves. This idea, first proposed by Joseph Fourier while studying heat flow, has grown into one of the most widely used tools in modern applied mathematics and engineering. Understanding Fourier series in signal processing is therefore not just an academic exercise — it is the mathematical foundation behind technologies that shape daily digital life, from telecommunications to multimedia compression.
This article presents a complete, research-based exploration of how Fourier series and its discrete counterparts — the Discrete Fourier Transform (DFT), the Fast Fourier Transform (FFT), and the Discrete Cosine Transform (DCT) — are applied to two practical problems: reconstructing a one-dimensional periodic signal and compressing a two-dimensional digital image. Drawing on an undergraduate research project built around real computational experiments in Python, the discussion covers the theoretical roots of harmonic analysis, the mathematics of convergence and the Gibbs phenomenon, and a hands-on demonstration of DCT-based image compression modelled on the JPEG standard.
Whether you are a mathematics student researching Fourier analysis, an engineering learner exploring compression algorithms, or simply curious about the mathematics behind everyday technology, this guide breaks the subject down into clear, well-organized sections — from background and objectives to research questions and key definitions — so you can follow the logic of the study from start to finish.
Main Abstract
Fourier series and its related transform techniques rank among the most versatile mathematical instruments for analysing, representing, and manipulating both periodic and non-periodic signals. This study examines the theoretical underpinnings and real-world application of Fourier series alongside three closely connected discrete transforms — the Discrete Fourier Transform (DFT), the Fast Fourier Transform (FFT), and the Discrete Cosine Transform (DCT) — across two major domains of digital processing: the decomposition and filtering of one-dimensional signals, and the compression of two-dimensional images.
The work traces the historical evolution of harmonic analysis, beginning with Joseph Fourier's original investigation into heat conduction and progressing to today's computational implementations. It builds a rigorous theoretical framework covering Fourier series representation, convergence behaviour (including the Dirichlet conditions and the Gibbs phenomenon), and Parseval's theorem, which governs energy conservation between the time and frequency domains.
On the computational side, a periodic square-wave signal is reconstructed using truncated Fourier partial sums of increasing order, while a synthetic 128 × 128 grayscale image is compressed through a block-based two-dimensional DCT with selective coefficient retention, mirroring the logic behind JPEG compression. Experiments carried out in Python using NumPy, SciPy, and Matplotlib reveal that the mean-square approximation error of the square-wave signal falls steadily as more harmonics are retained — from an L² error of 0.435 at a single term (N = 1) down to 0.066 at ninety-nine terms (N = 99) — yet a stubborn overshoot of roughly 9%, the Gibbs phenomenon, persists near the signal's discontinuity no matter how many terms are added.
In the image compression experiment, keeping just 10% of the largest-magnitude DCT coefficients still produced a reconstructed image with a Peak Signal-to-Noise Ratio (PSNR) of 38.61 dB at a 10:1 compression ratio, while retaining 25% of coefficients pushed the PSNR up to 41.68 dB. These figures illustrate the classic trade-off between how much data is discarded and how faithfully the image can be reconstructed. Collectively, the findings confirm that Fourier-based transforms are highly effective at concentrating signal energy into a small number of coefficients, enabling substantial data reduction with only modest perceptual loss. The study concludes that the DCT, because of its stronger energy-compaction performance on natural images compared with the DFT, remains a sound and computationally efficient basis for modern image compression standards, and it points to wavelet-based and hybrid transform methods as promising directions for future research.
Keywords: Fourier series, Discrete Fourier Transform, Discrete Cosine Transform, signal processing, image compression, Gibbs phenomenon, Parseval's theorem, energy compaction.
Chapter One Preview
Background to the Study
The Origins of Harmonic Analysis
Few ideas in applied mathematics have proven as enduring as the notion that intricate physical processes can be described as combinations of simple, repeating waveforms. The French mathematician Jean-Baptiste Joseph Fourier introduced this concept formally in his 1822 work Théorie analytique de la chaleur, arguing that virtually any periodic function could be written as an infinite sum of sine and cosine terms. Fourier developed this framework while studying how heat spreads through solid materials, yet the mathematical structure he devised — what we now call the Fourier series — has since expanded far beyond thermodynamics into nearly every scientific and engineering discipline concerned with oscillation, vibration, or wave motion.
From Continuous Signals to Digital Processing
In contemporary signal processing, a “signal” refers to any function that carries information about how a system behaves, whether that system is an electrical circuit, a sound wave, or a biological process. Many real-world signals are periodic, or can be treated as periodic over a limited time window, which makes Fourier series decomposition directly applicable. Breaking a signal into its individual frequency components is essential across a wide range of fields, including telecommunications, acoustics, control engineering, biomedical signal analysis (such as interpreting electrocardiogram traces), and structural vibration monitoring.
The leap from continuous mathematics to digital computation came through the Discrete Fourier Transform (DFT), and especially through the Fast Fourier Transform (FFT) algorithm developed by Cooley and Tukey in 1965. The FFT dramatically reduced the computational cost of frequency analysis, making it feasible to process signals in real time on digital computers. It is widely regarded as one of the most influential algorithms in the entire history of digital signal processing.
The Rise of the Discrete Cosine Transform
A related but distinct tool, the Discrete Cosine Transform (DCT), was introduced by Ahmed, Natarajan, and Rao in 1974 and has since become central to modern image and video compression, most notably as the mathematical engine behind the JPEG standard. Compared with the DFT, the DCT is particularly good at concentrating a signal's energy into a small number of low-frequency coefficients when applied to typical images. This means that the remaining high-frequency coefficients can be discarded, or stored with much less precision, without producing a noticeable drop in visual quality — the mathematical principle that makes lossy image compression possible.
Purpose of This Study
Building on this foundation, the present research investigates the mathematical theory of Fourier series and its discrete relatives, combined with a hands-on computational study of how these tools perform in practice. The work is structured around two applications: reconstructing a one-dimensional periodic signal from a limited number of frequency terms, and compressing a two-dimensional digital image using a block-based DCT. Theoretical development — definitions, theorems, and convergence analysis — is paired with numerical experiments implemented in Python, allowing the practical performance of Fourier-based methods to be measured, visualised, and interpreted rather than simply asserted.
Statement of the Problem
Although Fourier-based techniques are used extensively throughout engineering practice, many introductory treatments of the Fourier series end at the derivation of the trigonometric coefficients, without going further to examine three important questions in a rigorous, quantitative way. First, how quickly does a truncated Fourier partial sum actually converge toward a signal that has sharp discontinuities or non-smooth features? Second, what is the nature of the persistent approximation error near such discontinuities, known as the Gibbs phenomenon, and why does it not disappear as more terms are added? Third, how does the same mathematical machinery, expressed in its two-dimensional cosine form, translate into a practical tool for compressing digital images?
This creates a gap between the abstract theory typically taught in coursework and its concrete, measurable behaviour in application. There is a clear need for a study that bridges this gap — one that connects the theoretical treatment of Fourier series to a numerically verified demonstration of signal reconstruction and image compression, using recognised evaluation metrics such as the mean square error (MSE) and the peak signal-to-noise ratio (PSNR) to quantify performance rather than relying on qualitative description alone.
Aim and Objectives of the Study
Aim
The aim of this study is to investigate the mathematical theory of Fourier series and to apply it, together with its discrete transform analogues, to the problems of periodic signal approximation and digital image compression.
Objectives
To achieve this aim, the study pursues the following specific objectives:
1. Review the theoretical foundation of Fourier series, including its trigonometric and complex exponential forms, key convergence theorems, and Parseval's identity.
2. Formulate and implement a computational scheme that approximates a periodic square-wave signal using truncated Fourier partial sums of progressively increasing order.
3. Analyse how quickly the Fourier partial sums converge and quantify the Gibbs phenomenon that occurs near signal discontinuities.
4. Formulate and implement a two-dimensional Discrete Cosine Transform (DCT) based image compression scheme modelled on the JPEG standard.
5. Evaluate the performance of the DCT-based compression scheme using the mean square error (MSE) and the peak signal-to-noise ratio (PSNR) across different levels of coefficient retention.
6. Compare the energy-compaction efficiency of the Discrete Fourier Transform and the Discrete Cosine Transform when applied to image data.
Research Questions
The study is guided by the following research questions:
7. What is the theoretical basis for representing a periodic signal as a Fourier series, and under what conditions does the series converge to that signal?
8. How does the approximation error of a truncated Fourier partial sum change as the number of retained harmonics increases?
9. To what extent does the Gibbs phenomenon persist near a discontinuity, regardless of how many terms are included in the partial sum?
10. How can the two-dimensional Discrete Cosine Transform be applied to compress a digital image while maintaining acceptable visual quality?
11. What trade-off exists between compression ratio (the fraction of coefficients retained) and reconstruction fidelity (measured via PSNR) in DCT-based image compression?
12. How does the DCT compare with the DFT in terms of energy-compaction performance for image data?
Significance of the Study
This research carries value across several dimensions. From an academic standpoint, it offers undergraduate mathematics students a self-contained treatment that links classical Fourier analysis to modern digital signal and image processing — a field of growing importance given the rapid expansion of data science, telecommunications, and multimedia technology. From a practical standpoint, the quantitative results generated in this study, particularly the convergence tables and PSNR-versus-compression-ratio figures, provide concrete numerical benchmarks that engineers and computer scientists can reference when designing filtering or compression systems.
Pedagogically, the project makes abstract convergence concepts — the Gibbs phenomenon being a prime example — tangible through direct computation, which is often difficult for students to grasp from theory alone. Finally, by presenting a reproducible computational framework, the study contributes to the wider mathematical literature on transform-domain methods, offering a foundation that can be extended to other transforms, including wavelet-based approaches.
Scope of the Study
This study is deliberately scoped to keep its computational treatment analytically clear and manageable. It focuses on three core areas: first, the classical Fourier series representation of periodic, piecewise-smooth, one-dimensional signals, using a square wave as a canonical example of a discontinuous test signal; second, the Discrete Fourier Transform as the discrete counterpart of the continuous Fourier transform; and third, the two-dimensional Discrete Cosine Transform applied to a single-channel (grayscale) synthetic test image measuring 128 × 128 pixels, using a global, whole-image transform-and-truncate approach rather than the block-wise 8 × 8 scheme used in the full JPEG pipeline.
The study does not extend into colour-space transformations such as YCbCr, chroma subsampling, run-length or entropy coding (e.g., Huffman coding), or video compression. While these components form part of the complete JPEG and MPEG pipelines, they fall outside the specific mathematical scope of Fourier and DCT analysis addressed in this research.
Operational Definition of Terms
Signal: A function that conveys information about the state or behaviour of a physical system, typically expressed as a function of time or space.
Periodic Function: A function f(t) that satisfies f(t + T) = f(t) for every value of t, where T is a fixed positive constant known as the period.
Fourier Series: A representation of a periodic function as an infinite sum of sine and cosine terms (or, equivalently, complex exponentials) whose frequencies are integer multiples of a fundamental frequency.
Harmonic: An integer multiple of the fundamental frequency of a periodic signal.
Gibbs Phenomenon: The persistent overshoot — roughly 9% of the size of a jump discontinuity — exhibited by Fourier partial sums near that discontinuity, which does not disappear even as more terms are added.
Discrete Fourier Transform (DFT): A transform that converts a finite sequence of equally spaced samples into a same-length sequence of complex numbers representing the frequency content of that sequence.
Discrete Cosine Transform (DCT): A transform closely related to the DFT that expresses a finite sequence of data points as a sum of cosine functions oscillating at different frequencies, using only real-valued coefficients.
Energy Compaction: The property of a transform whereby most of a signal's energy becomes concentrated into a relatively small number of coefficients.
Compression Ratio: The ratio between the amount of data needed to represent the original signal or image and the amount needed to represent its compressed version.
Peak Signal-to-Noise Ratio (PSNR): A logarithmic measure, expressed in decibels, of the ratio between the maximum possible signal value and the magnitude of the error introduced during reconstruction.
Conclusion
Fourier series and its discrete transform counterparts remain among the most powerful and versatile tools in applied mathematics, bridging the gap between abstract theoretical analysis and practical digital technology. This study has shown, through both rigorous theory and hands-on computation, how a periodic signal can be reconstructed from a limited number of harmonics, why the Gibbs phenomenon persists no matter how many terms are used, and how the Discrete Cosine Transform underpins efficient, high-fidelity image compression. Together, these findings reaffirm that Fourier-based methods are not merely historical curiosities but active, essential components of the digital systems we rely on every day.
Frequently Asked Questions
1. What is a Fourier series used for in signal processing?
A Fourier series is used to break a periodic signal down into a sum of simple sine and cosine waves, making it possible to analyse, filter, compress, and reconstruct the signal based on its individual frequency components.
2. What is the difference between the Fourier series and the Fourier transform?
A Fourier series applies to periodic functions and expresses them as a discrete sum of harmonics, whereas the Fourier transform applies more generally to non-periodic (or aperiodic) signals and produces a continuous frequency spectrum.
3. What is the Discrete Fourier Transform (DFT)?
The DFT is the discrete-domain counterpart of the continuous Fourier transform. It converts a finite sequence of sampled data points into a same-length sequence of complex numbers that describe the signal's frequency content, making frequency analysis possible on digital computers.
4. Why is the Fast Fourier Transform (FFT) important?
The FFT is an efficient algorithm for computing the DFT. Instead of requiring a large number of computations, it dramatically speeds up frequency analysis, which is why it is considered one of the most important algorithms in digital signal processing.
5. What is the Gibbs phenomenon, and why does it matter?
The Gibbs phenomenon is a persistent overshoot, of about 9% of the signal's jump size, that appears in Fourier partial sums near a discontinuity. It matters because it shows that adding more terms improves overall approximation accuracy but does not eliminate localized error near sharp transitions.
6. How does the Discrete Cosine Transform (DCT) relate to image compression?
The DCT concentrates most of an image's visual information into a small number of low-frequency coefficients. This energy-compaction property allows high-frequency coefficients to be discarded or simplified with minimal visible quality loss, which is the mathematical basis of JPEG-style compression.
7. What does PSNR measure in image compression?
PSNR, or Peak Signal-to-Noise Ratio, measures how closely a compressed and reconstructed image matches the original. Higher PSNR values, typically expressed in decibels, indicate better reconstruction fidelity and less visible distortion.
8. Why is the DCT preferred over the DFT for image compression?
The DCT generally achieves stronger energy compaction than the DFT for typical image data, meaning it packs more of the image's important information into fewer coefficients. This makes it more efficient for compression purposes, which is why it forms the core of the JPEG standard.
9. What is Parseval's theorem, and why is it relevant here?
Parseval's theorem states that the total energy of a signal is conserved between the time domain and the frequency domain. It provides the theoretical justification for why concentrating a signal's energy into fewer coefficients (as the DCT does) allows for effective compression without proportional loss of information.
10. Can Fourier-based compression achieve lossless results?
Not typically. Most practical Fourier and DCT-based compression schemes are lossy, meaning some information is discarded to reduce file size. However, by carefully selecting which coefficients to keep, it is possible to achieve high compression ratios while preserving strong visual or signal fidelity.
Purchase to unlock the full material.