new functions by MJR for trapezoidal AM