Format code with prettier (#3375)

This commit is contained in:
acbin
2022-10-03 17:23:00 +08:00
committed by GitHub
parent 32b9b11ed5
commit e96f567bfc
464 changed files with 11483 additions and 6189 deletions

View File

@ -43,7 +43,9 @@ public class ConvolutionFFT {
* @return The convolved signal.
*/
public static ArrayList<FFT.Complex> convolutionFFT(
ArrayList<FFT.Complex> a, ArrayList<FFT.Complex> b) {
ArrayList<FFT.Complex> a,
ArrayList<FFT.Complex> b
) {
int convolvedSize = a.size() + b.size() - 1; // The size of the convolved signal
padding(a, convolvedSize); // Zero padding both signals
padding(b, convolvedSize);
@ -57,9 +59,7 @@ public class ConvolutionFFT {
convolved.add(a.get(i).multiply(b.get(i))); // FFT(a)*FFT(b)
}
FFT.fft(convolved, true); // IFFT
convolved
.subList(convolvedSize, convolved.size())
.clear(); // Remove the remaining zeros after the convolvedSize. These extra zeros came from
convolved.subList(convolvedSize, convolved.size()).clear(); // Remove the remaining zeros after the convolvedSize. These extra zeros came from
// paddingPowerOfTwo() method inside the fft() method.
return convolved;