Incomplete transfer function for phase response

In summary, the user is trying to simulate a circuit using a SPICE model and is having trouble with the phase response. They believe that by changing the transfer function, they will be able to perfect the circuit. They have also tried implementing the transfer function manually and got a low pass filter.
  • #1
kvtb
11
0
Hi,

I'm currently busy with a 'small' project of translating an analog device (synthesizer, based on schematics) into a digital counterpart.
What I do is basically simulate the device using a SPICE model. Then I look at the outputs, and see if can fit some equation on it.

Based on the mathematical approximation of the circuit's behaviour, I implement an algorithm/DSP that shows the same behaviour as the analog version.
Now I've come to a small problem.

The circuit shows something that is a 2nd order active high pass filter. In my SPICE model, I did an AC simulation to get the frequency response of this filter (gain), and the phase response.

The next step was to find the transfer function for the filter. Well, that step already takes a week, so that's why this forum is my last resort, where I would like to show the problem. And hopefully someone has an answer.

Okay, the problem is as follows:
I use a standard transfer function for a 2nd order high pass filter:

[tex]H(s) = \frac{s^2}{s^2 + \omega_0/Q s + \omega_0^2}[/tex]

The following values give a perfect fit for the frequency response (ie gain, [tex]|H(s)|[/tex])
[tex]\omega_0 = 228.711[/tex]
[tex]Q = 1.58195[/tex]

look!

attachment.php?attachmentid=20926&stc=1&d=1254683685.png
(freq_gain.png)

But when you look at the phase response, there is no fit at all:

attachment.php?attachmentid=20927&stc=1&d=1254683685.png
(freq_phase.png)
(the phase jumps 360 degrees at 51.5 Hz)

So apparently, the transfer function is wrong or incomplete. Now my question is: how should the transfer function look like, to make sure both the measured frequency response and the measured phase response are perfectly captured in the equation?


For your reference, here is the schematic that was simulated:


attachment.php?attachmentid=20928&stc=1&d=1254683685.png
(hpf.png)

Thank you in advance for your help!
 

Attachments

  • freq_gain.png
    freq_gain.png
    11.7 KB · Views: 685
  • freq_phase.png
    freq_phase.png
    16.6 KB · Views: 646
  • hpf.png
    hpf.png
    10.6 KB · Views: 684
Engineering news on Phys.org
  • #2
Welcome to the PF. Why is R4 there?
 
  • #3
berkeman said:
Welcome to the PF. Why is R4 there?

I guess maybe for the 2nd order transfer function? Can you link to the original circuit you are trying to simulate? (where did you get the original circuit?)
 
  • #5
That phase doesn't jump! Phase angle wraps around (-180 = +180) and sometimes programs can't handle this wrapping correctly. That phase plot smoothly decreases from +270 to zero as frequency increases, that's all.

BTW. There is something else wrong with your plots. The green trace showing the phase of the stated transfer function should start at +180 and go to zero (not -180 to zero as shown).
 
Last edited:
  • #6
One final note.

If R4 were to have been connected to the output of the opamp (instead of the inverting input) then the circuit topology would have been precisely that of a second order high-pass "Sallen-Key" design. In this case you could just look up the transfer function of a Sallen Key filter and plug in the component values. As it is the circuit is a fair bit harder to analyse (but still do-able).

BTW. "Sallen-Key" was a very popular (and somewhat a standard) topology for active filters back in a their day.
 
Last edited:
  • #7
gentlemen,

your hints brought me back on the right track.

it could be a lucky shot, but found that a small change to the transfer function would give a perfect fit:

[tex]H(s) = \frac{s^2 + a s}{s^2 + \omega_0/Q s + \omega_0^2}[/tex]

a new term has been added to the numerator: [tex]a s[/tex]

The following values give a perfect fit for the frequency response and the phase response:
[tex]\omega_0 = 228.711[/tex]
[tex]Q = 1.58195[/tex]
[tex]a = -7.72458[/tex]

see attached plots

Thanks
 

Attachments

  • freq_phase2.png
    freq_phase2.png
    6.2 KB · Views: 524
  • freq_gain2.png
    freq_gain2.png
    5.3 KB · Views: 548
  • #8
Hi kvtb, quick question. What software are you using? I think it may be leading you astray as I question whether that phase response belongs to either that circuit or that transfer function.

Are you certain that the circuit diagram you posteed is the same one you're simulating?
 
  • #9
hello uart, I'm currently using qucs (http://qucs.sourceforge.net), but I'm considering re-simulating the same circuit in GNUcap just to be sure the software is not an issue here.

I indeed think that the circuit I'm simulating is the same I've posted here. Because just by looking at the theory (Sallen-Key like you mentioned) I expect a high pass filter, and the Bode-plot output of the AC simulation show a high pass filter


But yesterday I did a z-transform (manually) of the transfer function, then I implemented it, and I got a perfect.. low pass filter. So it's certain I made an error somewhere :smile:
 
  • #10
kvtb said:
hello uart, I'm currently using qucs (http://qucs.sourceforge.net), but I'm considering re-simulating the same circuit in GNUcap just to be sure the software is not an issue here.

I indeed think that the circuit I'm simulating is the same I've posted here. Because just by looking at the theory (Sallen-Key like you mentioned) I expect a high pass filter, and the Bode-plot output of the AC simulation show a high pass filter


But yesterday I did a z-transform (manually) of the transfer function, then I implemented it, and I got a perfect.. low pass filter. So it's certain I made an error somewhere :smile:

Ok it mostly looks good. I still think that the "measured arg(H(s))" shown in green in your first post is the negative of what it should be, but the phase angle shown in red now looks good except for the "wrap around" issue.

