This code works for generator matrix G(D) = [1 (1+D^2)/(1+D+D^2)].
The MATLAB code for the logBCJR algorithm is inspired by the SCILAB code of BCJR algorithm in the probability-domain written by K Vasudevan and can be found at http://home.iitk.ac.in/~vasu
References: see the book "Channel coding: classical and modern" by William Ryan and Shu Lin.