Alyse Kehler
unread,May 21, 2013, 1:56:07 PM5/21/13You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi,
I am having trouble completely filtering out some force data, because I believe the noise is at the same frequency as the data I need.
So far I have been using a butterworth 4th order filter like so. This works for running and walking force data, but now I am working with roller skiing.
sampling_freq = 1000;
cutoff =20;
[B,A]=butter(4,cutoff/(sampling_freq/2),'low');
and the traces come out with an obvious sine wave and extremely noisy.
So then I figured out what frequencies of noise there when during a zero trial on the treadmill using a fast fourier command:
function spectral_peaks=fast_fourier(data,Fs)
% inputs:
% data: column vectors with frequencies to be analyzed
% Fs: input frequency data was recorded at
Fs=Fs;
m=length(data);
n=pow2(nextpow2(m));
y=fft(data,n);
f=(0:n-1)*(Fs/n);
power=y.*conj(y)/n;
plot(f,power)
xlabel('Frequency (Hz)')
ylabel('Power')
title('Periodogram')
signals=findpeaks(power);
for n = 1:length(signals)
frequency_index(n,:)=find(power==signals(n));
end
spectral_peaks=f(frequency_index(:,1));
And then I would use a bandstop filter to remove all those frequencies. But the problem I am running into is that first, there are a lot of noise frequencies to remove and I am simultaneously removing most of my data as well.
Any suggestions or other ways I could clean up my plots while still retaining my data?
Thanks so much, Alyse