From octave-sources-request at bevo dot che dot wisc dot edu Wed Aug 6 09:23:05 2003 Subject: results with strange floating-point number bias From: nwerneck at cefala dot org To: octave-sources at bevo dot che dot wisc dot edu Date: Wed, 6 Aug 2003 11:22:22 -0300 Hello I'm trying to implement a FFT function with the new fftw3 library. I'm creating a rfft fucntion first, using fftw's special real-signal function first. I got the function running well, but there is the strangest thing happening. The result it returns is summed by a large number (455103.06358 once, but it changes). And it's only for real numbers! The imaginary part is OK I bet it has something to do with the way octave stores the numbers, but as I have not messed with octave's code enough, I'm looking for advices.. It REALLY looks like it's mixing a pointer value with the numerical value of the real part... But what is strange is that I could extract the correct values once, doing a subtraction. any ideas? Here is a sample of what is happening: oct:50> fft([1 0.5 0.3 -1]') ans = 0.80000 + 0.00000i 0.70000 - 1.50000i 1.80000 + 0.00000i 0.70000 + 1.50000i oct:51> fftnic([1 0.5 0.3 -1]') ans = 4.5509e+05 + 0.0000e+00i 4.5509e+05 - 1.5000e+00i 4.5509e+05 + 0.0000e+00i oct:68> fftnic([1 0.5 0.3 -1]') - 455097 ans = -5.1915 + 0.0000i -5.2915 - 1.5000i -4.1915 + 0.0000i oct:70> fftnic([1 0.5 0.3 -1]') - 455097 ans = 6.8636 + 0.0000i 6.7636 - 1.5000i 7.8636 + 0.0000i See, there is a constant added, the right result is there too!! -- Nicolau Werneck 9F99 25AB E47E 8724 2F71 http://cefala.org/~nwerneck EA40 DC23 42CE 6B76 B07F "After silence, that which comes nearest to expressing the inexpressible is music." -- Aldous Huxley