1
$\begingroup$

I'm taking the abs of all elements, compute the mean, subtract it off from the original values. I just feel that this is not correct and can change the vectors. I'm also dividing by the standard deviation, but I'm quite confident about this, knowing that this is pure rescaling of complex values.

Any guidelines on how to do this?

enter image description here

PS: My concern eminates from thinking of each complex valued element as a vector in 2D plane, and this subtraction could change where it is pointing to.

$\endgroup$
3
$\begingroup$

First off, it's always helpful to think geometrically about what complex numbers are, and what arithmetic operations achieve.


In your function, you are using the mean and standard deviation of the absolute value of these complex numbers. That means that if you perform your operation to the absolute value of your data:

(tmp - tmp.mean()) / tmp.std()

you will end up with normalized data of mean 0 and standard deviation 1.

Going back to thinking geometrically, when you perform your original operation:

(x_source - tmp.mean()) / tmp.std()

you are essentially moving your data's mean tmp.mean() units to the left, then scaling horizontally by 1/tmp.std().

Notice none of this is vertical shift or scaling, so something smells funny.


What I would do: I would normalize each coordinate independently.

Finding the mean is fine -- the mean of complex data points is the same as means of components: $$ \bar z = (\bar x , \bar y) $$ So you can subtract the mean of the $x$ value's from each input value's $x$-coordinate. Ditto for $y$.

Then you divide the real component by the standard deviation of the real component, and ditto for the imaginary component.

It could also be appropriate to divide by the standard deviation of the (new) norms. This would ensure good properties involving your data lying within a circle of a certain radius.


Code:

real_data = real(x_source)
imag_data = imaginary(x_source)

real_data = ( real_data - real_data.mean() ) / real_data.std()
imag_data = ( imag_data - imag_data.mean() ) / imag_data.std()

x_source_norm = real_data + i * imag_data
$\endgroup$
  • $\begingroup$ Hi Andrew. Turned out that it is not a good idea to normalize real and imaginary values separately. I did it and when I got new data, I normalized it using same norming factors that I got from training: result: rubbish! I think I agree with you as far as mean is concerned, but I think when it comes to std, one should use absolute value to extract it. Otherwise, having two std's one for real and one for imaginary will change the direction of the vector. $\endgroup$ – Alex Deft Aug 3 at 6:02
  • 1
    $\begingroup$ @AlexDeft Yes, it will change the direction of the vector. This is very situation-dependent, which is why I started by stressing the importance of thinking geometrically about what these vectors are. As I ended the text portion of my post, normalizing separately will essentially get your data to fall into boxes, whereas normalizing the norm will cause your data to fall into concentric circles. $\endgroup$ – Andrew Maurer Aug 4 at 22:37
  • 1
    $\begingroup$ @AlexDeft Normalizing by the mean will also involve changing the direction of the vectors. What it preserves is the distance and angles between vectors. $\endgroup$ – Andrew Maurer Aug 4 at 22:40
  • $\begingroup$ Ahh got it. I made some numeric examples and everything you said checks! Thanks. $\endgroup$ – Alex Deft Aug 7 at 0:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.