How can you tell the difference between an explosion and an earthquake on a seismogram?
Explosions and earthquakes both release a large amount of energy very quickly, and both can be recorded by seismic instruments. However, because the forces involved in each are very different, the waveforms that each creates look different.
Nuclear tests are very near the surface of the earth; all of the energy is released from a small volume surrounding the device. Earthquakes are typically several to many kilometers beneath the surface of the Earth; the energy is released from the fault surface, which can be several to many kilometers long, depending on the size of the fault. The differences in the depth and extent of the energy source produces differences in the waveforms that are recorded on a seismogram.
Lastly, nuclear explosions typically release energy between 2-50 kilotons of yield, compared to, for example, the M6.5 Afghanistan earthquake in May of 1998 that had an equivalent yield of 2,000 kilotons.
https://www.usgs.gov/faqs/how-can-you-tell-difference-between-explosion-and-earthquake-seismogram#publications