MBS Scheduled payment (with prepayment)

Is there a formula for the calculation of a MBS scheduled payment (if there is a prepayment)?

I know that if there is no prepayment the calculation is

Mortgage_Pmt=Mortgage_Obal(i(1+i)^n/[(1+i)^n-1]) where i = WAC/12

(The reference in the notes refers to a Fabozzi’s text Chapter 19 for the mathermatics but this is not available on the web)

I’ve tried unsuccessfully to derive the formula from a known SMM but without success.

The Mock exam afternoon B (Richter) has an answer set which I cannot determine without a formula.

Any suggestions?

Thanks

I think they recalculate an amortizing payment each month. The principal knocked down is calculated off that new amortizing payment less the interest portion of UPB*WAC/12. After you deduct the interest you multiply that by the SMM.