The "electric" beeping sounds from your iMac could indicate a hardware issue, such as a failing power supply or capacitors producing electrical noise. It might also stem from a failing hard drive or fan malfunction, both of which can cause unusual sounds when struggling to operate. Electrical interference from nearby devices or internal components like the Wi-Fi, Bluetooth, or speakers could also be responsible. Resetting the PRAM or SMC may help resolve the issue if it’s system-related. I would recommend you consulting an Apple technician is recommended to identify and fix potential hardware problems.