Message-Passing Algorithms for Channel Estimation and Decoding Using Approximate Inference