/* This is the java implementation of calculating coefficients of the given function performing the Discrete-Fourier Transform. Formula for calculating the coefficient is X(k) = Sum(x(n)*cos(2*PI*k*n/N) – iSum(x(n)*sin(2*PI*k*n/N)) over 0 to N-1 */ //This is a sample program to calculate a DFT Coefficients using the formula import java.util.Scanner; public class DFT_Coefficient { double real, img; public DFT_Coefficient() { this.real = 0.0; this.img = 0.0; } public static void main(String args[]) { int N = 10; Scanner sc = new Scanner(System.in); System.out.println("Calculation DFT Coefficients"); System.out.println("Enter the coefficient of simple linear funtion:"); System.out.println("ax + by = c"); double a = sc.nextDouble(); double b = sc.nextDouble(); double c = sc.nextDouble(); double []function = new double[N]; for(int i=0; i