Do you hear that noise all the time, whenever power is on?
That might be fan noise (the fans are running at high speed.)
You can probably reset the power manager (known as the SMU on your iMac G5) which should get the fans working normally again. Do that by
1. unplugging all cables from the computer, including the power cord.
2. Wait 10 seconds.
3. Plug in the power cord while simultaneously pressing and holding the power button on the back of the computer.
4. Let go of the power button.
5. Press the power button once more to start up your iMac G5. (plug in whatever other cables you use)
If the noise does NOT occur until your iMac is in use for several minutes, then you slowly hear more noise - it might just b e heating up (because the cooling passages are partly plugged) and the fans have to work harder for cooling (and you hear a lot of noise.