A generalized reflection-transmission coefficient matrix and discrete wavenumber method for synthetic seismograms