Package Jama

Examples of Jama.Matrix


    cancellationCarriers.add(allCarriers-1);

   
    PowerControlledCC cancellationCarrier = new PowerControlledCC(allCarriers, cancellationCarriers);

    Matrix directCCMatrix = polyofdm.cc.full.FullCC.createCancellationMatrix(allCarriers, cancellationCarriers);
    Matrix reducedPowerCCMatrix = cancellationCarrier.degreeToCCarrierMatrix.times(cancellationCarrier.usedToDegreeMatrix);
    System.out.println("directCCMatrix");
    directCCMatrix.print(15, 10);
    System.out.println("reducedPowerCCMatrix");
    reducedPowerCCMatrix.print(15, 10);
    System.out.println("minus");
    directCCMatrix.minus(reducedPowerCCMatrix).print(15, 10);
   
    double[] usedData = new double[allCarriers-4];
    usedData[0] = 1;
View Full Code Here


    generatePDF(8,1);
    //generatePDF(3,2);
  }

  private static void generatePDF(int all, int missed) throws IOException {
    Matrix matrix = Newton.generateMatrix(all,missed);
    Matrix allMatrix = new Matrix(all, all);
    for (int basisVector = 0; basisVector < matrix.getRowDimension(); basisVector++) {
      for (int carrier = 0; carrier < matrix.getColumnDimension(); carrier++) {
        allMatrix.set(basisVector, carrier, matrix.get(basisVector, carrier));
      }
    }
    double[] weightings = Utils.createWeightings(all);
    for (int basisVector = matrix.getRowDimension(); basisVector < allMatrix.getRowDimension(); basisVector++) {
      for (int carrier = 0; carrier < allMatrix.getColumnDimension(); carrier++) {
        allMatrix.set(basisVector, carrier, Math.pow(carrier - ((all-1)/2d), basisVector)*weightings[carrier]);
      }
    }
    Utils.makeOrthoGramSchmidt(allMatrix);
    Matrix droppedMatrix = new Matrix(missed, all);
    for (int basisVector = matrix.getRowDimension(); basisVector < allMatrix.getRowDimension(); basisVector++) {
      for (int carrier = 0; carrier < allMatrix.getColumnDimension(); carrier++) {
        droppedMatrix.set(basisVector-matrix.getRowDimension(), carrier, allMatrix.get(basisVector, carrier));
      }
    }
   
    PdfGenerator.createCombinedPDF(
        "html/pdf/Polynomial_" + all + "used_" + missed + "dropped_DroppedDimComp.pdf",
View Full Code Here

    generateCSV(8,1);
  }

  private static void generateCSV(int all, int missed) throws IOException {
    String fileName = "Polynomial_" + all + "used_" + missed + "dropped.csv"
    Matrix matrix = Newton.generateMatrix(all,missed);
   
    Writer writer = new FileWriter(fileName);
    // header
    writer.write(';');
    for (int j = 0; j < matrix.getColumnDimension(); j++) {
      writer.write("carrier");
      writer.write(Integer.toString(j));
      writer.write(';');
    }
    writer.write('\n');
    // data
    for (int i = 0; i < matrix.getRowDimension(); i++) {
      // column 0
      writer.write("basis-vector");
      writer.write(Integer.toString(i));
      writer.write(';');
      // end column 0, now real data
      for (int j = 0; j < matrix.getColumnDimension(); j++) {
        writer.write(Double.toString(matrix.get(i, j)));
        writer.write(';');
      }
      writer.write('\n');
    }
    writer.close();
View Full Code Here

  }
  private static void generatePolynomial(int all, int missed, int width, int height) throws IOException {
    String titlePart1 = "Advanced PCC-OFDM";
    String titlePart2 = all + " carriers used, " + (all-missed) + " polynomials";
    String filename = "html/img/polynomial_" + all + "used_" + missed + "dropped_";
    Matrix matrix = Newton.generateMatrix(all, missed);

    writeChart(ChartGenerator.createChartFourier(matrix, titlePart1, titlePart2), new File(filename + "frequency.png"), width, height);
    writeChart(ChartGenerator.createChartReal(matrix,true, titlePart1, titlePart2), new File(filename + "real_sinus.png"), width, height);
    writeChart(ChartGenerator.createChartReal(matrix,false, titlePart1, titlePart2), new File(filename + "real_cosinus.png"), width, height);
    writeChart(ChartGenerator.createChartMaxAmp(matrix, titlePart1, titlePart2), new File(filename + "real_norm.png"), width, height);
View Full Code Here

 
  private static void generateOFDM(int all, int missed, int width, int height) throws IOException {
    String titlePart1 = "Rectangle-OFDM";
    String titlePart2 = (all-missed) + " carriers";
    String filename = "html/img/ofdm_" + (all-missed) + "carriers_";
    Matrix matrix = OFDM.generateMatrix(all,missed);

    writeChart(ChartGenerator.createChartFourier(matrix, titlePart1, titlePart2), new File(filename + "frequency.png"), width, height);
    writeChart(ChartGenerator.createChartReal(matrix,true, titlePart1, titlePart2), new File(filename + "real_sinus.png"), width, height);
    writeChart(ChartGenerator.createChartReal(matrix,false, titlePart1, titlePart2), new File(filename + "real_cosinus.png"), width, height);
    writeChart(ChartGenerator.createChartMaxAmp(matrix, titlePart1, titlePart2), new File(filename + "real_norm.png"), width, height);
View Full Code Here

    int[] usedCarriers = getUsedCarriers(allCarriers, cancellationCarriers);     
    int[] cCarriers = getCancellationCarriers(allCarriers, cancellationCarriers);     

    double[] weightings = Utils.createWeightings(allCarriers);
   
    Matrix cancellationMatrix = new Matrix(cCarriers.length, usedCarriers.length);
   
    for (int i = 0; i < cCarriers.length; i++) {
      int cCarrier = cCarriers[i];
      for (int j = 0; j < usedCarriers.length; j++) {
        cancellationMatrix.set(i, j, calculateFactor(cCarrier, j, weightings, usedCarriers));
      }     
    }
   
    return cancellationMatrix;
  }
View Full Code Here

      cancellationCarriers.add(i);
      cancellationCarriers.add(allCarriers-1-i);     
    }


    Matrix cancellationMatrix = FullCC.createCancellationMatrix(allCarriers, cancellationCarriers);
    System.out.println("Cancellation Matrix");
    cancellationMatrix.print(15, 5);
   
   
    Matrix displayMatrix = new Matrix(allCarriers-cancellationCarriers.size(), allCarriers);
    for (int basisVector = 0; basisVector < allCarriers-cancellationCarriers.size(); basisVector++) {
      int usedCarriers = 0;
      int cancelledCarriers = 0;
      for (int i = 0; i < allCarriers; i++) {
        if (cancellationCarriers.contains(i)){
          displayMatrix.set(basisVector, i, cancellationMatrix.get(cancelledCarriers, basisVector))
          cancelledCarriers++;
        } else {
          if (usedCarriers == basisVector)
            displayMatrix.set(basisVector, i, 1);
          usedCarriers++;
        }
      }
    }
    System.out.println("Display Matrix");
    displayMatrix.print(15, 5);

    PdfGenerator.generatePDF(
        "CancellationCarrier_" + allCarriers + "used_" + cancellationCarriers.size() + "cc.pdf",
        displayMatrix,
        "Cancellation Carrier",
View Full Code Here

  }



  public static Matrix generateMatrix(int all, int missed) {
    Matrix m = new Matrix(all-missed, all);
    int start = missed/2;
    for (int i = 0; i < all-missed; i++) {
      m.set(i, i+start, 1);
    }
    return m;
  }
View Full Code Here

    System.out.println("denominator-weights: " + Arrays.toString(weights));

    double[] roots = findOrthogonalRoots(all, missed, weights);
    System.out.println("Found orthogonal Roots: " + Arrays.toString(roots));

    Matrix matrix = new Matrix(all-missed, all);
   
    for (int poly = 0; poly < matrix.getRowDimension(); poly++) {
      for (int x = 0; x < matrix.getColumnDimension(); x++) {
        matrix.set(poly, x, calcProduct(poly, x, roots)*weights[x]);
      }
    }
//    Utils.makeOrthoGramSchmidt(matrix);
    Utils.normalize(matrix);
    System.out.println("Found Matrix");
    matrix.print(15, 5);
   
    return matrix;
  }
