aniket18
Junior Member level 3

i am posting my code...i got some error in first for loop ...i got the error message ??? Subscripted assignment dimension mismatch.
Error in ==> test2 at 22
dd
,v)=i
,r:r+7);
here it is code please correct ...i think the matrix formation is not correct could any body correct it...
clc;
clear all;
h=hadamard (8);
r=10000;
%orthogonal walsh code
q=h(1,
;
u=randint(1,r); %random data generation
%bpsk modulation
d=2*u-1;
%spreading
i11=kron(d,h);
i=i11;
% arranging the data in 8x10000 matrix
v=1;
for r=1:8:8*r
dd
,v)=i
,r:r+7);
v=v+1;
end
n0=-2:10;
%adding noise
for s=1:length(n0)
y=awgn(dd,n0(s));
% despreading
for ss=1:r
rr
,ss)=dot(y
,ss),q);
% decoding to 0's and 1's
ra
,ss)=rr
,ss)>0;
end
% Error count
err_u=size(find([u-ra]),2);
end
%BER
ber_u= err_u/r
semilogy(n0,ber_u,'linewidth',2);
grid on;
hold on;
Error in ==> test2 at 22
dd
here it is code please correct ...i think the matrix formation is not correct could any body correct it...
clc;
clear all;
h=hadamard (8);
r=10000;
%orthogonal walsh code
q=h(1,
u=randint(1,r); %random data generation
%bpsk modulation
d=2*u-1;
%spreading
i11=kron(d,h);
i=i11;
% arranging the data in 8x10000 matrix
v=1;
for r=1:8:8*r
dd
v=v+1;
end
n0=-2:10;
%adding noise
for s=1:length(n0)
y=awgn(dd,n0(s));
% despreading
for ss=1:r
rr
% decoding to 0's and 1's
ra
end
% Error count
err_u=size(find([u-ra]),2);
end
%BER
ber_u= err_u/r
semilogy(n0,ber_u,'linewidth',2);
grid on;
hold on;