When calculating the standard deviation of arrays of complex numbers c, why is std(c) not equal to std(abs(c))?

20 views (last 30 days)
for example, when both the real and imaginary components are normally distributed:
c = randn(100,1) + i*randn(100,1);
>> std(c)
ans =
1.5367
>> std(abs(c))
ans =
0.7312
Looking at how Matlab calculates these, it appears that the modulus of c is used in both instances. Am I wrong?
Thanks for your help.

Answers (2)

michael
michael on 8 Oct 2016
Edited: michael on 8 Oct 2016
Please have a look on Peter's response here
  1 Comment
Adam Parker
Adam Parker on 8 Oct 2016
Michael, I appreciate you taking the time to respond. Thank you.
However, I don't think the Peter's answer gets to the heart of my question - it addresses something slightly different (unless I am missing something?)
My confusion is this: if I look at how the std() function handles a complex number it does the 'squaring' operation by multiplying by the complex conjugate i.e. if c=a+ib then it uses c* x c = a^2+b^2 in its calculation. But this is just the same thing that abs(c) does. So why do you get different answers?
Thanks again.

Sign in to comment.


seackone
seackone on 1 May 2018
Hi, I also want to calculate the standard deviation of a complex number.. At my research, I found your question. But std(c) and std(abs(c)) is not the same!
For example:
A = [1+1i*1 1+1i*2]
The mean of A is:
mean(A) = 1/2 * (1+1i*1 + 1+1i*2) = 1+1i*1.5
Now you can calculate the standard deviation..
But std(abs(A)) is an other equation:
abs(A) = [1.412 2.2361]
and the mean:
mean(abs(A)) = 1.8251
you got a different matrix and a different mean, so the result of the standard deviation isn't the same. If you want, you can calculate the example to the end and the results are:
std(A) = 0.70..
std(abs(A)) = 0.58..
I hope I could help (maybe not you, because the post is more then a year old..)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!