필터 지우기
필터 지우기

Error using BCH encoding scheme

조회 수: 3 (최근 30일)
amit sikder
amit sikder 2015년 11월 29일
I am trying to encode an image file using BCH encoding scheme using communication toolbox. I am using comn.BCHEncoder function. Problem is the code is showing an error in step function. this is the code -
clc, clear all;
[X,map]= imread('xxxx.jpg'); % read an image 30x30
msg = im2bw(X,map,0.3);
imshow(X,map), figure, %if we don't use figure we can't see the two images
m = 4; n = 2^m-1; % Codeword length = 15
dim=size(msg+0);
%n=double(dim(2)+1);
k=double(dim(2));
msg_d=double(msg);
m=5;
msgN=gf(msg,m);
N=2^n-1;
% decBCH=comm.BCHDecoder;
encBCH = comm.BCHEncoder(n,k);
decBCH=comm.BCHDecoder(n,k);
size_1=dim(1);
BCHEnc=zeros(dim(2)+2,dim(1));
tic
for i=1:size_1
BCHEnc(:,i)=step(encBCH,msg_d(i,:)');
end
toc
MATLAB is showing following error -
step(encBCH,msg_d(1,:)')
Error using BCHEncoder/step
The input and output dimensions must be consistent with the message or codeword length, including the effects of possible puncturing.
if I want to use message matrix [180x30] for example, should I take row by row? What should i use as a value of n and k in comm.BCHEncoder(n,k) then?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by