Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
4 views18 pages

Discrete Fourier Transform

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

Discrete Fourier Transform

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

Discrete Fourier Transform

• The Discrete Fourier Transform (DFT) is used


to convert spatial domain data (images) into
frequency domain.
• Frequency domain analysis helps us
understand patterns, textures, and periodic
noise in images.
1D Discrete Fourier Transform (DFT)

• Converts a sequence of N discrete values to frequency components.


• Periodic input → periodic spectrum
• Output is complex-valued (magnitude + phase)
2D Discrete Fourier Transform

Used to extract frequency content in both


horizontal and vertical directions.
Properties of the 2D DFT

• Linearity: DFT(a + b) = DFT(a) + DFT(b)


• Translation: Shifting image causes phase shift in frequency
domain
• Conjugate Symmetry: For real-valued images, the DFT has
symmetric properties
• Periodicity: DFT is periodic in both spatial and frequency
domains
• Separable: 2D DFT can be computed as two 1D DFTs (row-
wise, then column-wise)
• Convolution Theorem: Convolution in space =
multiplication in frequency domain
Sampling and the Frequency Domain

• Sampling: The process of converting a continuous


image into a discrete one
• Spectrum Replication: Sampling in spatial domain
causes periodic repetition in frequency domain
• Aliasing: Overlap of these repetitions due to
under-sampling
• Nyquist Sampling Theorem:
• To avoid aliasing, the sampling frequency must be
at least 2× the highest frequency in the image.
Example 1: 2×2 Matrix
• Let the image f(x,y) be:
DFT on a Image
Discrete Cosine Transform
• DCT is primarily used in image compression
(e.g., JPEG).
• Transforms spatial domain data to frequency
domain using only cosine functions.
• Avoids complex numbers — output is real-
valued.
2D DCT Formula:
DCT is similar to DFT but uses only cosine basis functions.
More energy is concentrated in fewer coefficients (mostly upper-left corner).
Efficient for compression because many DCT coefficients can be zeroed with little image
quality loss.
JPEG Compression Example:
Break image into 8×8 blocks.
Apply 2D DCT to each block.
Quantize and store only the most significant
coefficients.
Properties:
Separability
Energy compaction
Orthogonality
2×2 Image DCT (Numerical Example)
DCT on a Image
Original Image Block (8×8)

This is a small grayscale patch (values from 0–255, float32):

[[ 52. 55. 61. 66. 70. 61. 64. 73.]


[ 63. 59. 55. 90. 109. 85. 69. 72.]
[ 62. 59. 68. 113. 144. 104. 66. 73.]
[ 63. 58. 71. 122. 154. 106. 70. 69.]
[ 67. 61. 68. 104. 126. 88. 68. 70.]
[ 79. 65. 60. 70. 77. 68. 58. 75.]
[ 85. 71. 64. 59. 55. 61. 65. 83.]
[ 87. 79. 69. 68. 65. 76. 78. 94.]]
DCT Applied (Frequency Domain)

• After applying 2D DCT:


• The top-left values are low-frequency
coefficients (overall brightness and slow
changes).
• The bottom-right values are high-frequency
coefficients (fine details or noise).
[[ 608.6, -30.2, -61.2, 27.2, 56.1, -20.1, -2.4, 0.5],
[ 4.5, -21.9, -60.8, 10.3, 13.1, -7.1, -8.5, 4.9],

Compression Step

We keep only the top-left 4×4 DCT coefficients and


zero the rest, like:
[[ 608.6, -30.2, -61.2, 27.2, 0, 0, 0, 0],
[ 4.5, -21.9, -60.8, 10.3, 0, 0, 0, 0],
[-46.8, 7.4, 77.1, -24.6, 0, 0, 0, 0],
[-48.5, 12.1, 34.1, -14.8, 0, 0, 0, 0],
...
• This step reduces the data stored from 64 values
to just 16 → 75% compression (approx.).
Reconstruction Using Inverse DCT (IDCT)

• convert this compressed matrix back to image


space using IDCT:
[[ 53.8, 56.6, 60.2, 62.3, 63.3, 64.6, 66.9, 68.9],
[ 53.7, 59.3, 71.4, 86.8, 96.5, 92.7, 77.6, 64.0],
[ 54.1, 62.3, 82.8, 111.3, 129.6, 120.2, 87.1, 57.4],
[ 56.3, 64.1, 84.3, 113.1, 131.4, 120.8, 85.4, 53.8],
...
• This is visually close to the original, but not exact —
some detail is lost, especially at high frequencies.
Compression

• Original size: 8×8 = 64 coefficients


• Compressed size: 4×4 = 16 coefficients
• Compression ratio: 16 / 64 = 25% data
retained, 75% discarded
• Visual impact: Still looks close to original
DFT vs. DCT Summary Table
Aspect DFT DCT
Output Complex numbers Real numbers
Used in Filtering, analysis Compression (JPEG)
Basis Function Complex exponentials Cosines
DC Component includes all pixel values includes average value
High (better for
Energy Compaction Moderate
compression)

You might also like