You should read that phase as a continuous decreasing function, starting at -90 degrees and finishing at -360 degrees. Remember that in the context of steady state AC analysis that multiples of 360 degrees are meaningless, so you can just as well read that phase as going from +270 degrees down to 0 degrees.

BTW. It turns out that the circuit really is precisely a Sallen-Key HPF from Vin to the opamp input. I analysed it (by hand) and got the following transfer function.

[tex]\frac{v_+}{v_{in}} = \frac{s^2} {s^2 + \frac{2}{R_2 C} s + \frac{1}{R_2 R_4 c^2} } [/tex]

What makes the circuit different is that the op-amp is no longer just a simple gain of two, because of the contribution of the current through R4 you get a whole another frequency response just from the opamp input to opamp output. I didn't analyse that part fully but I'm now confident that it does indeed introduce another zero, exactly as you had empirically deduced in your last post.
 
  • #11
Hang on. No there's still something bothering me about those results. I believe the results of the circuit simulation but I don't believe that the stated transfer fuction can give those phase results.

I can tell you for absolute certain that

[tex]H(s) = \frac{s^2 + a s}{s^2 + \omega_0/Q s + \omega_0^2}[/tex]

will not give the phase response shown. There is abolutely no way that is going to give the 270 degrees phase shift as shown - just can't happen.

Edit : I take that back. I was thinking that "a" was a positive constant. I only just noticed that you stated that "a" is negaive. That totally changes things, when "a" is negative then it does indeed give the phase response as indicated.
 
Last edited:
  • #12
Still one thing that seems wrong. That circuit definitely has a gain of 2 (6dB) in the pass-band though the simulation shows zero dB. ?
 
Last edited:
  • #13
I get a transfer function from V1 to opamp output of:

[tex]\frac{Vo}{V1} =(1+\frac{R_1}{R_3}) \frac{s^2-\frac{R_1R_3}{(R_1+R_3)R_2R_4C_2}s} {s^2 + (\frac{1}{R_2 C_2}+\frac{1}{R_2C_1}) s + \frac{1}{R_2 R_4 C_1C_2} } [/tex]

This circuit is a little unusual in that the right end of R4 is connected to the minus input of the opamp, rather than to the output of the opamp.

I've attached two plots. The first shows the gain response of the given circuit in blue, and also the gain response if the right end of R4 were connected to the opamp output.

The second plot shows the corresponding phase responses.
 

Attachments

  • FreqResp.png
    FreqResp.png
    2.5 KB · Views: 523
  • PhaseResp.png
    PhaseResp.png
    2.2 KB · Views: 550
  • #14
Yes I also analysed the TF from op-amp input to op-amp out last night to complete the overall response and got exactly the same answers as you "The Electrician". Good work. :)

I got :

[tex]\frac{v_{out}}{v_{in}} = \frac{2s (s - \frac{R}{2 R_2 R_4 C})} {s^2 + \frac{2}{R_2 C} s + \frac{1}{R_2 R_4 C^2} } [/tex]

Where [itex]R[/itex] is [itex]R_1 = R_3[/itex] and [itex]C[/itex] is [itex]C_1 = C_2[/itex].

The right half plane zero means it's not a "mininum phase" system. The numerator phase runs from +270 degress back to +180 degree (rather than from +90 through to +180 as it would in a minumum phase system).

BTW The Electrician, do you have software to analyse the circuit or did you also analyse by hand. Just wondering as it seems like a dying art. I was starting to think that I'm the only one left alive that can still do stuff like that. ;)
 
Last edited:
  • #15
uart said:
BTW The Electrician, do you have software to analyse the circuit or did you also analyse by hand. Just wondering as it seems like a dying art. I was starting to think that I'm the only one left alive that can still do stuff like that. ;)

I use a method involving admittance matrices.

I explain it in this thread:

http://forum.allaboutcircuits.com/showthread.php?t=26710
 
  • #16
@uart and The Electrician. As a non-EE I'm quite impressed by your analysis of the schematics.

I'll try to perform a manual z-tranform based on the transfer functions you've supplied.
Thank you.
 

1. What is an incomplete transfer function for phase response?

An incomplete transfer function for phase response is a mathematical representation of the relationship between the input and output of a system in terms of phase. It is considered incomplete because it does not take into account the magnitude of the output signal.

2. Why is an incomplete transfer function used for phase response?

An incomplete transfer function is often used for phase response because it simplifies the analysis of the system's behavior in terms of phase. This can be useful for understanding the stability and performance of a system.

3. How does an incomplete transfer function affect the overall response of a system?

Since an incomplete transfer function does not consider the magnitude of the output signal, it does not provide a complete picture of the system's response. It only represents the phase behavior of the system, which may not accurately reflect its overall behavior.

4. What are the limitations of using an incomplete transfer function for phase response?

One major limitation of using an incomplete transfer function is that it does not provide information about the magnitude of the output signal. This can be problematic when analyzing systems that are sensitive to changes in amplitude, such as audio or control systems.

Additionally, an incomplete transfer function may not accurately represent the true behavior of a system, as it only considers the phase response and not the overall response.

5. How can an incomplete transfer function be converted to a complete transfer function for phase response?

An incomplete transfer function can be converted to a complete transfer function by including the magnitude of the output signal in the analysis. This can be achieved by using a complex transfer function, which takes into account both the magnitude and phase response of a system.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
2
Views
992
  • Electrical Engineering
Replies
20
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Electrical Engineering
Replies
2
Views
5K
  • Electrical Engineering
Replies
3
Views
759
  • Electrical Engineering
Replies
23
Views
5K
  • Engineering and Comp Sci Homework Help
Replies
16
Views
907
Replies
7
Views
3K
Replies
4
Views
5K
  • Electrical Engineering
Replies
3
Views
4K
Back
Top