The hammering noise you hear when you turn off a faucet in your house is caused by water rushing against the closed valve. The hitting noise is from the pipe striking against wall studs or beams. If you add an air chamber to the water supply pipe, it will absorb the water shock hitting the valve and prevent the water hammer. You can buy one of these dampers or make your own.
Use a commercial hammer lightning rod if you have a problem with percussion in one place, such as a bathroom sink or kitchen sink.
Make sure your own multiple compartment air and install it on the water line enters your house. Cut 4 to 6 sections of tubes 12 to 18 inches long and a pressure cap on one end of each section of the weld.
Solder a copper t at the other end of each section, then cut 3 inch sections of the pipe to the tees from one to the other. Make sure that the vertical pipes all go up in the same direction. It is your rough collector.
Copper union at both ends of the manifold. A ball valve on both ends of the weld after the unions. This is the complete manifold.
Open a section of your water line and insert the manifold into place, with the vertical pipes at the top. This will solve your water hammer problem.
Shut off the ball valves if their hammering returns. To get rid of the percussion, undo the copper joints, remove the manifold and shake off the water. Reinstall the manifold and turn on the water again.