# Attempting to remove the 60Hz frequency out of a noisy ECG signal

load eeg_plus_noise
Fs=200;
Fn=Fs/2;
b = fir1(64,[59.8 60.2]/Fn,'stop');
figure(3)
freqz(b,1,512,Fs);
y = filter(b,1,eeg_plus_noise);


I am then using the pwelch function to assess if this has removed the 60hz signal.

My understanding of MATLAB is limited because I'm struggling to make use of the signal into the filter properly. I know there is a simpler solution. Am I not instantiating the variables correctly? My plot simply shows the frequency response in phase and magnitude. I'm looking for a filtered out signal with Pwelch. PSD.

• If you run pwelch on the unfiltered signal, and also on the filtered signal, you can compare the power difference at 60 Hz. Is that what you need? – MBaz Feb 26 at 17:26