Help Please! I'm plotting curve for (7,4) hamming code.

I'm doing (7,4) hamming code can anybody tell me where I'm doing mistake for that I'm unable to get plot for this code? And how can I do convolutional performance in this code?
close all, clc, clear all;
num_bits = 8;
p = 0:0.0001:0.1
for a = 1:length(p);
genmat = hammgen(3)
n = 7; % Codeword length
k = 4; % Message length
data = randi([0 1],1,num_bits) % Random matrix
encData = encode(data,n,k,'hamming/binary')
nz = bsc(data,p(a))
data(4) = ~data(4)
decData = decode(encData,n,k,'hamming/binary')
numerrs(:,1) = biterr(data,decData)
ber = numerrs/num_bits
end
plot(p,ber,'g--o')
xlim([0 0.1])
ylim([0.0001 1])
legend('hamming (7,4)')
xlabel('p crossover probability for the bsc')
ylabel('Probability of error')
title('19TL49')
grid on

답변 (1개)

Torsten
Torsten 2022년 11월 19일
ber(a) = numerrs/num_bits;
instead of
ber = numerrs/num_bits;

카테고리

도움말 센터File Exchange에서 PHY Components에 대해 자세히 알아보기

질문:

2022년 11월 19일

답변:

2022년 11월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by