简体   繁体   English

在MatLab中绘制信号眼图

[英]Plot an eye diagram of a signal in MatLab

The matrix X contained in a .mat file represents the acquired signal. .mat文件中包含的矩阵X表示获取的信号。 The element of place (i, j) of the matrix is the i-th sample of the j-th screen. 矩阵的位置(i,j)的元素是第j个屏幕的第i个样本。 The sampling frequency is equal to 4 GS/s. 采样频率等于4 GS / s。 How do I plot the eye diagram relative to the signal contained in X using MatLab? 如何使用MatLab相对于X中包含的信号绘制眼图? I tried but I could not draw the eye diagram from the matrix X (see http://ge.tt/8Xq5SYh/v/1?c ). 我尝试过,但无法从矩阵X绘制眼图(请参阅http://ge.tt/8Xq5SYh/v/1?c )。 Here is the link to the matrix X that I used: 这是我使用的矩阵X的链接:

http://ge.tt/8Xq5SYh/v/0 http://ge.tt/8Xq5SYh/v/0

and my MatLab code: 和我的MatLab代码:

%sampling frequency fs=4 GS/s
rows=4000;    %4000 rows (samples)    |__ in matrix X
columns=10;   %1000 columns (screens) |

%for plot all the graphics in the same window (overlapping)
hold on;                 

%index of the single row (column for the single column)
row=1:1:100; 

t=1:1:100;
for column=1:columns,
   %plot
   plot(t,X(row, column),'-bo','LineWidth',1, 'MarkerEdgeColor','b', 'MarkerFaceColor','b', 'MarkerSize',2);  
end

%axis properties
set(gca,'YTick', [-0.5 -0.45 -0.4 -0.35 -0.3 -0.25 -0.2 -0.15 -0.1 -0.05 0 0.05 0.1   0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5]); %soli valori di ascisse da visualizzare
grid on; 
set(gca,'GridLineStyle','-');                                   
axis([0 10 -0.5 0.5]);                                       

Someone could try to show me how to do? 有人可以告诉我该怎么做? maybe the matrix is not correct? 也许矩阵不正确?

Thanks in advance to anyone who answers 预先感谢任何回答的人

You can simply plot(x,'b') . 您可以简单地plot(x,'b') The plot command will draw a line for every column of x , which corresponds to all the samples of each "screen". plot命令将为x每一列绘制一条线,该线对应于每个“屏幕”的所有样本。 The 'b' in the command is just to make every line the same color like a typical eye diagram. 命令中的'b'只是使每条线具有与典型眼图相同的颜色。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM