Optimal Frequency-Domain System Realization with Weighting