1
\$\begingroup\$

Below the green plot Vin is 5Hz sine voltage signal from a function generator output sampled at 12kHz sampling rate:

enter image description here

The blue plot Vout is the processed/filtered data by using the following code in Python:

#Transfer function
fc = 1 # roll off freq
wc = 2*numpy.pi*fc 
sys = signal.lti([1], [1/wc, 1])  # transfer function

#Output in time (Response of the filter to the input)
tout, v_out, x = signal.lsim(sys, v_in, time)  # output

And here is Vout in a more detailed view:

enter image description here

Basically I define a low pass filter transfer function using: sys = signal.lti([ 1 ], [1/wc, 1]).

Then the Vout is obtained from tout, v_out, x = signal.lsim(sys, v_in, time)

So Vout is the filtered response of Vin.

If you compare the Vin and Vout in above plots, Vout looks like it is processed like in Laplace domain, that is to say Vout looks like it is both the transient and steady state response of Vin.

(This problem seen more obvious for a DC input; the output Vout becomes like a transient response of an RC filter)

Having the sampled data like in green plot Vin, how can we obtain a steady state response of such filter? Or at least close to steady state.

\$\endgroup\$
1
  • \$\begingroup\$ If you are providing a consistently steady-state signal, transient effects should decay towards the steady-state response. How many periods do you need for your response? For how long do you observe transient effects? \$\endgroup\$
    – loudnoises
    Feb 2, 2019 at 12:54

1 Answer 1

1
\$\begingroup\$

The filter starts from a steady state of having no input when it is created. The sudden start of signal is seen as a step to your filter, so it takes time to settle. As the filter is 1st order, it resembles RC filter so it's time constant Tau determines that it will have settled to 98% after time of 5*Tau. Besides it looks like the sampled signal does not start from zero either, but with a negative value.

When working in time domain, you must just wait for transients to settle and then look at the response. To speed that up, you might want to take a look at the filter state when it has settled, and initialize the filter state with that.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.