% Active Passive RIS Comparison % 08.04.2021 % by Ertugrul Basar - CoreLab % Present and Future of Reconfigurable Intelligent Surface-Empowered Communications clear all;clc % System Parameters PTdBm=20; %transmit power PT=10^([(PTdBm-30)]/10); PAdBm=20; %max reflect power PA=10^([(PAdBm-30)]/10); Sigma2dBm=-90; % noise power Sigma2=10^([(Sigma2dBm-30)]/10); Sigmav2dBm=-90; % RIS noise power Sigmav2=10^([(Sigmav2dBm-30)]/10); freq=5*10^9; % frequency lambda=(3*10^8)/freq; % wavelength N=256; % RIS size B=N*lambda/2 ; %far-field boundry % Coordinates AP=[0,0]; RIS=[10,20]; % Test Point (12) Test=[15,15 20,15 25,15 30,15 17.5,10 22.5,10 27.5,10 32.5,10 20,5 25,5 30,5 35,5]; dSR=norm(AP-RIS); dRD=zeros(1,12); for ii=1:12 dRD(ii)=norm(RIS-Test(ii,:)); end Gamma_Passive=zeros(1,12); Gamma_Active=zeros(1,12); Gamma_Specular=zeros(1,12); for ii=1:12 Gamma_Passive(ii)= 10*log10((N^2 * lambda^4 * PT)/ ( 256*pi^4* dSR^2 * dRD(ii)^2 *Sigma2)) ; Gamma_Active(ii) = 10*log10( (N*PT*PA) / ( 16*pi^2*PA*Sigmav2*dSR^2 / lambda^2 + 16*pi^2*Sigma2*dRD(ii)^2 / lambda^2 + (Sigma2*Sigmav2*256* pi^4 * dSR^2 * dRD(ii)^2 /(N*lambda^4)) ) ); Gamma_Specular(ii)=10*log10( PT*lambda^2 /(Sigma2*16*pi^2*(dSR+dRD(ii))^2 ) ); end % Amplification factor (check) p=10*log10(sqrt(PA/(N*lambda^2 /(16*pi^2*dSR^2) + Sigmav2))); % Specular reflection comparison Ratio= 10*log10 (N*PA*(dSR+dRD).^2 ./ (PA*dSR^2+dRD.^2) );