0% found this document useful (0 votes)
11 views3 pages

Question Advlab Project

None
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

Question Advlab Project

None
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

What is the purpose of using fftshift and ifftshift in your MATLAB code?

fftshift rearranges the Fourier transform so that the zero-frequency component is at the
center of the image, which makes filtering and visualization more intuitive. After applying
the low-pass filter, ifftshift is used to reverse that rearrangement before taking the inverse
FFT (ifft2). Without these, the filter mask would not align correctly with the intended
frequency components.

How does the Euclidean distance matrix D help create the filter mask H?

The distance matrix D calculates the distance of each point in the frequency domain from
the center (zero-frequency). The ideal low-pass filter mask H is then defined as 1 (pass) for
all points where the distance is less than or equal to the cutoff frequency D0, and 0 (block)
otherwise. This retains low-frequency components and filters out high-frequency noise.

Why use log(1 + abs(...)) for spectrum visualization?

The spectrum values from the FFT can have a very wide dynamic range. Using log(1 +
abs(...)) compresses that range, making both strong and weak frequencies visible. Without
the log scale, only the most dominant frequency components would be visible, and the rest
would appear black.

Why convert images to double and normalize to [0, 1]?

MATLAB's image functions often require normalized values for consistent processing,
especially when performing mathematical operations like FFT or noise addition. Converting
to double ensures we can do accurate arithmetic, and normalizing to [0, 1] makes the results
consistent regardless of image brightness.

How does your loop handle multiple images, and what if an RGB image isn’t converted?

The loop iterates through each file in the list and applies the same processing steps. If an
RGB image isn’t converted to grayscale, FFT would be applied to a 3-channel image, which
could cause errors or unintended behavior. That's why we check for 3 channels and apply
rgb2gray.
How is noise added using imnoise, and why use mean = 0, variance = 0.01?

imnoise(img, 'gaussian', 0, 0.01) adds Gaussian noise with zero mean and 0.01 variance. This
simulates a common real-world scenario where sensor noise or transmission noise is
normally distributed. The low variance ensures the image is still somewhat visible, making it
ideal for testing denoising filters.

Why use only the real part of ifft2 with real()?

FFT and IFFT operations can introduce tiny imaginary components due to rounding errors.
However, the actual image is real-valued, so we use real() to discard the imaginary part and
get a clean, real-valued image output.

How does your program automate the image denoising process?

The script is fully automated to process all images in a list—loading, converting, adding
noise, filtering, transforming, and displaying results. It runs through a loop, so adding more
images just requires updating the filename list. This makes it scalable and reusable in larger
applications.

What artifacts can the ideal filter introduce, and how does your code show them?

The ideal filter has a sharp cutoff, which can cause ringing artifacts in the spatial domain
(Gibbs phenomenon). These appear as faint ripples around the edges in the image. The
spectrum plots and filtered image help visualize whether such artifacts are present.
Smoother filters like Gaussian could reduce this issue.

What is the role of meshgrid in your filter design?


meshgrid generates two matrices, u and v, that represent the horizontal and vertical
frequency coordinates across the frequency domain. These are used to compute the
Euclidean distance matrix D = sqrt(u.^2 + v.^2), which is essential for constructing the
circular low-pass filter mask.

What would happen if the cutoff frequency D0 is set too low or too high?

If D0 is too low, the filter removes too much detail, making the image overly smooth or
blurry. If it's too high, not enough noise is filtered out, and the denoising effect becomes
weak. Choosing D0 = 100 balances noise removal and detail retention in this project.
Why is subplot used, and how does it aid in your analysis?

subplot organizes multiple visualizations (original, noisy, filtered image, spectra, and filter
mask) into a single figure. This side-by-side comparison is crucial to visually assess the
effectiveness of the filter and understand how each step impacts the image.

What improvements would you suggest for processing colored images?

Currently, images are converted to grayscale, so color information is lost. For colored images,
I’d apply the same frequency-domain denoising to each color channel (R, G, B) separately
and then reconstruct the RGB image. This preserves color while reducing noise.

Can you explain how filtering in the frequency domain is mathematically equivalent to
convolution in the spatial domain?

By the Convolution Theorem, convolution in the spatial domain corresponds to


multiplication in the frequency domain. So, multiplying the FFT of an image with a filter
mask is equivalent to convolving the image with a kernel. This is more efficient for large
kernels or global filters.

How does your MATLAB code demonstrate reproducibility and scalability?

By using loops, parameterized variables (like D0), and modular code (image list, consistent
steps), the same denoising process is applied to any number of images consistently. It’s
reproducible because each step is defined, and scalable because we just need to add
filenames or expand the loop.

What are the limitations of using an ideal low-pass filter, and how can you address them in
code?

Ideal filters have a hard cutoff, leading to ringing artifacts and abrupt transitions. This can be
addressed by implementing smoother filters (like Gaussian or Butterworth) or by using
adaptive filtering techniques that consider image features dynamically.

How does MATLAB handle complex numbers in FFT results, and why is abs() used?

FFT outputs are complex numbers. abs() computes the magnitude of these values, which is
used to display the spectrum. For visualization or energy analysis, we need magnitude; for
spatial reconstruction, we typically only use the real part of the inverse FFT.

You might also like