View Full Code Here

   
    int usedSize = allCarriers-cancellationCarriers.size();
    StringBuilder sb = new StringBuilder();
   
    for (int maxDegrees = 0; maxDegrees < cancellationCarriers.size(); maxDegrees++) {
      Matrix displayMatrix = new Matrix(usedSize, allCarriers);
      for (int basisVector = 0; basisVector < usedSize; basisVector++) {
        double[] usedData = new double[usedSize];
        usedData[basisVector] = 1;
        double[] allData = cancellationCarrier.getAssembledValuesMaxDegrees(usedData, maxDegrees);
        for (int i = 0; i < allCarriers; i++) {
          displayMatrix.set(basisVector, i, allData[i])
        }
      }
      System.out.println("Display Matrix");
      displayMatrix.print(15, 5);

      String filename = "CancellationCarrier_" + allCarriers + "used_" + cancellationCarriers.size() + "cc_" + maxDegrees + "degrees.png";
      String titlePart2 = allCarriers + " carriers used, " + (cancellationCarriers.size()) + " cc, " + maxDegrees + " degrees";
      writeChart(ChartGenerator.createChartFourier(displayMatrix, "Cancellation Carrier", titlePart2), new File(filename), 500, 400);
      sb.append("<img src=\"img/cc/cc_in_guard_bothsides/" + filename + "\"/><br/>\n");
View Full Code Here

TOP

Related Classes of Jama.Matrix

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.