Untitled

 avatar
unknown
plain_text
a year ago
777 B
3
Indexable
% -----------------------------------
% Course: GSP Winter Semester 2024 - BGU
% Assignment #3
% Written by Sagi Cohen 318550597
% ------------------------------------
clear; close all;
%% Q1
% sec 1
N = 6;
A_DC = cyclic_graph(N);
figure();
imagesc(A_DC);
colormap(gray);
xlabel('Vertices');
ylabel('Vertices');
title(['Q1(sec1): Adjacency Matrix of Directed Unweighted Cyclic Graph A_D_C With N=',num2str(N)]);
colorbar
%sec 2 a+b
F_N = dftmtx(N);
lambda1 = A_DC * F_N * A_DC.';
% DFT - matrix reoresentation of the formula
DFT_operator = zeros(N,N);
for k = 1:N
    for n = 1:N
        DFT_operator(k,n) = exp(-1j*(2*pi*k/N)*n);
    end
end
fprintf("The sum of differences between lambda1 and DFT matrix is: %f\n",sum(sum(lambda1 - DFT_operator)));
Editor is loading...
Leave a Comment