From: Anna V on
Hello,

Please help me...
I need to add 16 parity bits in matlab to a binary message, in order to form an error detection code C, transmit the message through the AWGN and after check the syndrome of code C.
Can you please help me?

Here is the code that I am using:
clear
N = 100; %number of bits
trellis=poly2trellis(7,[171 133]); % generator polynomial
bits = randint(N,1);% 1s and 0s for random bits
generator = crc.generator('0x8005');% crc-16 generator
detection = crc.detector('0x8005');% crc-16 detector
encoded_crc = generate(generator, bits);%crc addition
encoded_conv = convenc(encoded_crc,trellis);%convolutional encoding
modulated = 1-2*encoded_conv;%modulation
rx = awgn(modulated, -10);%pass through channel, AWGN, SNR=-10 dB
decoded = vitdec(rx,trellis,32,'trunc','unquant');%Viterbi decoding
decoded_crc = detect(detection,decoded);%CRC detection
new_crc = generate(generator,decoded_crc);%Generation of new CRC
num_of_err = length(find(new_crc~=decoded)) %comparing the new CRC with the received one

What is wrong with the code? when I compare the new CRC coded message with the one that I receive(without removing the CRC), it gives me 8 errors. Does this mean that the CRC is incorrect? How can I check the SYNDROME of CRC???

Thank you
PLEASE HELP...
 | 
Pages: 1
Prev: I need help
Next: Opposite of polyval