Digital Signal Processing Reference
In-Depth Information
f [ n ]
2
1
4
3
2
1
0
1
2
3
4
n
Figure P12.28
12.29. (a) Draw an eight-point DIT FFT signal-flow diagram, and use it to solve for the DFT
of the sequence shown in Figure P12.2(a).
(b) Use MATLAB to confirm the results of part (a).
12.30. (a) Draw an eight-point DIF FFT signal-flow diagram and use it to solve for the DFT
of the sequence shown in Figure P12.2(a).
(b) Use MATLAB to confirm the results of part (a).
12.31 Image Compression by the Two-Dimensional Discrete Cosine Transform
Here, you will use a full-frame two-dimensional discrete cosine transform to imple-
ment a very simple image compression algorithm. The 2D DCT and the inverse 2D
DCT functions are implemented in MATLAB with the functions dct2() and idct2().
(a) Obtain a grayscale image and read it into MATLAB.
(b) Compute the image's DCT coefficients, using the dct2() command. Inverse the
transform coefficients, using the idct2() command. Display the inverse trans-
formed image (remember to convert it to uint8 first) and make sure that you are
getting your image back.
(c) Write a MATLAB function that has an input argument for the percentage of DCT
coefficients corresponding to the lowest horizontal and vertical frequencies (i.e.,
the upper left portion of the matrix of DCT coefficients) you will keep. The rest of
the coefficients will be set to zero (a very crude form of signal compression).
Using this function, keep 50, 25, 15, 10, 5, and 1 percent of the lowest frequency
coefficients and set the rest to zero. For each case, obtain the inverse image.
(i) At what percent do you start to notice degradation in the image quality?
(ii) Why do we keep the lower frequency coefficients instead of the higher
frequency coefficients?
Print out and turn in
(i) the original image:
(ii) the image with just 1% of the DCT coefficients;
(iii) the image at which you notice degradation in the image quality.
 
Search WWH ::




Custom Search