This might seem a strange answer, but it has fixed this fault on my 27" two year old iMac (at least for a few days now, will be monitoring).
I had this very fault suddenly develop last week. It was consistent, the noise increased with screen brightness, but was also present with the screen asleep.
I looked at every forum on the subject, became almost convinced my fans weren't controlling properly as well.
I decided it was the switched mode power supply, discussed repair options with my local Apple Store.
Checked the household mains voltage - I'm in the UK, it was slightly low at 236v AC, but thats acceptable.
Then ....
We have a garden full of water features and LED lighting.
I just decided to check all our power junction boxes that supply power to various pumps and lighting.
I found one of the boxes full of water, with the Live, Neutral and Earth, and the 12v DC cables all under water and shorted together. The terminals were all corroded and burnt.
Yet, I had no faults present in the garden, everything was running normally. And the RCD breaker had not tripped.
I repaired the box, fitted new terminals and rewired the box.
And since I did that, my Mac has cured itself.
I've had it running for hours to get hot, no noise, gone completely.
And the mains voltage now measures 242v AC (should be a nominal 240).
The RCD did not trip because, with all the cables shorted in water, there would no out of balance condition to initiate a trip.
So, I can only assume that arcing or the short was causing some harmonics on our mains supply that was been picked up by the coils in the Mac power supply.
The 12v DC supply in the junction box was also supplied by a switched mode supply. I dont understand why something didnt blow in the garden, but it didnt.
I'm monitoring the Mac as the solution just seems unrelated.
Oh, and I noticed our Intruder Alarm panel was humming loudly and now it isn't.
So, I would suggest anyone with this issue takes note of any unusual humming or buzzing in any other electrical item within the house, or outside. It may indicate you have an issue elsewhere.
Even any loose mains plugs in equiment could be causing a slight arcing on the contacts, causing noise on the mains that may be getting picked up.
Coming from an interest in high-end analogue Hi-Fi, amplifiers always performed better with a dedicated, clean, mains supply, usually from a 40 amp rated cable fed direct from your electricity meter to supply your Hi-Fi.
The amplifiers would exhibit less noise and a cleaner sound with more detail. And the transformers in the power supply were a lot quieter too.
And what do we have today - ethernet tranducers plugged into household sockets, superimposing high frequency signals onto the household wiring.
They would cause havoc with top-end amplifiers, I'm sure.
I hope this is the solution, saves me an expensive repair.
I've never had any problems with the six Macs I've owned in the last 12 years.