This repository contains the MATLAB implementation for a Digital Signal Processing (DSP) project focused on Frequency Domain Filtering and Image Restoration.
The objective of this project is to explore the properties of the 2D Discrete Fourier Transform (DFT) and apply various filtering techniques to enhance images and remove noise. The project investigates the trade-offs between different filter types (Ideal vs. Butterworth) and parameters (
Visualization of the frequency components. The log-transformation reveals high-frequency details that are otherwise invisible due to the dominant DC component.
Figure 1: Original Image and its Log-Magnitude Spectrum.
Comparison of smoothing filters (
- Ideal Filter: Shows significant "ringing" artifacts (Gibbs phenomenon).
- Butterworth Filter: Produces a smooth result with minimal artifacts.
Figure 2: Comparison of Ideal (Left) and Butterworth (Right) Low Pass Filters.
Application of High Pass filters to attenuate low-frequency backgrounds and enhance edges.
Figure 3: Comparison of Ideal (Left) and Butterworth (Right) High Pass Filters.
Investigation of how
-
Low
$D_0$ (10): Severe blurring. -
High
$D_0$ (80): Preserves more detail.
Figure 4: Impact of varying Cutoff Frequency ($D_0$) on Ideal (Top) and Butterworth (Bottom) filters.
Investigation of how the Butterworth order
-
Low Order (
$n=1$ ): Very smooth but "muddy". -
High Order (
$n=20$ ): Sharp cutoff but re-introduces ringing (approaching Ideal filter behavior).
Figure 5: Effect of increasing Filter Order ($n$) from 1 to 20.
Restoration of an image corrupted by sinusoidal noise.
- Technique: Identifying conjugate noise spikes in the spectrum and applying a selective Notch Filter.
- Result: Noise is removed while preserving global image details.
Figure 6: Periodic Noise Removal workflow. Top: Noisy input. Bottom: Filter mask and restored image.
- Prerequisites: MATLAB (R2024b or later recommended for
exportgraphics). - Run the Simulation:
- Open
main.min MATLAB. - Ensure the input image (e.g.,
beauty.png) is in the same directory. - Run the script.
- Open
- Output: The script will generate and save result figures automatically.
.
├── main.m # Main MATLAB script for all experiments
├── hyper_para.m # MATLAB script for cut-off frequency and filter order analysis
├── beauty.png # Input image file
├── DSP_final_project.pdf # Final report
├── figures/ # Output folder for saved results
│ ├── Fig1.png
│ ├── Fig2.png
│ └── ...
└── README.md # Project documentation