Analysis of coding on non-ergodic channels