/* This is the java implementation of Naive DFT approach over function. 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 approach tries to many transforms using different values of k from 0 to N-1. */ //This is a java program to perform the DFT using naive approach import java.util.Scanner; public class DFT_Naive_Approach { double real, img; public DFT_Naive_Approach() { 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("Disd=crete Fourier Transform using naive method"); 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