% %%%%% Orthogonality %%%%%%%%%%
%%%%%%% SURAJ BASTOLA %%%%%%%%%%%%%%
N = 4;
df = 2;
f = 100:df:20+(N-1)*df;
T = 1/df; % different values of symbol duration
t = linspace(0,T,1000);
x = zeros(N, length(t));
for i = 1:length(f)
x(i,:) = sin(2*pi*f(i)*t);
subplot(N*2,1,i);
plot(t,x(i,:));
end
for i = 1:N
for j = i+1:N
if i==1
subplot(N*2,1,N+j);
plot(t,x(i,:).*x(j,:));
end
fprintf("Correlation(f%d,f%d) = %f \n",i,j,mean(x(i,:)),x(j,:));
end
end
No comments:
Post a Comment