﻿

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 uniforme para arrays bidimensionales

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

``````void bidirectional_uniform(double d1, int N1, double d2, int N2, double theta, double phi) { //d1:element spacing of array x in units of lambda
//N1:number of array elements of array x
//d2:element spacing of array y in units of lambda
//N2:number of array elements of array y
//theta:beam angle (in degrees)
//phi:azimut angle (in degrees)

//This function uses a uniform algorithm to calculate the weights and phases in an bidirectional array of antennas
int N=N1*N2;
Cmplx[] a=new Cmplx[N1];
Cmplx[] b=new Cmplx[N2];
Cmplx[][] c=new Cmplx[N1][N2];
Cmplx[] pesos=new Cmplx[N];

a=uniform(d1, theta, phi, N1, 1); //call to the funcion_uniform.java and store in a the results (complex numbers) of the array in x
b=uniform(d2, theta, phi, N2, 2); //call to the funcion_uniform.java and store in b the results (complex numbers) of the array in y

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

int cont=0; //initialize cont to 0
for (int i=0; i<N1; i++){
for (int j=0; j<N2; j++){
c[i][j]=Cmplx.mul(a[i],b[j]); //multiply the values of array x and array y to obtain the two-directional results
pesos[cont]=c[i][j];          //store these results in order
cont=cont+1;                  //increment cont
}
}

for (int n=0; n<N; n++){
y[n]=(Cmplx.abs(pesos[n])); //find the absolute of the complexes, that is, the weights
fase[n]=(Math.atan2(pesos[n].imag, pesos[n].real)); //find the phase in radians
if (fase[n]<0){ // if the phase is less than 0
fase[n]=2*Math.PI+fase[n]; //add 2*pi
}
fase[n]=Math.toDegrees(fase[n]); //find the phase in degrees
}

writeFile("./mydatafiles/uniform_bi_.txt", y,fase); //write the weigths and phases in a text file
}``````

¿Te ha sido útil esta información?

Usamos cookies en este sitio web para mejorar tu experiencia al navegar por esta página. Si continúas usando este sitio, aceptas nuestra política de cookies.

Aceptar