The final
The final
how many points you want to calculate in time range [a, b] (in the code we take a = 0, b = 1).
For the for loop method we used the definition of DFT (Discrete Fourier Transform):𝑋[𝑘] =
𝑖2𝜋𝑘𝑛
−
∑𝑁−1
𝑛=0 𝑥[𝑛]𝑒 𝑁 . iimilarly, we separate them in real and imaginary part, and calculated them
𝑁
individually. For the same reason we only calculate to + 1, where 𝑁 means the length of the signal.
2
After the calculation we did above, we compare the result with the real Fourier transform in numpy, and
it came out really good( due to the length of the report, the result can be seen in the supplementary
materials file).
The main difference between FT and DFT is that FT provides a comprehensive spectrum of non-
periodic continuous signals but requires whole signal processing. DFT, useful for digital signals, it can
process discrete and finite data, so DFT is more efficient than FT.
This is Patrick and his Fourier transform. In frequency domain, “low frequency” is in the center of
the picture and the “high frequency” is at the edge of the picture. The frequency of 2D Fourier transform
means the variance ratio of luminance.
↑picture 1
For example, let’s do Fourier transform alone the red line. The black part in picture 1 will be the
high frequency signal and the gray part will be the low frequency signal.
In order to prove that the low frequency is in the
middle of the frequency domain picture. We dig out
the center of the frequency domain Patrick, and
then do inverse Fourier transform on it.The
frequency domain Patrick left only the edge of itself,
where the variance ratio of luminace is the biggest.
3. Image denoising
Purpose: To erase or reduce the noise of picture.
Median filter will compare a pixel and pixels around it, and arrange them in ascending order of
luminance, and then change the pixel in center into the median of the arrangement.
The number 3 in the code means the size to compare. Because median filter needs a center to
calculate, therefore the number can only be odds. The “noise” in the code is the picture that need
to denoise.
(2) Mean filter
Mean filter will compare a pixel and pixels around it, and then change its luminance into the mean
luminance of all pixels in the area you choose.
The (3,3) in the code means the size to compare, the first one is the width and the second one is
the height. The “noise” in the code is the picture that need to denoise.
(3) Gaussian filter
Gaussian filter is a little bit similar to mean filter, the difference between them is that the weights
of every pixel is the same, but the weights of gaussian filter is like the gaussian distribution, the
more it close to the center the higher the weight.
The (3,3) is the size to calculate. The number “0.8” is the standard deviation, the smaller it is the
bigger the weight of the center. The “noise” in the code is the picture that need to denoise.
These are pictures with pepper noise after denoising. Due to the way median filter calculate, it can
erase the noise that extremely high or low, so it can erase the pepper noise perfectly. Basically,
mean filter and gaussian filter just blur the picture.
These are pictures with white noise after denoising. Because white noises are noises with all
luminance, therefore median filter can’t do its job well. In this case, the effect of mean filter and
gaussian filter is pretty good, and the result of gaussian filter is sharper than mean filter.