You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.
for simple complex array [ 3+1i 9+14i 11+7i 40+31i]..
Accord.Math.Transforms.FourierTransform2.DFT(Forward) changes the array to
[ 63+53i -25+25i -35-37i 9-37i ]
AForge.Math.FourierTransform.DFT(Forward) changes the array to
[ 0.75+0.25i 2.25+3.5i 2.75+1.75i 10+7.75i ]
In Matlab answers same value with Accord.Math.Transforms.FourierTransform2.DFT.
Their function bodies(Accord and AForge) are almost same but direction is reversed.
And backward return operation of AForge may be incorrect.
In Accord..
for (int i = 0; i < c.Length; i++)
{
...
c[i] = new Complex(sumRe, sumIm);
}
if (direction == FourierTransform.Direction.Backward)
{
for (int i = 0; i < c.Length; i++)
data[i] = c[i] / n;
}
else
{
...
}
but AForge..
for (int i = 0; i < dst.Length; i++)
{
for (int j = 0; j < data.Length; j++)
{
...
dst[i] += new Complex(re, im);
}
}
// copy elements
if (direction == Direction.Forward) //<< reversed direction
{
// devide also for forward transform
for (int i = 0; i < data.Length; i++)
data[i] /= n; //<< not using "dst" array
}
else
{
...
}
I think it needs to be validate.
(why same functions are exist?)
The text was updated successfully, but these errors were encountered:
The new version of dft/fft (Accord.NET) was coded for the compatibility with the Matlab. The old version (AForge.NET) exists only for the compatibility with the rest of the AForge.NET. I recommend to use the version of the Accord.NET because the fft can handle with size different of the power of 2.
There is differents scales for the directions. The matlab uses Asymmetric scale.
Exactly, thanks @DiegoCatalano for the explanation! I will keep this issue open until I mark the AForge.NET implementation as obsolete and add more information about it in the documentation.
Updates:
- GH-257: DFT functions in AForge.Math.FourierTransform and Accord.Math.Transforms
- GH-500: Add an Example for FourierTransform2.FFT Method (Complex[], FourierTransform.Direction) doc-request
- GH-560: Add an Example for FourierTransform2.FFT Method (Double[], Double[], FourierTransform.Direction) doc-request
- GH-665: Add an Example for FourierTransform.FFT Method doc-request
for simple complex array [ 3+1i 9+14i 11+7i 40+31i]..
Accord.Math.Transforms.FourierTransform2.DFT(Forward) changes the array to
[ 63+53i -25+25i -35-37i 9-37i ]
AForge.Math.FourierTransform.DFT(Forward) changes the array to
[ 0.75+0.25i 2.25+3.5i 2.75+1.75i 10+7.75i ]
In Matlab answers same value with Accord.Math.Transforms.FourierTransform2.DFT.
Their function bodies(Accord and AForge) are almost same but direction is reversed.
And backward return operation of AForge may be incorrect.
In Accord..
but AForge..
I think it needs to be validate.
(why same functions are exist?)
The text was updated successfully, but these errors were encountered: