Prob73 - b_2(n)=(2*randint(1)-1); b_3(n)=(2*randint(1)-1);

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clear all; clc; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Space-Time Estimation clear all; close all; m=7; bitSNR=15.76; chipSNR=4; pow=10^(bitSNR/10); angle=[-60 -10 20 45]; for user=1:4 Stheta(:,user)=exp(-j*pi*[0:m-1]'*sind(angle(user))); end L=15; N_users = 4; reg1 = randsrc(1,4,[0 1]); for k = 1:L mseq1(k) = reg1(4); c1 = xor(reg1(2),xor(reg1(3),reg1(4))); reg1(4)=reg1(3); reg1(3)=reg1(2); reg1(2)=reg1(1); reg1(1)=c1; end reg2 = randsrc(1,4,[0 1]); for k = 1:L mseq2(k) = reg2(4); c2 = xor(reg2(2),reg2(4)); reg2(4)=reg2(3); reg2(3)=reg2(2); reg2(2)=reg2(1); reg2(1)=c2; end Goldc(:,1) = mseq1'; Goldc(:,2) = mseq2'; for n = 3:N_users count = mseq2(1); mseq2(1:L-1) = mseq2(2:L); mseq2(L) = count; Goldc(:,n) = xor(mseq1,mseq2)'; end Goldc = 2*Goldc - 1 sig=Goldc(:,1:4); Sk=sig(1:15,:); N=100; for n=1:N b_1(n)=(2*randint(1)-1);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: b_2(n)=(2*randint(1)-1); b_3(n)=(2*randint(1)-1); b_4(n)=(2*randint(1)-1); end for n=1:N for l=1:15 for i=1:7 XL(i,l)=sqrt(pow)*b_1(n)*Sk(l,1)*Stheta(i,1)+sqrt(pow)*b_2(n)*Sk(l,2)*St heta(i,2)+sqrt(pow)*b_3(n)*Sk(l,3)*Stheta(i,3)+sqrt(pow)*b_4(n)*Sk(l,4)*Stheta(i ,4)+rand(1,1); end end end Rc=zeros(15,15); for i=1:7 Rc=Rc+((XL(i,:))'*(XL(i,:))); end Rc=Rc/7; wspace=(inv(Rc)*Sk(:,1))/((Sk(:,1))'*inv(Rc)*Sk(:,1)); %MVDR wtime=Sk; %MF y = (wspace')*XL.'; R = (XL*(conj(wspace))*(wspace).'*(XL'))/N; ang=-90:1:90; for x=1:181 s=exp(-j*pi*(0:m-1)'*sind(ang(x))); P(x)=10*log((s')*R*s); end figure; plot(ang,P); xlabel('angle(degrees)'); ylabel('Magnitude'); grid on; Title('Pmvdr CDMA'); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %End of Program % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...
View Full Document

Page1 / 2

Prob73 - b_2(n)=(2*randint(1)-1); b_3(n)=(2*randint(1)-1);

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online