Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void licz_SINR() {
- Double[] S_NLOS = new Double[19];
- Double[] S_LOS = new Double[19];
- Double[] I_W_NLOS = new Double[19]; //inerferencje w watach
- Double[] I_W_LOS = new Double[19]; //inerferencje w watach
- Double[] S_0_NLOS = new Double[100];
- Double[] S_0_LOS = new Double[100];
- double nGaussNLOS, nGaussLOS;
- for (int q = 0; q < 2; q++) {
- if(q==1){
- Random r1 = new Random();
- Random r2 = new Random();
- nGaussLOS = r1.nextGaussian()*sigma_LOS;
- nGaussNLOS = r2.nextGaussian()*sigma_NLOS;
- System.out.println("Random r1 : " + nGaussLOS);
- System.out.println("Random r2 : " + nGaussNLOS);
- for(int j = 0; j < 100; j++){
- for(int i=0; i < 19; i++){
- PL_LOS[i][j] = PL_LOS[i][j] + nGaussLOS;
- PL_NLOS[i][j] = PL_NLOS[i][j] + nGaussNLOS;
- }
- }
- }
- for (int t = 0; t < 100; t++) {
- for (int i = 0; i < 19; i++) {
- S_NLOS[i] = licz_sygnal_odebrany(p[i], Gtx, Lftx, Grx, Lfrx, 0, PL_NLOS[i][t]);
- S_LOS[i] = licz_sygnal_odebrany(p[i], Gtx, Lftx, Grx, Lfrx, 0, PL_LOS[i][t]); //LOS tylko między UT i BS0
- }
- S_0_NLOS[t] = Math.pow(10, (S_NLOS[0] / 10));// - 3))* Math.pow(10, 3); // z dBm na waty
- I_W_NLOS[0] = 0.0;
- I_suma_NLOS = 0.0;
- S_0_LOS[t] = Math.pow(10, (S_LOS[0] / 10));// - 3))* Math.pow(10, 3); // z dBm na waty
- I_W_LOS[0] = 0.0;
- I_suma_LOS = 0.0;
- for (int j = 1; j < 19; j++) {
- I_W_NLOS[j] = Math.pow(10, (S_NLOS[j] / 10)); // - 3)* Math.pow(10, 3); // z dBm na waty
- I_suma_NLOS = I_suma_NLOS + I_W_NLOS[j];
- I_W_LOS[j] = Math.pow(10, (S_LOS[j] / 10));// - 3))* Math.pow(10, 3); // z dBm na waty
- I_suma_LOS = I_suma_LOS + I_W_LOS[j];
- }
- if(q == 0){
- SINR_NLOS[t] = S_0_NLOS[t] / (I_suma_NLOS + N_W);
- SINR_dB_NLOS[t] = 10 * Math.log10(SINR_NLOS[t]); //na dB
- SINR_LOS[t] = S_0_LOS[t] / (I_suma_LOS + N_W);
- SINR_dB_LOS[t] = 10 * Math.log10(SINR_LOS[t]); //na dB
- }
- else if(q == 1){
- SINR_NLOS[t] = S_0_NLOS[t] / (I_suma_NLOS + N_W);
- SINR_dB_NLOS_zaniki[t] = 10 * Math.log10(SINR_NLOS[t]); //na dB
- SINR_LOS[t] = S_0_LOS[t] / (I_suma_LOS + N_W);
- SINR_dB_LOS_zaniki[t] = 10 * Math.log10(SINR_LOS[t]); //na dB
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement