hoggy077
hoggy077
CC#
Created by hoggy077 on 10/13/2022 in #help
Iterative from Recursive [Answered]
Can someone lend me a hand converting this to Iterative. I cant wrap my head around converting a split recursion
int ii = 0;
int kk = 0;
int N = x.Length;

Complex[] Y = new Complex[N];


if (N == 1)
{
Y[0] = x[0];
return Y;
}

Complex[] E, O, even, odd = new Complex[N / 2];
E = O = even = odd;

for (ii = 0; ii < N; ii++)
{

if (ii % 2 == 0)
{
even[ii / 2] = x[ii];
}
if (ii % 2 == 1)
{
odd[(ii - 1) / 2] = x[ii];
}
}

E = fft(even);
O = fft(odd);

for (kk = 0; kk < N; kk++)
{
Y[kk] = E[(kk % (N / 2))] + O[(kk % (N / 2))] * twiddles[kk * wSamp / N];
}

return Y;
int ii = 0;
int kk = 0;
int N = x.Length;

Complex[] Y = new Complex[N];


if (N == 1)
{
Y[0] = x[0];
return Y;
}

Complex[] E, O, even, odd = new Complex[N / 2];
E = O = even = odd;

for (ii = 0; ii < N; ii++)
{

if (ii % 2 == 0)
{
even[ii / 2] = x[ii];
}
if (ii % 2 == 1)
{
odd[(ii - 1) / 2] = x[ii];
}
}

E = fft(even);
O = fft(odd);

for (kk = 0; kk < N; kk++)
{
Y[kk] = E[(kk % (N / 2))] + O[(kk % (N / 2))] * twiddles[kk * wSamp / N];
}

return Y;
6 replies
CC#
Created by hoggy077 on 10/12/2022 in #help
Multi-threading help
So I have an assignment where I'm required to multi-thread a sequential application and demonstrate how I got the most performance out of it. The app itself is essentially just a short-time Fourier Transform. What I'm wondering, is there a way to multi-thread the transform itself when the equation is inherently recursive? and if so would I get a drastic performance boost?
1 replies