# Measure bode plot in LTspice?

1. ## Measure bode plot in LTspice?

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?  Reply With Quote

•

2. ## Re: Measure bode plot in 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.  Reply With Quote

•

3. ## Re: Measure bode plot in LTspice? Originally Posted by andre_teprom 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?  Reply With Quote

•

4. ## Re: Measure bode plot in LTspice?

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

5. ## Re: Measure bode plot in LTspice?

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....  Reply With Quote

6. ## Re: Measure bode plot in LTspice?

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  Reply With Quote

•

7. ## Re: Measure bode plot in LTspice?

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.  Reply With Quote

--[[ ]]--