What does toeplitz do in this code?

2 vues (au cours des 30 derniers jours)
Fariha Sneha
Fariha Sneha le 8 Avr 2019
Commenté : Guillaume le 8 Avr 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 commentaires
Matt J
Matt J le 8 Avr 2019
Looks like a coding bug to me.
Guillaume
Guillaume le 8 Avr 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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Propagation and Channel Models dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by