What does toeplitz do in this code?

2 Ansichten (letzte 30 Tage)
Fariha Sneha
Fariha Sneha am 8 Apr. 2019
Kommentiert: Guillaume am 8 Apr. 2019
hello.can anyone help me to understand this code about mimo correlated fading channel?i
will be forever greatful.
function hh=channel coeff(NR,NT,n,rtx,rrx,type)
h=sqrt(1/2)*(randn(nr*nt,n)+j*randn(nr*nt,n))
if nargin,hh=h; return,end
if isvector(rtx)=toeplitz(rtx);
if isvector(rrx),toeplitz(rrx);
if strcmp(type,'complex')
c=chol(kron(rtx,rrx));
else
c=sqrtm(sqrt(kron(rtx,rrx)));
end
hh=zeros(nr,nt,n);
for i=1:n
tmp=c*h(: ,);
hh(: , : , i)=reshape(nr*nt*n);
end
  2 Kommentare
Matt J
Matt J am 8 Apr. 2019
Looks like a coding bug to me.
Guillaume
Guillaume am 8 Apr. 2019
if isvector(rtx)=toeplitz(rtx);
is not valid matlab syntax. The = is illegal there, and the if appears to be missing a matching end
if isvector(rrx),toeplitz(rrx);
is also missing a matching end. Otherwise the syntax is legal but since the result of toeplitz is not assigned to anything, the whole thing is pointless.
Perhaps the best person to ask about this code is the author.
I wouldn't recommend using unknown code that does not even have a single comment explaining what it does. That's not a very good mark of quality.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Propagation and Channel Models finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by