This web page is also available on English. Your browser is configured to use English as the default locale. Would you like to view this page in English? • Yes pleaseNo, thanks

Algoritmo binomial para arrays unidimensionales

Esta función usa un algoritmo binomial para obtener los pesos y fases de cada elemento de un array lineal. Los resultados de la función definen el apuntamiento del array en la dirección dada.

import Jama.Matrix;

Cmplx[] binomial(double d, double theta, double phi, int Num, int axis) { //d:element spacing in units of lambda
//theta:beam angle (in degrees)
//phi:azimut angle (in degrees)
//N:number of array elements
//axix:indicates which axis is used-->1 for x axis
//                                 -->2 for y axis

//This function uses a binomial algorithm to calculate the weights and phases in an unidirectional array of antennas
double N=Num;
int N1=N-1;
int a=1;
double []v= new double[]{1.0, 1.0};  //define the vector we are going to use in the convolution
double[] P=new double[N];            //define the vector we are going to obtain as a result of the convolution

Cmplx[] z=new Cmplx[N];
Cmplx[] f=new Cmplx[N];  //vectors of N elements Cmplx type

double k;

if (axis==1){
}
if (axis==2){
}

double ang=Math.acos(k);  //ang=arccos(sen(theta)*cos(phi))
double cose=Math.cos(ang);//cose=cos(ang)
double ps0=(2*Math.PI*d*cose); //find the phase that we are going to use to direct the array in the desired direction

double[] y=new double[N];
double[] fase=new double[N];  //vectors of N elements double type

if (N1>=1){
P=convolution(v, P, N1); //call to the convolucion.java function. In this case, it convolves the vector v with a vector of a dimension u = 1
//We pass the vector v, the vector P and N1 (number of antennas in the array minus one)
}                             //It returns the vector P with the result of the convolution, this vector P contains the weights of the array, since we are in a binomial algorithm
if (N1==0){
for (i=0; i<=N1; i++){
P[i]=1.0;
}
}

for (int n=0; n<N; n++){
f[n]=new Cmplx(0,-((n-(N-1)/2)*ps0)); //create a complex vector, with 0 as the real part, where the imaginary part are the
//successive phases that we are going to multiply to the weights

z[n]=P[n]*(Cmplx.exp(f[n]));         //find the final result in the form of a complex number by multiplying the weights by the progressive phases,
//thus directing the array towards the direction indicated by theta and phi

y[n]=Cmplx.abs(z[n]); //find the absolute of the complexes, that is, the weights
fase[n]=(Math.atan2(z[n].imag, z[n].real)); //find the phase in radians
if (fase[n]<0){ // if the phase is less than 0