clear all, close all


Fs = 1000;   
t = 0:1/Fs:.3;
x = cos(2*pi*t*300)+randn(size(t));  % A cosine of 300Hz plus noise
figure(10)
periodogram(x,[],'twosided',512,Fs);


pause

A0 = imread('baylorfootball.jpg');
figure(1)
imshow(A0)

A = rgb2gray(A0);
figure(2)
imshow(A)


spectrumA = abs(fft2(A)).^2;
spectrumA = spectrumA/(size(A,1)*size(A,2));

spectrumAshift = fftshift(spectrumA);

figure(3)
surf(spectrumAshift)

Afreq = fft2(A);

for p = 1:size(A,1)
    for q = 1:size(A,2)
        if (spectrumA(p,q) > 50000) Afreq(p,q) = 50000;
        end
    end
end

B = ifft2(Afreq);

figure(4)
image(B)