필터 지우기
필터 지우기

Trying to use a Butterworth Filter

조회 수: 6 (최근 30일)
Abbey
Abbey 2012년 1월 11일
I am trying to filter out the noise from an array of wrist position data which is in degrees and was taken at 50 Hz. This is my first time using MATLAB, and this is not my area of expertise at all. I am struggling to get the results that I am looking for. I first used the fft function to get my data into the frequency domain and then used the butter function to create my filter. I wanted to perform a 6th order lowpass Butterworth Filter with a cutoff frequency of 5 Hz. I set Wn = 5/25 (cutoff frequency/nyquist frequency). I then took the fft of of my Butterworth filter and multiplied that by my data in the frequency domain. Finally, I brought my results back to the time domain by using the ifft function. My results look correct, the data follows the path of the original data but without the noise, but the values of my data are completely different. I have what looks like the correct graph, but it is shifted. I realize this changes as I change Wn, but I think I am using the correct Wn.
Any advice here would be greatly appreciated.

채택된 답변

Rick Rosson
Rick Rosson 2012년 1월 11일
I would recommend that you stay in the time domain, and simply use the filter function. It is much simpler, and probably more accurate, than the frequency domain method that you described.
>> doc filter
HTH.
Rick
  댓글 수: 2
Jan
Jan 2012년 1월 11일
And perhaps also: doc filtfilt
Abbey
Abbey 2012년 1월 11일
Thank you both! This worked great...when I used the filter function, I ended up with a small phase shift, so then when I used filtfilt, that was eliminated.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by