system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: What are all the different types of noises that an MRI makes when you’re getting a scan? And why is it different noises every few minutes?
gpt
An MRI machine collects data by delivering electromagnetic energy into the body to ‘flip’ the spins of nuclei in the body. When the nuclei flip back, they emit electromagnetic signals of the same frequency that are then detected by the system. 

The machine is set to have as homogeneous a magnetic field as possible at the center of the tube when nothing is happening. When a scan is taking place, the system rapidly changes the magnetic field within the magnet, using gradient coils, to provide spatial information. 

The sounds you hear have a variety of purposes. The slow knocking sounds that precede a scan are a pulse sequence designed to tune the cool to maximize the signal returned from the body. Then, the rapid knocking is from the rapid changes in the gradient coils during the scan itself. Different scanning sequences change the gradients at different rates, so the frequency of the sound you hear differs.

The gradient coils that sit on the outside of the magnet are long loops of wire that vibrate due to the current pulsing through them during the scan. What you hear is that vibration. 

Source: spent 10 years working for MRI vendor.