Development of a General Procedure to Formulate Four Pole Parameters by Modal Expansion and Its Application to Three-Dimensional Cavities