Following the example "Remove the 60 Hz hum from a signal", I tried to run a butterworth filter in order to filter out multiples of 60 Hz (60, 120, 180, 240, etc.) from my signal. However, in some of my signals, the filter actually amplifies those frequencies which I am trying to filter out. Here is some my code. All help is appreciated:
multiples60 = 60:60:2500;for v=1:length(multiples60) halfpowerHz1 = multiples60(v) - 2; halfpowerHz2 = multiples60(v) + 2; d = designfilt('bandstopiir','FilterOrder',2, ... 'HalfPowerFrequency1',halfpowerHz1,'HalfPowerFrequency2',halfpowerHz2, ... 'DesignMethod','butter','SampleRate',Fs); %butterworth filter
if v==1 buttLoop = filtfilt(d,fsignal); else buttLoop = filtfilt(d,buttLoop); endend
Best Answer