This paper develops a generalized ac impedance model for synchronous generators and then a dc impedance model for generator-thyristor systems. The impedance model of a medium voltage dc (MVdc) system is built for impedance-based stability and harmonics analysis. DC current harmonics from a high-power neutral point clamped (NPC) direct torque control (DTC) motor drive is examined. It is found that dc network resonance is a major cause of dc current harmonics amplification and propagation in MVdc systems. As a result, adding a dc side input filter can attenuate current harmonics from NPC DTC drives. Three criteria to design the dc-side filter are deduced from the impedance analysis. The effectiveness of the design criteria is tested and verified by time-domain simulations.