Skip to content

Alrightlone/Frequency-Domain-Filtering

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Digital Image Processing: Frequency Domain Filtering & Restoration

This repository contains the MATLAB implementation for a Digital Signal Processing (DSP) project focused on Frequency Domain Filtering and Image Restoration.

📌 Project Overview

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 ($D_0, n$).

📊 Experimental Results

1. Spectrum Analysis

Visualization of the frequency components. The log-transformation reveals high-frequency details that are otherwise invisible due to the dominant DC component.

Spectrum Analysis Figure 1: Original Image and its Log-Magnitude Spectrum.


2. Low Pass Filtering: Ideal vs. Butterworth

Comparison of smoothing filters ($D_0=30$).

  • Ideal Filter: Shows significant "ringing" artifacts (Gibbs phenomenon).
  • Butterworth Filter: Produces a smooth result with minimal artifacts.

Low Pass Comparison Figure 2: Comparison of Ideal (Left) and Butterworth (Right) Low Pass Filters.


3. High Pass Filtering (Edge Detection)

Application of High Pass filters to attenuate low-frequency backgrounds and enhance edges.

High Pass Comparison Figure 3: Comparison of Ideal (Left) and Butterworth (Right) High Pass Filters.


4. Parameter Analysis: Cutoff Frequency ($D_0$)

Investigation of how $D_0$ affects blurring and ringing ($n=2$).

  • Low $D_0$ (10): Severe blurring.
  • High $D_0$ (80): Preserves more detail.

Cutoff Analysis Figure 4: Impact of varying Cutoff Frequency ($D_0$) on Ideal (Top) and Butterworth (Bottom) filters.


5. Parameter Analysis: Filter Order ($n$)

Investigation of how the Butterworth order $n$ affects sharpness ($D_0=40$).

  • Low Order ($n=1$): Very smooth but "muddy".
  • High Order ($n=20$): Sharp cutoff but re-introduces ringing (approaching Ideal filter behavior).

Order Analysis Figure 5: Effect of increasing Filter Order ($n$) from 1 to 20.


6. Periodic Noise Removal (Notch Filtering)

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.

Noise Removal Figure 6: Periodic Noise Removal workflow. Top: Noisy input. Bottom: Filter mask and restored image.

🚀 Usage

  1. Prerequisites: MATLAB (R2024b or later recommended for exportgraphics).
  2. Run the Simulation:
    • Open main.m in MATLAB.
    • Ensure the input image (e.g., beauty.png) is in the same directory.
    • Run the script.
  3. Output: The script will generate and save result figures automatically.

📂 File Structure

.
├── 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

About

Digital Image Processing: Frequency Domain Filtering & Restoration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages