Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

1st order recursive LPF cut-off frequency

Status
Not open for further replies.

nabla101

Junior Member level 3
Junior Member level 3
Joined
Feb 8, 2011
Messages
30
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Visit site
Activity points
1,600
Hi,

I am taking recorded measurement data sampled at 8ms (125Hz) and using a library Software function for a low pass filter built into the measurement program.

I have looked at the code of the function, and it uses a parameter, a, ("smoothing factor") where 0 < a < 1, and a = 1 means no filtering, I have managed to write a difference equation and the transfer function for the filter in the z-domain based on the code:

y[n] = (1-a)y[n-1] + a*x[n]

where y[n] and x[n] are current output and input. From which I got the transfer function:

H(z) = a / (1 + (a - 1)*z^(-1) )

I can reduce the value of a towards zero, and see the software function perform filtering, but what I want to be able to do is to specify a -3dB cut-off frequency in HERTZ, e.g. 1kHz, 2kHz, and use this as an input to the function instead of the "smoothing factor", a. (Or at least be able to convert from a frequency in Hz to the parameter a, which I can then use in the function)

I have been reading lots of stuff on digital filters, and found a formula that relates a to cut-off frequency, for a low-pass filter of this type, which was:

a = e^(-2*Pi*f_c)

View attachment dsp_book_Ch19.pdf

but it says that f_c must be between 0 and 0.5, I want to input a value in Hz - If I try to use this formula with for example 1kHz cut-off it just tells me to set the smoothing factor to zero because of the exponential function.

I also read I might need to use an inverse bilinear transform to transform to the s-domain, and use a 'frequency warping' formula, which will all depend on the sampling frequency.

Assuming my sampling frequency is fixed, what is the easiest way for me to go about this?

Thanks

(attached .pdf with that formula)
 

but it says that f_c must be between 0 and 0.5
Yes indeed, that's due fundamental law of time-discrete system, called Nyquist criterion. Input signals > fs/2 will be mirrored ("aliased") into the base band, 1 kHz e.g. to zero Hz. For unequivocal representation in sampled data, the signal input must be band limited.
 

Yes indeed, that's due fundamental law of time-discrete system, called Nyquist criterion. Input signals > fs/2 will be mirrored ("aliased") into the base band, 1 kHz e.g. to zero Hz. For unequivocal representation in sampled data, the signal input must be band limited.

Hi, thanks for your reply,

The Nyquist theorem says that the sampling frequency, fs must be greater than or equal to twice the highest frequency contained in the signal, fh, in order to prevent aliasing, fs >= 2*fh, but I don't understand why this should limit the cutoff frequency fc to between 0 and 0.5...I don't understand... 0 to 0.5 what? Hertz?...surely can't be Hertz, as that would be no use in a practical filter.

I don't understand how this helps me, because I just want to choose a cut-off frequency of say 1kHz, and then be able to set the parameter, "a" (smoothing factor) in the software function to the corresponding value to implement my LPF.

I have a fixed set of measurement data with a fixed sampling rate of 125Hz.

Cheers
 

limit to 0.5 * sampling frequency.

You apparently tried to implement a filter with 125 Hz sampling frequency and 1 kHz cut-off.
 

limit to 0.5 * sampling frequency.

You apparently tried to implement a filter with 125 Hz sampling frequency and 1 kHz cut-off.

Have I got this right? You're saying the highest cut-off I can implement is 0.5*fs = 62Hz, because that's the highest frequency that can appear in my signal due to nyquist?

so for example, lets say that I want to implement a cut-off frequency of 20Hz, then I would set a to:

a = e^(-2*Pi*20) =2.6604

or

a = e^(-2*Pi*0.16) = 1.1496 (since 20Hz / 125Hz = 0.16)

I don't understand because the function says I should have 0 < a < 1.

How can I calculate a for 20Hz cut-off?

Thanks
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top