Calculation of NMR spin echo responses in solids