help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: complex output of pwelch


From: Marius Schamschula
Subject: Re: complex output of pwelch
Date: Sun, 11 Mar 2007 06:20:37 -0500

Dmitri,

You are not seeing things.

I tried the same on two Macs, both running my builds of 2.9.9.

On the G5 I get

octave:1> a=rand(16,1)
a =

   0.624555
   0.412899
   0.191215
   0.969144
   0.543905
   0.015706
   0.556574
   0.740120
   0.931901
   0.187294
   0.234009
   0.835056
   0.086267
   0.802493
   0.554253
   0.477358

octave:2> b=pwelch(a)
b =

   1.31500 - 0.00000i
   0.44513 - 0.00000i
   0.03487 + 0.00000i
   0.09067 - 0.00000i
   0.15099 - 0.00000i
   0.04116 + 0.00000i
   0.04662 + 0.00000i
   0.04982 + 0.00000i
   0.00142 - 0.00000i

On the Mac Pro I get:

octave:1> a=rand(16,1)
a =

   0.229622
   0.913613
   0.095573
   0.894183
   0.973529
   0.315020
   0.147748
   0.597676
   0.767818
   0.045655
   0.715150
   0.064185
   0.940617
   0.891771
   0.015746
   0.182650

octave:2> b=pwelch(a)
b =

   1.2225856
   0.2785923
   0.0018920
   0.0435077
   0.0975156
   0.0717156
   0.0581892
   0.0836018
   0.0733558

Thus, this is a PPC issue.

On Mar 11, 2007, at 12:56 AM, Dmitri A. Sergatskov wrote:

I noticed that at some moment I started getting
a complex output while doing
b = pwelch(a)
(which must be real).
The imaginary part is order of eps, but it is still an annoyance.
Should we put
Pxx = real(Pxx)
or there a better fix?

Dmitri.

p.s. This is an example on PPC OSX with hpc binary of octave 2.9.9:

octave:85> a=rand(16,1)
a =

   0.23158279611096871
   0.13475686431041639
   0.11600916079881567
   0.66193574795860100
   0.28821200634388527
   0.33950150091274417
   0.03019499029666499
   0.53297717647050991
   0.00689129650662494
   0.40770131753552846
   0.76269004312663635
   0.64289433700013687
   0.48166615055996825
   0.61059075641665395
   0.09181145530069872
   0.96806357024737943

octave:86> b=pwelch(a)
b =

   0.694906450550431 - 0.000000000000000i
   0.168157410845850 + 0.000000000000000i
   0.044042332703282 + 0.000000000000000i
   0.013559565644394 + 0.000000000000000i
   0.020360604330361 + 0.000000000000000i
   0.043678042332714 + 0.000000000000000i
   0.030391967689350 + 0.000000000000000i
   0.043206552245520 - 0.000000000000000i
   0.069815447871313 - 0.000000000000000i

octave:87> max(b-real(b))
ans = 0.00000000000000e+00 + 2.82851361838824e-18i
_______________________________________________
Help-octave mailing list

Marius

--

Marius Schamschula,  Alabama A & M University, Department of Physics


    The Center for Hydrology Soil Climatology and Remote Sensing

   http://optics.physics.aamu.edu/ - http://www.physics.aamu.edu/

          http://wx.aamu.edu/ - http://www.aamu.edu/hscars/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]