Register to reply 
Low Pass Filter in Software question 
Share this thread: 
#1
May712, 03:35 AM

P: 13

Hi Everyone,
I read an article by Barry L. Dorr about how to implement a Low Pass Filter in software, however, the equation that he gave confused me as I didn't see any sort of convergence to the value desired. So here is the equation: y(n) = (1  2^(k)) * y(n1) + x(n) x is the input, y is the output, n is the index, and k is the filter strength So I understand how k works as it just makes it so that previous values affect the output less. But where I run into problems is the + x(n) term. So taking the example where k = 4, I have the equation: y(n) = 0.9375 * y(n1) + x(n) Then I will just create an arbitrary array with which I want to lowpass and smooth out. So lets say, x(n) = {1, 5, 3, 2} Then that means, y(3) = .9375 * y(2) + x(3) = 8.031 + 2 = 10.031 y(2) = .9375 * y(1) + x(2) = 5.5664 + 3 = 8.5664 y(1) = .9375 * y(0) + x(1) = .9375 + 5 = 5.9375 y(0) = x(0) = 1 So at this point, I can see the the output array is not even converging to getting larger as time goes on, even though the maximum input to lowpass filter was 5. Any insight on how this works would be great. 


#2
May712, 01:47 PM

Engineering
Sci Advisor
HW Helper
Thanks
P: 6,957

You mean ths article? http://www.edn.com/article/465351A_...plications.php
He "forgot" to tell you that his simple filter has a gain at low frequences. If you see what happens when you filter a constant input signal with all the x(n) values equal to 1, the output values are 1 1 + .9375 1 + .9375 + .9375^2 1 + .9375 + .9375^2 + 9375^3 etc. This is a geometric series. The output will rise "slowly" and then level off at the value of 1 / (1  .9375) = 16. Note: you will need to get about 50 output values to see the complete picture of what happens. If you want the filter to have a gain of 1 at low frequencies, use y(n) = 2^(k)(1  2^(k)) * y(n1) + 2^(k)x(n) instead. 


#3
May712, 06:09 PM

P: 13

Ah yes,
I did notice that when I was running it in my actual software. It would level off at around 16 if I passed in a large array. I will try implementing your lowpass filter with gain of 1 and see how it works out. Thanks. 


#4
May712, 08:05 PM

P: 13

Low Pass Filter in Software question
Okay I just implemented the lowpass filter and it does have the affect of "smoothing" out my data, now I want to implement a high pass filter for my data. My main question is,
What affect does a high pass filter have on my dataset? For example, I know that the low pass smooths out data and passes low frequencies (changes?). So applying this logic, does the high pass filter converge more quickly to my data, (ie. pass large changes in data but not small?) 


#5
May812, 03:26 PM

P: 639

Short answer: high pass leaves you with the part that low pass removes. If your data are the sum of a lowfrequency "signal" and some higherfrequency "noise" then lowpass will tend to filter out the noise, while highpass will leave you with the noise. (Of course, one person's noise is another person's data, etc., etc...)
The time derivative (changes) is weighted toward high frequencies in a sort of "ramp" rather than providing good "high pass." 


Register to reply 
Related Discussions  
Low pass filter question  Engineering, Comp Sci, & Technology Homework  3  
High pass filter and low pass filter question?  Engineering, Comp Sci, & Technology Homework  6  
Transforming a low pass filter to a band pass and low pass filter  Engineering, Comp Sci, & Technology Homework  0  
Transforming a low pass filer to a high pass filter  Engineering, Comp Sci, & Technology Homework  0  
A question on passive lowpass filter  Engineering, Comp Sci, & Technology Homework  3 