[Numpy-discussion] another indexing question

Neal Becker ndbecker2 at gmail.com
Mon May 20 12:00:31 EDT 2013

I have a system that transmits signals for an alphabet of M symbols
over and additive Gaussian noise channel.  The receiver has a
1-d array of complex received values.  I'd like to find the means
of the received values according to the symbol that was transmitted.

So transmit symbol indexes might be:

x = [0, 1, 2, 1, 3, ...]

and receive output might be:

y = [(1+1j), (1-1j), ...]

Suppose the alphabet was M=4.  Then I'd like to get an array of means

m[0...3] that correspond to the values of y for each of the corresponding
values of x.

I can't think of a better way than manually using loops.  Any tricks here?

More information about the NumPy-Discussion mailing list