diff --git a/Assignment4_211/assignment4.4.m b/Assignment4_211/assignment4.4.m deleted file mode 100644 index 7eae517..0000000 --- a/Assignment4_211/assignment4.4.m +++ /dev/null @@ -1,33 +0,0 @@ -clear; close all; clc; - -N = 128; -n = 0:N-1; -w1 = 2*pi*0.1; -w2 = 2*pi*0.15; -x = cos(w1*n) + cos(w2*n); - -% a) - -X = fft(x); -magX = abs(X); - -figure; -stem(n, magX, 'filled'); -xlabel('n'); -ylabel('|X[n]|'); -title('Magnitude Spectrum of x[n]'); -grid on; - -% b) - -y = hamming(N)' .* x; - -Y = fft(y); -magY = abs(Y); - -figure; -stem(n, magY, 'filled'); -xlabel('n'); -ylabel('|Y[n]|'); -title('Magnitude Spectrum of y[n]'); -grid on; diff --git a/Assignment4_211/assignment4_1.m b/Assignment4_211/assignment4_1.m deleted file mode 100644 index 5c88e67..0000000 --- a/Assignment4_211/assignment4_1.m +++ /dev/null @@ -1,33 +0,0 @@ -clc; -clear; -close all; - -%% Parameters -f1 = 2000; -f2 = 4000; -f3 = 6000; - -f3_rec = -3000 - -%% Time vectors -t=0:1e-6:1e-3; - -%% Signals -x = 1+0.5*cos(2*pi*f1*t)+2*sin(2*pi*f2*t)+sin(2*pi*f3*t); -x1 = 1+0.5*cos(2*pi*f1*t)+2*sin(2*pi*f2*t)+sin(2*pi*f3_rec*t); -x2 = 1+0.5*cos(2*pi*f1*t)+2*sin(2*pi*f2*t)+sin(2*pi*f3*t); - -%% Plot -figure -hold on - -plot(t, x, 'b', 'LineWidth', 1.5) -plot(t, x1, 'r', 'LineWidth', 1.5) -plot(t, x2, '--g', 'LineWidth', 1.5) - -grid on - -xlabel('Time (ms)') -ylabel('x(t)') - -legend('x(t)', 'x1(t)', 'x2(t)'); diff --git a/Assignment4_211/assignment4_3.m b/Assignment4_211/assignment4_3.m deleted file mode 100644 index 55d9e47..0000000 --- a/Assignment4_211/assignment4_3.m +++ /dev/null @@ -1,51 +0,0 @@ -clear; close all; clc; - -img = imread('pavian.png'); % Choose any picture you like here -img = rgb2gray(img); - -%% Display image -figure; subplot(131); -imshow(img); -title('Ausgangsbild'); - -%% FFT -fft2d = fft2(img); - -% Display the FFT image. -subplot(132); -imshow(log(fftshift(abs(fft2d))), []); -title('2D-FFT'); - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% - -% Approach: We want to remove the low frequencies (high pass filter) to -% keep the areas of the image where the lightness changes relative to -% nearby pixels - -% Shift FFT so low frequencies are in the center -F = fftshift(fft2d); - -% Get image size -[M, N] = size(F); - -% Radius of how much to remove -r = 25; - -% We cut out the center of the fft low frequencies -H = ones(M, N); -H(M/2-r:M/2+r, N/2-r:N/2+r) = 0; - -% Apply filter -F_filtered = F .* H; - -% Shift back -fft2d = ifftshift(F_filtered); - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% IFFT to obtain filtered image -img_filtered = ifft2(fft2d); -subplot(133); -imshow(real(img_filtered), []); -title('Gefiltertes Ausgangssignal'); diff --git a/fig/fig1.1.png b/fig/fig1.1.png deleted file mode 100644 index e59c39f..0000000 Binary files a/fig/fig1.1.png and /dev/null differ diff --git a/fig/fig1.2.png b/fig/fig1.2.png deleted file mode 100644 index 69d6c6f..0000000 Binary files a/fig/fig1.2.png and /dev/null differ diff --git a/fig/fig1.3.png b/fig/fig1.3.png deleted file mode 100644 index cee577c..0000000 Binary files a/fig/fig1.3.png and /dev/null differ diff --git a/fig/fig1.4.png b/fig/fig1.4.png deleted file mode 100644 index 7f193fa..0000000 Binary files a/fig/fig1.4.png and /dev/null differ diff --git a/fig/fig3.1.png b/fig/fig3.1.png deleted file mode 100644 index 91617eb..0000000 Binary files a/fig/fig3.1.png and /dev/null differ diff --git a/fig/fig4.1.png b/fig/fig4.1.png deleted file mode 100644 index 36a5936..0000000 Binary files a/fig/fig4.1.png and /dev/null differ diff --git a/fig/fig4.2.png b/fig/fig4.2.png deleted file mode 100644 index 0277f32..0000000 Binary files a/fig/fig4.2.png and /dev/null differ