I am trying to filter out a humming noise from my recordings. The noise has a frequency of 20kHz and it's harmonics (40,60,80 kHz).
I want to filter out all the noisy parts with one pass over the signal and the only solution I have managed to come up with is by removing each frequency with a for loop (see code). This takes a lot of time, I need to filter about 2 hours of audio recordings with 250k sampling rate.
My question is, is there a method to filter out all the desired frequencies in one pass instead of multiple passes to save computational time.
Fs = 250000;
onset = 19700;
offset = 20000;
times = ;
for k = 1:n
d = designfilt('bandstopiir','FilterOrder',2, ...
filtered = filtfilt(d,filtered);
times = [times,toc];