5

I am using Matlab. I have a large column vector consisting of complex values. e.g.

data=[
-0.4447 + 0.6263i
0.3114 + 0.8654i
0.7201 + 0.6808i
0.7566 + 0.8177i
-0.7532 - 0.8085i
-0.7851 + 0.6042i
-0.7351 - 0.8725i
-0.4580 + 0.8053i
0.5775 - 0.6369i
0.7073 - 0.5565i
0.4939 - 0.7015i
-0.4981 + 0.8112i
....
]

This represents a constellation diagram which is shown below.

enter image description here

I would like to colour grade the constellation points depending on frequency at a particular point. I presume I need to create a histogram, but I am not sure how to do this using complex vectors and then how to plot the colour grade. Any help appreciated.

4

2 回答 2

2

我想你想做一个热图:

histdata = [real(data), imag(data)];
nbins_x = nbins_y = 10; 
[N, C] = hist3(histdata, [nbins_x, nbins_y]); % the second argument is optional.
imagesc(N);

这里hist3创建直方图矩阵,imagesc绘制缩放热图。如果您更喜欢 3d 可视化,只需键入hist3(histdata).

如果您只是在工作区窗口中右键单击 N,那么还有很多其他可视化选项。我建议也尝试contourf(N)一下哪个是填充的等高线图。

于 2012-11-22T16:06:08.690 回答
1

因此,您要做的是找到一个二-2 直方图。最简单的方法是将实点和虚点分开,并使用hist2d函数,如下所示:

rdata=real(data);
idata=imag(data);

hist2d([rdata;idata]);
于 2012-11-22T12:10:33.577 回答