What does toeplitz do in this code?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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
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.
Antworten (0)
Siehe auch
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!