• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

LTspice invert signal in AC analysis

jds_0515

New Member
Hi Guys,

Does anyone know if it's possible to create a circuit for an AC analysis that will invert another signal? I've tried all sorts of things (e.g. using behavioral elements), and looked on online, but have not been able to find a solution. The BV element can invert and multiply signals for time domain analysis (.tran) but in the frequency domain it appears to be limited. I've included my circuit below (one of the things I tried) and the results from running it with an AC analysis. The inverted signal should have a value of -6dB but instead is not plotting a magnitude (scale is at 3.08KdB). The reason I'm interested in this is because I'd like to be able manipulate large laplace expressions with the behavioral elements by multiplying and dividing signals representing different laplace expressions.

ltspice_forum_posting_2020_01_21_a.png


Thanks for any help you can offer in advance.
 
Last edited:

kubeek

Well-Known Member
Most Helpful Member
What do you mean invert the signal? If you want 6dB to become -6dB, then you need a gain of -12dB. If you want at the same time for 10dB to become -10dB, then I think you are out of luck. Why would you even want to do that?
 

jds_0515

New Member
Thanks for your reply.

Yes, I want V(2) = 1/V(1), so that I want 6db to become -6dB and 10dB to become -10dB.

The reason I'm interested in doing this is because I am trying to simulate a filter that is a Laplace function (AC analysis), with the function being a product or division of other Laplace functions.

For instance if the pseudo-code looked like this

G1 = Laplace (s^2/ (s+3)^2) (can use E element to implement this)
G2 = Laplace (s+3))

I want to calculate
G3 = G1/G2
without having to use a single E element with one (potentially long) expression containing both G1 and G2's expressions in them. This makes debugging much more manageable (it's easier to make an error when typing in long expressions with "s" terms). Also, G1 may be used in another filter (e.g. G4), so being able to break the filter into smaller pieces in general would make things easier.

What I've done (and which worked) is to create a filter 1/G1 by typing in the Laplace formula ";aplace (( s^2/(s+3)^2 )^(-1))" in an E element , the output of which I can then cascade with other E elements to make a filter that is a product (or division of other filters). It's still not exactly what I want, because now I have to create separate G and 1/G "E" elements if I'm going to use them both in expressions, but it works for now.
 
Last edited:

ronsimpson

Well-Known Member
Most Helpful Member
Yes, I want V(2) = 1/V(1), so that I want to 6db to become -6dB and 10dB to become -10dB.
"invert"??
I think V(2)=1/V(1) is simple using volts as a unite of measurement. 0.5V=1/2V
But you are using db to measure. 6db becomes -6db and 10db becomes -10db. This is a very strange function.

Then you are doing a frequency sweep form 1 to 100 on a function. It should be flat as shown.

Please attach your file so we can play with it.
 

jds_0515

New Member
I appreciate your help, but I'm not quite following you. In the frequency domain, creating an inverse is a pretty reasonable function. If G is a filter that is defined as laplace(s) then the inverse of that would be a filter H defined as laplace(1/s). G/H would be a filter that is laplace(s^2). I've attached the model (an acoustical conical waveguide) I created so you can have a better sense of what I've done. Getting this debugged was a challenge, partly due to the extremely long Laplacian expressions that have to be typed in perfectly, but it's working now and I validated it in the frequency domain (AC analysis). I would love (because it would have made this model easier) if it were possible to multiply (or divide) two signals in the frequency domain (not just one signal and a filter that is defined as Laplacian using E element, which is what I have done), but I'm gathering that this may only be possible in time domain analysis in LTspice using BV elements.

Cheers!
 

Attachments

simonbramble

Active Member
Have you tried manipulating the plot icon... the V(1) at the top of the plot window? If you modify this to read 1/V(1) it will plot -6dB instead of +6dB.

OK this is manipulating the plot and not the schematic which might not be exactly what you want, but it is a start.

You can manipulate the plot icon to display anything you want so is the next best thing to using, say, a behavioural voltage source.

If you get sick of manipulating the plot icon every time you run the simulation, you can save the plot settings (File -> Save plot settings) when the plot window is selected and this will auto plot your waveforms without you having to reclick on the schematic.

I see what you are trying to do - say, replace a high pass filter with a low pass filter by replacing the 1/s term with the s term..

Untitled.png
 

Latest threads

EE World Online Articles

Loading

 
Top