We investigate the ground motion produced by rupture propagation through circular barriers and asperities in an otherwise homogeneous earthquake rupture. Using a three-dimensional finite difference method, we analyze the effect of asperity radius, strength, and depth in a dynamic model with fixed rupture velocity. We gradually add complexity to the model, eventually approaching the behavior of a spontaneous dynamic rupture, to determine the origin of each feature in the ground motion. A barrier initially resists rupture, which induces rupture front curvature. These effects focus energy on and off the fault, leading to a concentrated pulse from the barrier region and higher velocities at the surface. Finally, we investigate the scaling laws in a spontaneous dynamic model. We find that dynamic stress drop determines fault-parallel static offset, while the time it takes the barrier to break is a measure of fracture energy. Thus, given sufficiently strong heterogeneity, the prestress and yield stress (relative to sliding friction) of the barrier can both be determined from ground motion measurements. In addition, we find that models with constraints on rupture velocity have less ground motion than constraint-free spontaneous dynamic models with equivalent stress drops. This suggests that kinematic models with such constraints overestimate the actual stress heterogeneity of earthquakes.