very slow any other way to do it?

2 Ansichten (letzte 30 Tage)
sharif
sharif am 3 Jul. 2014
Bearbeitet: Cedric am 3 Jul. 2014
clear, clc, close all;
N=1024; Cp=64; zf=[]; NTx=8; Npath=100; tap=randi([3 TAP]); ds=Cp; s=N+N-1; N1=Npath*Npath;
N2=Npath*NTx;
for aa=1:Npath
for bb=1:tap
p(aa,bb)=randi([1 ds]);
p(aa,:)=sort(p(aa,:),'descend');
xx(aa,:)=(abs(randn(1,tap)+(randn(1,tap))*1i));
xx(aa,:)=sort(xx(aa,:));
end
end
% Loop for adding random positions & normalized impulse response (h_N)
for cc=1:Npath
for dd=1:tap
h(cc,p(cc,dd))=xx(cc,dd);
U(cc)=sqrt(sum((h(cc,:).^2)));
h_N(cc,:)=h(cc,:)./U(cc);
h_N(cc,:)=circshift(h_N(cc,:),[0 -min(p(cc,:))+1]);
end
end
bk= randi ([0,15],NTx,N);
Dk=C(bk+1);
d=ifft((Dk).*sqrt(N));
tx=[d(:,end-Cp+1:end) d];
* | _for ii=1:Npath
for hh=1:N+Cp
for jj=1:NTx
[Txx(jj,:),zf]=filter(h_N(ii,:),1,tx(jj,:),zf);
Txxx(ii,hh)=sum(Txx(:,hh));
end
end
end_ | *
  1 Kommentar
Cedric
Cedric am 3 Jul. 2014
Bearbeitet: Cedric am 3 Jul. 2014
Your code doesn't work (undefined TAP, flawed calls to RANDI, RANDN, etc). You should use the profiler and identify the bottleneck(s):
profile viewer
and execute your script from there.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by