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.

Measure bode plot in LTspice?

Status
Not open for further replies.

northumber82

Member level 3
Member level 3
Joined
Jan 6, 2018
Messages
66
Helped
2
Reputation
4
Reaction score
2
Trophy points
8
Activity points
564
Hello, my problem it's a bit complicated.

I want to measure the magnitude (in dB) of the bode plot of a specific frequency after an AC analysis.

In my configuration:

1) I have a circuit (a simple low pass or an high pass filter)
2) I change with the command STEP the value of a resistor
3) For the resistor values where (X)Hz is higher than (Y)dB save the resistor value in the Error Log

It's possible to do with MEAS command combined with STEP param and automate LTspice?
 

For the resistor values where (X)Hz is higher than (Y)dB save the resistor value in the Error Log

For sure, you can also use the LTspice IF() command to check that condition.
 

For sure, you can also use the LTspice IF() command to check that condition.

Yes I know the IF statement but I don't know the syntax for the specific case. How to first of all, (Y)dB at (X)Hz? Then how to save the resistor with MEAS?
 
Last edited:

By typing the CTRL+L keys you can view the file with the measured values for each simulation step.
 

In what context do you press 'ctrl+L'?

If you run an AC sim at only one frequency it pops up a text file with a report of every node rather than a graph.

LTSpice has a lot of interesting and not well documented tricks....
 

CTRL+L show the error log.

I found how to display the magnitude and phase of every run at specific frequency with this command:

Code:
.MEAS ac Vo V(out) at=Freq

How now to implement the IF (Y)dB is > N?

I found db(x) to get decibel variabile, and done command like this:

Code:
.MEAS ac Vo V(out) at=Freq WHEN db(Vo)>N

But says failed. It's not documented how to use this syntax
 

Let's try something different.

Have a voltage source named vRfilter. The voltage source should have its positive terminal connected to a net label named "Rfilter". The net should be of type output. The negative terminal of the voltage source should be connected to GND. The value of the resistor in the value should be "R=V(Rfilter)". Now step this voltage instead of the resistor you stepped before.

Let your measurement command be as follows:
.meas R_cross find V(Rfilter) when Mag(v(y)/v(x))=5.

NOTE: Replace 5 with the dB value the you want to measure. With this error log report, you should be able to know intuitively which values of Rfilter yield higher magnitude and which yield lower. They mustn't be in the error log. Or must they?

It would be better to show your schematic so we see where you are placing your small-signal source and guide accordingly.

I hope this works.
 
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top