00001 using System;
00002
00003 namespace FFT
00004 {
00005
00006
00007
00008
00009
00010 public class DirectConvolution : IConvolution
00011 {
00012
00013
00014
00015
00016
00017 public Complex[] Convolution(Complex[] a, Complex[] b)
00018 {
00019 Complex[] c = new Complex[a.Length + b.Length - 1];
00020
00021 for (int i = 0; i < a.Length; i++) {
00022 for (int j = 0; j < b.Length; j++) {
00023 c[i+j] += a[i]*b[j];
00024 }
00025 }
00026
00027 return c;
00028 }
00029
00030
00031
00032
00033
00034 public override string ToString()
00035 {
00036 return "Direct";
00037 }
00038
00039 }
00040 }