aroul
Newbie level 6
can anyone help me to simulate the code below in Db scale(e.g -40, -30, -20, -10, 0) rather than linear.
the code below is in linear scale.
clc;
theta = 0i/100:2*pi;
N = input('enter number of elements:');
lambda = 2*pi;
beta = (2*pi)/lambda;
d = (lambda/4)*(1-(1/N));
alpha = (beta*d) + pi/N;
b = sin(((N/2)*(beta*d*cos(theta)+alpha)));
c = sin(((0.5)*(beta*d*cos(theta)+alpha)));
A = abs((1/N).*(b./c));
polar(theta,A)
the code below is in linear scale.
clc;
theta = 0i/100:2*pi;
N = input('enter number of elements:');
lambda = 2*pi;
beta = (2*pi)/lambda;
d = (lambda/4)*(1-(1/N));
alpha = (beta*d) + pi/N;
b = sin(((N/2)*(beta*d*cos(theta)+alpha)));
c = sin(((0.5)*(beta*d*cos(theta)+alpha)));
A = abs((1/N).*(b./c));
polar(theta,A)