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
2022 年 11 月 19 日
ber(a) = numerrs/num_bits;
instead of
ber = numerrs/num_bits;
カテゴリ
ヘルプ センター および File Exchange で PHY Components についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!