Hamid_net
Newbie level 1
Hello, I want need to exploit "LDPC as in Elec. Letters by MacKay&Neal 13March1997" which wrote by Igor Kozintsev.
SNR=[-10:5];
for i=1:length(SNR)
sigma = 10^((-SNR(i))/20); % AWGN noise deviation
x = (sign(randn(1,size(G,1)))+1)/2; % random bits
y = mod(x*G,2); % encoding
z = 2*y-1; % BPSK modulation
z=z + sigma*randn(1,size(G,2)); % AWGN transmission
f1=1./(1+exp(-2*z/sigma^2)); % likelihoods
f1 = (f1))'; % make it a row vector
f0=1-f1;
[z_hat, success, k] = ldpc_decode_LR(y,f0,f1,H);
x_hat = z_hat(size(G,2)+1-size(G,1):size(G,2));
x_hat = x_hat';
Error(i)=length(find(x-x_hat))
end
But I have a problem to create G and H matrixes. is there any suggestion how I can create G and H matrixes. Now I have predefined matrixes which I extracting from this code: https://www.mathworks.com/matlabcen...37-simulating-2-2-mimo-ldpc-base-band-systems
SNR=[-10:5];
for i=1:length(SNR)
sigma = 10^((-SNR(i))/20); % AWGN noise deviation
x = (sign(randn(1,size(G,1)))+1)/2; % random bits
y = mod(x*G,2); % encoding
z = 2*y-1; % BPSK modulation
z=z + sigma*randn(1,size(G,2)); % AWGN transmission
f1=1./(1+exp(-2*z/sigma^2)); % likelihoods
f1 = (f1))'; % make it a row vector
f0=1-f1;
[z_hat, success, k] = ldpc_decode_LR(y,f0,f1,H);
x_hat = z_hat(size(G,2)+1-size(G,1):size(G,2));
x_hat = x_hat';
Error(i)=length(find(x-x_hat))
end
But I have a problem to create G and H matrixes. is there any suggestion how I can create G and H matrixes. Now I have predefined matrixes which I extracting from this code: https://www.mathworks.com/matlabcen...37-simulating-2-2-mimo-ldpc-base-band-systems