Ya got water hammer. Air chambers or water hammer arrestors may stop the noise. Sometimes it's just a matter of fastening the pipes tightly where they rattle.
Usually, it's caused by loose parts inside a faucet or toilet fill valve. Replacing the offending parts should fix it, if you can find them.
Now. Get a big magnet. Put it on the floor. Sit on it. Imagine yourself flying through the air. Are you flying? You have just as much chance flying by sitting on a magnet as you have of changing the chemical properties of water flowing through a pipe with an external device.