package polyofdm;
import java.io.IOException;
import polyofdm.chart.PdfGenerator;
import polyofdm.matrixgen.Newton;
import polyofdm.matrixgen.Utils;
import Jama.Matrix;
public class GenerateDroppedDimComparePDF {
public static void main(String[] args) throws IOException {
//displaySwingFrame();
generatePDF(24,8);
generatePDF(24,6);
generatePDF(24,4);
//generatePDF(19,5);
//generatePDF(18,4);
generatePDF(16,8);
generatePDF(16,6);
generatePDF(16,4);
generatePDF(16,3);
generatePDF(16,2);
generatePDF(16,1);
//generatePDF(14,4);
//generatePDF(12,2);
//generatePDF(10,2);
generatePDF(8,4);
generatePDF(8,3);
generatePDF(8,2);
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",
"Advanced PCC-OFDM",
all + " carriers used, " + (all-missed) + " polynomials",
"Dropped Dimensions",
missed + " polynomials",
"Comparison - Used and dropped Dimensions",
matrix,
droppedMatrix
);
}
}