Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clc; clear all;
- %x = [0 1 2 1; 1 2 3 2; 2 3 4 3; 1 2 3 2];
- x = double(imread('cameraman.tif'));
- n = length(x);
- DFT_matrix = exp(-2i * pi / n * [0:n-1]' * [0:n-1])
- %DFT_matrix = [1 1 1 1; 1 -i -1 i; 1 -1 1 -1; 1 i -1 -i];
- step1=zeros(n);
- for i=1:n %Row multiplications
- step1(i, :) = DFT_matrix*x(i, :)';
- end
- step2=zeros(n);
- for i=1:n %Col multiplications
- step2(:, i) = DFT_matrix*Step1(:,i);
- end
- figure(1), imshow(uint8(x));
- figure(2), imshow(uint8(Step2));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement