# Matlab programming of DCT and FFT

Feb 3rd, 2012
Studypool Tutor
Price: \$5 USD

Tutor description

Matlab programming of DCT and FFT. Just copy the programme and run with MATLAB Software. dont forget give the path of the image. Matlab programming of DCT and FFT

Word Count: 382
Showing Page: 1/4
clear all;p=imread('kaka.jpg'); %%%%%%%%%%%give path of the picturea=imresize(p,[100,100]);%DCTZ(:,:,1)=dct2(a(:,:,1));Z(:,:,2)=dct2(a(:,:,2));Z(:,:,3)=dct2(a(:,:,3)); for i=1:100 for j=1:100 if((i+j)>60) Z(i,j,1)=0; Z(i,j,2)=0; Z(i,j,3)=0; end endendK(:,:,1)=idct2(Z(:,:,1));K(:,:,2)=idct2(Z(:,:,2));K(:,:,3)=idct2(Z(:,:,3));subplot(2,4,1);%imshow(Z);imshow(uint8(K));title('70% compression');Z(:,:,1)=dct2(a(:,:,1));Z(:,:,2)=dct2(a(:,:,2));Z(:,:,3)=dct2(a(:,:,3)); for i=1:100 for j=1:100 if((i+j)>100) Z(i,j,1)=0; Z(i,j,2)=0; Z(i,j,3)=0; end endendK(:,:,1)=idct2(Z(:,:,1));K(:,:,2)=idct2(Z(:,:,2));K(:,:,3)=idct2(Z(:,:,3));subplot(2,4,2);%imshow(Z);imshow(uint8(K));title('50% compression');Z(:,:,1)=dct2(a(:,:,1));Z(:,:,2)=dct2(a(:,:,2));Z(:,:,3)=dct2(a(:,:,3)); for i=1:100 for j=1:100 if((i+j)>140) Z(i,j,1)=0; Z(i,j,2)=0; Z(i,j,3)=0; end endendK(:,:,1)=idct2(Z(:,:,1));K(:,:,2)=idct2(Z(:,:,2));K(:,:,3)=idct2(Z(:,:,3))

## Review from student

Studypool Student
" <3 it, thanks for saving me time. "

1829 tutors are online

### Other Documents

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors