(eyediagram) Why I cannot get the eyediagram?

4 ビュー (過去 30 日間)
Kwan Ho NG
Kwan Ho NG 2021 年 3 月 17 日
コメント済み: Kwan Ho NG 2021 年 3 月 17 日
clear;
M=2000
N=200;
temp= rand(1,M);
for i=1:M
if temp(i)>0.5
D(i)=1;
else
D(i)=-1;
end;
end;
Ns=10; % Ns=5 or Ns=10
for i=1:M
for j=1:Ns
D_ext((i-1)*Ns+j)=D(i);
end;
end;
h = firrcos(200,0.5,0.35,10, 'rolloff');%modify the parameter in different steps
out=conv(h,D_ext);
out_leng=length(out);
out_stable=(N+1:out_leng-N);
eyediagram(out_stable,20)
This is what I got.
This is the expected result.
  2 件のコメント
Cris LaPierre
Cris LaPierre 2021 年 3 月 17 日
Consider pasting your code in rather than taking a screenshot. It's much easier to work with that way.
Kwan Ho NG
Kwan Ho NG 2021 年 3 月 17 日
編集済み: Cris LaPierre 2021 年 3 月 17 日
clear;
M=2000
N=200;
temp= rand(1,M);
for i=1:M
if temp(i)>0.5
D(i)=1;
else
D(i)=-1;
end;
end;
Ns=10; % Ns=5 or Ns=10
for i=1:M
for j=1:Ns
D_ext((i-1)*Ns+j)=D(i);
end;
end;
h = firrcos(200,0.5,0.35,10, 'rolloff');%modify the parameter in different steps
out=conv(h,D_ext);
out_leng=length(out);
out_stable=(N+1:out_leng-N);
eyediagram(out_stable,20)

サインインしてコメントする。

回答 (1 件)

Cris LaPierre
Cris LaPierre 2021 年 3 月 17 日
編集済み: Cris LaPierre 2021 年 3 月 17 日
The issue appears to be with how you create out_stable. The result of this is a straight line. If you create an eyediagram using out instead, you see you are mostly there. You likley meant to trim the tails of out to clean up the eye diagram.
load vars.mat
h = firrcos(200,0.5,0.35,10, 'rolloff');%modify the parameter in different steps
out=conv(h,D_ext);
figure
plot(out)
figure
eyediagram(out,20)
out_leng=length(out);
out_stable=(N+1:out_leng-N);
figure
plot(out_stable)
eyediagram(out_stable,20)
That is likely due to the fact that out_stable is the index values of what you meant to keep from out. You forgot to tell the code to index these values from out. Try this instead.
figure
out_stable=out(N+1:out_leng-N);
% ^^^ Need to use your values as indices to out
eyediagram(out_stable,20)
  1 件のコメント
Kwan Ho NG
Kwan Ho NG 2021 年 3 月 17 日
Thank you. It works.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSources and Sinks についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by