Real-time acquisition of electromyography (EMG) during functional Magnetic Resonance Imaging (fMRI) provides a novel method of controlling motor experiments in the scanner using feedback of EMG. Due to the redundancy in the human muscle system this is not possible from recordings of joint torque and kinematics alone, as these provide no information about individual muscle activation. This is particularly critical during brain imaging as brain activations are not only related to joint torques and kinematics but are also related to individual muscle activation. However, EMG collected during imaging is corrupted by large artifacts induced by the varying magnetic fields and radio-frequency (RF) pulses in the scanner. Methods proposed in literature for artifact removal are complex, computationally expensive and difficult to implement for real-time noise removal. We describe an acquisition system and algorithm which enables real-time acquisition for the first time. The algorithm removes particular frequencies from the EMG spectrum in which the noise is concentrated. Although this decreases the power content of the EMG, this method provides excellent estimates of EMG with good resolution. Comparisons show that the cleaned EMG obtained with the algorithm is, like actual EMG, very well correlated with joint torque and can thus be used for real-time visual feedback during functional studies.