0

I am really sorry for this stupid question but it waste 1 week of my time and i did not find answer. I have a manual of a tool that manufacturer mentioned : "A T-Filter, a simple digital moving average low-pass filter, is used for the accelerometer sensor outputs." I have this output and wrote a code for filter in python but later, I was thinking that codes are not useful because they are for butterworth filter not average. I try to find some codes for average lowpass filter in python but could not. waiting for any idea.

Codes:

cutoff = 99
fs = 200
order = 5

b1 = message.split()[0]
a11 = float (b1)
d = [a11]

nyq = 0.5 * fs
normal_cutoff = cutoff / nyq
b, a = butter(order, normal_cutoff, btype='low', analog=False)
y = S.lfilter(b, a, (d))
print y
kian
  • 87
  • 1
  • 11
  • What's in `message`? Also, please try formatting your question (punctuation, capitalization, paragraphs...) for better readability. – adrianus Jul 16 '15 at 07:59
  • i will do it. messages are just numbers that i wamt to give as input to filter – kian Jul 16 '15 at 08:02
  • It's hard to understand the purpose of this code (input, expected output).. What module you import to get `butter()`, `S.lfilter()` methods? – Andersson Jul 16 '15 at 08:18
  • Just to get the question right, `message` contains the input for the filter, which is to be run through a "filter method", namely "moving average low-pass filter" which would result in a list of points, i.e output. ak.a `[y,y1, y2, y3..]`. Adding to this, the filter could be described as stated here http://www.analog.com/media/en/technical-documentation/dsp-book/dsp_book_Ch15.pdf. Is it ? – JRajan Jul 16 '15 at 08:21
  • @Andersson `from scipy.signal import butter, lfilter` to be honest output is not important for me. i just want to do exactly the same thing that manufacturer did. i only need to know how define a average lowpass filter (one of the most famous filter) in python. – kian Jul 16 '15 at 08:24
  • @JRajan exactly you are right. about the link i already read it but i am not sure if it is low pass. – kian Jul 16 '15 at 08:34

0 Answers0