(eyediagram) Why I cannot get the eyediagram?

4 visualizzazioni (ultimi 30 giorni)
Kwan Ho NG
Kwan Ho NG il 17 Mar 2021
Commentato: Kwan Ho NG il 17 Mar 2021
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 Commenti
Cris LaPierre
Cris LaPierre il 17 Mar 2021
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 il 17 Mar 2021
Modificato: Cris LaPierre il 17 Mar 2021
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)

Accedi per commentare.

Risposte (1)

Cris LaPierre
Cris LaPierre il 17 Mar 2021
Modificato: Cris LaPierre il 17 Mar 2021
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)

Community Treasure Hunt

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

Start Hunting!

Translated by