I am doing FFT of a signal and storing the transformed data in a list along with the corresponding frequencies in another list. Then, I am selecting a portion of the frequencies and cutting out the data corresponding to that frequency portion and storing both in lists "DataSel" and "Fsel". Now, I need to further do some analysis on this selected portion of data and frequencies. This is my code
public class Response {
public static List<> main(String[] args) {
try{
float []data= Series1("test1");
int len = 128;
double Sr = 20;
double bin = (double) Sr/len;
FloatFFT_1D fftDo = new FloatFFT_1D(len);
float [] fft = new float [len * 2];
System.arraycopy(data, 0, fft, 0, len);
fftDo.complexForward(fft);
List Data = new ArrayList((fft.length+1)/2);
List Fr=new ArrayList();
for(int i = 0; i < len/2; i++){
double outputfft = (double) Math.sqrt((Math.pow(fft[2*i],2))+(Math.pow(fft[(2*(i))+1], 2)));
Data.add(i, outputfft);
double freq = bin * i ;
Fr.add(i, freq);
}
double x = 0.5;
int index_Fr1 = Collections.binarySearch(Fr, x);
int insertion_point_Fr1 = -(index_Fr1+1);
double y = 2;
int index_Fr2 = Collections.binarySearch(Fr, y);
int insertion_point_Fr2 = -(index_Fr2+1);
List FSel = Fr.subList(insertion_point_Fr1, insertion_point_Fr2);
List DataSel = Data.subList(insertion_point_Fr1, insertion_point_Fr2);
return DataSel;
}catch (IOException e) {
e.printStackTrace();
}
}
}
But when I try to return these two lists, I get the error on return type.. Please if anyone can help me figure the problem in this code.