Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static float maxAPP;

    public static float[][] compute_amplitude(float[][] real, float[][] imaginary) {
        float[][] amp = new float[real.length][real.length];
        float maxAmp = 0;
        for (int row = 0; row < amp.length; row++) {
            for (int col = 0; col < amp.length; col++) {
                amp[row][col] = (float) Math.hypot(real[row][col], imaginary[row][col]);
                if (amp[row][col] > maxAmp) {
                    maxAmp = amp[row][col];
                }
            }
        }
        maxAPP = maxAmp;
        return amp;
    }
}