An Approach to the Optimal Design of General Multirate Control Systems