Wednesday, December 13, 2006

1.

(a) The complex conjugate of a complex number is the number with the same real value and imaginary magnitude, but the imaginary part is opposite in sign.

...

3.
* scale plots/images

A convolution is the result of the application of an impulse response function to an input signal.
The input signal consists of a series of samples (impulses) of various magnitudes. Each input produces a corresponding input response function

Since 'B' is composed of horizontal line samples, it appears as a horizontal broken line in the fourier transform. Conversely, the 'A' being composed of vertical lines appears as a vertical line in the fourier transform.

The diagonal crosspieces of the 'A' show up as rotated diagonals in the fourier transform, while the curving edges of the 'B' show up most as the vaguely rounded shapes at the edges of the horizontal line in the centre of the plot.


clear;
load 'p:\public\alistair\ab'

subplot(3,2,1), image(final);
colormap(gray(256));
y = fft2(final);
subplot(3,2,2), image(256*log(abs(y))/max(max(log(abs(y)))));
ydim = size(y, 1);

xdim = size(y, 2);
mask = zeros(ydim, xdim);
msize = 140;
mask(:, (xdim/2-msize/2):(xdim/2+msize/2)) = 1;

mask2 = zeros(ydim, xdim);
mask2((ydim/2-msize/2):(ydim/2+msize/2), :)=1;

y2 = mask .* y;
ya = ifft2(y2);

y3 = mask2 .* y;
yb = ifft2(y3);

subplot(3,2,3), image(abs(ya));
subplot(3,2,4), image(256*log(abs(y2))/max(max(log(abs(y2)))));

subplot(3,2,5), image(abs(yb));
subplot(3,2,6), image(256*log(abs(y3))/max(max(log(abs(y3)))));


----

lenna....

clear;
load 'p:publicalistairlenna';
subplot(2,3,1), image(xx);
colormap(gray(256));

ynew = 512;
xnew = 512;

scaled = zeros(ynew, xnew);
scaled(1:2:ynew, 1:2:xnew) = xx;

y = fft2(scaled);

subplot(2,3,2), image(256*log(abs(y))/max(max(log(abs(y)))));
subplot(2,3,3), image(ifft2(y));
mask = zeros(ynew, xnew);
msize = 128;

mask((ynew/2-msize):(ynew/2+msize),(xnew/2-msize):(xnew/2+msize)) = 1;
ya = mask .* y;

subplot(2,3,4), image(256*log(abs(ya))/max(max(log(abs(ya)))));
scaledimg = abs(ifft2(ya));
subplot(2,3,5), image(256*scaledimg/max(max(scaledimg)));


No comments:

Post a Comment