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.

Inverse Transfer Function in s-Domain

Status
Not open for further replies.

twig27

Newbie level 6
Joined
Dec 6, 2016
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
131
Hello,
I have the transfer function of a system in the s-domain. For a given output I want to obtain the input. The most natural way to me seems to multiply the output with the inverse of the
transfer function. The problem in implementing this e.g. in Matlab is, that the inverse transfer function would have more zeros than poles which leads to an error.
Another idea is for example to implement a block diagram in simulink. The input is my output signal and in the negative feedback I put the original transfer function. This approach, however does not lead to the desired results.
I'm glad for any hints!
 

Do you have analytical form of the output , or just an array of values ?
 

The problem in implementing this e.g. in Matlab is, that the inverse transfer function would have more zeros than poles which leads to an error.
Simply decompose to N(s)/D(s) + A(s), where order of N(s) <= order of D(s).
 

The output is just an array of values
 

The output is just an array of values
Even if output is just an array of values, there is no problem.

You can use combination of lsim() and diff() in MATLAB.

H(s)=N(s)/D(s) + A(s)

lsim() for N(s)/D(s)
diff() for A(s)
 

What do you mean with the diff-Operator in this case?
If I decompose A(s) still has more zeros than poles.
 

Plot the output and show it here. Show transfer function of your model also.
 

This is the problem of deconvolution. https://en.wikipedia.org/wiki/Deconvolution

In general, you will have an approximation of the inverse. It is sometimes impossible to get an exact inverse. For example, a highpass filter with 0 gain at 0Hz will result in an inverse filter with infinite gain at 0Hz.

Likewise, for a causal filter the inverse will be non-causal.
 

Ok so below I attached the circuit model. This model is a rough estimate of what the system really looks like. In order to re-obtain the input signal (which is the current at the amp-meter, a mono-exponential decay) I first want to find a solid method for this model before I apply it to the actual system. Of course I could derive the exact transfer function for the simulation, but since it won't be possible for the real circuit I suppose to only know the output voltage and the input current.
Capture_Circuit.PNG
Then I used the system identification toolbox in order to estimate the system's transfer function. I did so for different numbers of poles/zeros. (Estimation was >99%).
I fed that to the Simulink model below. Here I first apply the transfer function to the current input and then do the inverse by putting the transfer function into the negative feedback.
Capture_Simulink.PNG
If I do so for a transfer function with 2 poles and 2 zeros I approximate the input better for higher gain. However the signal starts to oscillate unboundedly towards the end ( Can be avoided for gain -> inf).
The important part of the signal (which is the mono-exponential decay at the beginning) can however be reconstructed very well. (Yellow curve is input, red curve after transfer function, blue curve after inverse transfer function).
tf1.jpg
If I then choose a transfer function with 3 poles and 2 zeros the input signal cannot be approximated anymore by applying the inverse transfer function. If the gain is choose to high an error occurs and the simulation terminates.
tf2.jpg


From the simulation model I should expect 0 zeros (op amp circuit at output is 2nd order low pass bessel filter) and 3 poles. Results with that combination are however similar to the ones with 3 poles and 2 zeros.
Thanks for your advice!
 
Last edited:

Since any of the transfer functions I estimated has zeros in the right half plane, I guess the approach with the transfer function in the negative feedback is not going to work, because the will turn into poles and cause unbounded oscillations. Correct?
I did also try a Simulink model with input->transfer function->inverse transfer function-> recover input signal. If I however plug in any other signal into the inverse transfer function the ouput will oscillate again.
Does this mean that for my circuit it is impossible to apply the inverse transfer function to the output in order to recover the input signal?
 

First of all, before jumping into the "find the input necessary that gives a desired output" problem, you have to check the output of your model. Seems like the output is unstable for your input. In such case, you have to stabilize it. (I do not see how that is possible since System Identification Toolbox gave you that).
Since any of the transfer functions I estimated has zeros in the right half plane, I guess the approach with the transfer function in the negative feedback is not going to work, because the will turn into poles and cause unbounded oscillations. Correct?
Yes.

If Identification tool from MATLAB gives you several matches, obviously you have to choose the easiest one.

I did also try a Simulink model with input->transfer function->inverse transfer function-> recover input signal. If I however plug in any other signal into the inverse transfer function the ouput will oscillate again.
Does this mean that for my circuit it is impossible to apply the inverse transfer function to the output in order to recover the input signal?
If one of them is unstable, the whole will be unstable.
 
  • Like
Reactions: twig27

    twig27

    Points: 2
    Helpful Answer Positive Rating
I've been trying to make the inverse transfer function proper by adding negative poles far away from the imaginary axis, i.e. multiplying by (s+1E6)^2.
This worked well for the simulation containing only the bessel filter which has 2 poles. I am able to get a pretty good reconstruction of my original signal. (The actual poles are around 2E4).
If I add another RC Lowpass which introduces another pole the same method stops working. In this case I multiply by (s+1E6)^3 before inversion. The transfer function then becomes proper.
If I choose the artificial poles way to far from the imaginary axis, the reconstruction will also fail.

Is there a method to find the optimal location of artificial poles, so they only have a negligible impact on the transfer function characteristics?
 

10 times farther than the dominant poles should be O.K.
 
  • Like
Reactions: twig27

    twig27

    Points: 2
    Helpful Answer Positive Rating
twig27 said:
In my case
I have a transfer function of the form H(s) = 1/(s^3+a*s^2+b*s+c).
The inverse would just be the polynomial.
How can I simulate that in Matlab?

x1 = diff(x)/dt
x2 = diff(x1)/dt
x3 = diff(x2)/dt

y = x3 + a*x2 + b*x1 + c*x

If you don't have much data points for input x, you have to increase them by invoking interp1().
And I recommend independent variable, t is equi-spaced, dt.

Code:
dt=2*pi/1000;
t=[0:dt:2*pi];
x=sin(t);
size(x) ->> 1, 1001

x1=diff(x)/dt
x2=diff(x1)/dt
x3=diff(x2)/dt

size(x1) ->> 1, 1000
size(x2) ->> 1, 999
size(x3) ->> 1, 998

y = x3(1:end) + x2(2:end) + x1(3:end) + x(4:end)

[Note] : Data of MATLAB is a just array, so there is no independet variable information.

Code:
>> plot(x, 'r')
>> hold on, grid on
>> plot(x1, 'c')
>> plot(x2, 'g')
>> plot(x3, 'y')
 

Attachments

  • 170208-194658.png
    170208-194658.png
    13.2 KB · Views: 98
Last edited:

Thanks for explaining the technique! It works quite well, however there are problems when I try reconstruct a signal containing high freuquencies. The reconstructed signal exhibits strong oscillations. Are there certain constraints with regard to time resolution?

Could you recommend any literature on this?
Thanks!
 

however there are problems when I try reconstruct a signal containing high freuquencies.
The reconstructed signal exhibits strong oscillations.
Are there certain constraints with regard to time resolution?
Show me input signal and reconstructed output signal.

Could you recommend any literature on this?
It is no more than linear differential and integral equation problem.
So any elementary mathematics text book will be enough helpful for you.

Consider a decomposition of an input signal to low frequency and high frequency components.
 
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top