% generate bit matrix based on groupname_Bsize.mat clear; load 'hassebrook_B.mat'; load 'hassebrook_Bsize.mat'; % generate a real vector s, N=65536*8 or let N be less for debug process N=32 Nsample=N/Nbit % form pulse shape pulseshape=ones(1,Nsample); % as a base line we will use PAM modulation without a carrier Nseq % modulate first sequence to either +1 and -1 values b1(1:Nbit)=2*B(1,1:Nbit)-1; s=kron(b1,pulseshape); size(s) % verify shape %figure(1); %plot(s); % modulate second sequence to +2,+1,-1,-2 b2(1:Nbit)=B(2,1:Nbit)+1; s=s.*kron(b2,pulseshape); %figure(2); %plot(s); % create the bit check matrix samplepulse=zeros(1,Nsample); samplepulse(Nsample/2)=1; Bcheck=zeros(Nseq,N); % modulate first sequence to either +1 and -1 values b1check(1:Nbit)=2*B(1,1:Nbit)-1; bcheck1=kron(b1check,samplepulse); % modulate second sequence to either +1 and -1 values b2check(1:Nbit)=2*B(2,1:Nbit)-1; bcheck2=kron(b2check,samplepulse); % augment Bcheck(1,1:N)=bcheck1(1:N); Bcheck(2,1:N)=bcheck2(1:N); figure(3); n=1:N; plot(n,s,n,bcheck1,n,2*bcheck2); save 'hassebrook_signal' s; save 'hassebrook_Bcheck' Bcheck;