Theory of irregular impedance waveguides: Generalized method of separation of variables