expand on fpfm encoding transformations

generalize to handle non-square M transformations