Complex all 0s DFT function


i running cold

            int n2 = 16 - 1;
            (int f3 = 0; f3 <= 4; f3++)
            {
                (int k = 0; k <= n2; k++)
                {
                    f[f3] = f[f3] + (complex)dsp2.elementat(k) * complex.exp((-complex.imaginaryone * math.pi * 2d * f3) / 16d);
                }
               }

and getting :

this dsp2:

0
7.07106781186547
10
7.07106781186548
1.22460635382238e-15
-7.07106781186547
-10
-7.07106781186548
-2.44921270764475e-15
7.07106781186547
10
7.07106781186548
3.67381906146713e-15
-7.07106781186548
-10
-7.07106781186548
-4.89842541528951e-15

this f[]

f[0] = (-8.88178419700125e-15, 0) 
f[1] = (-7.105427357601e-15, 2.66453525910038e-15)
f[2] = (-3.5527136788005e-15, 5.32907051820075e-15)// should not 0 
f[3] = (-8.88178419700125e-16, 7.105427357601e-15)
f[4] = (-7.39557098644699e-31, 8.88178419700125e-15)

did thing wrong ?

now getting 0 or number close 0

why?



Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'