R
rickman
- Jan 1, 1970
- 0
I have always found the documents for LTspice to be rather spartan at
best. It looks like there are a lot of third parties who are helping by
chipping in their shots at tutorials and docs. But they are mostly
introductions and getting started guides covering only the most basic
stuff.
I am trying to do what should be some simple measurements on a tuned
circuit. I want to see how various additions to a circuit alter the
tuned frequency, bandwidth and Q. So it would be nice to get these
numbers automagically. I've figured out how to get the bandwidth and
the tuned frequency and even the Q. But it printed the frequency and Q
in dB. The tuned frequency is no problem as it is also displayed
linearly, but I can't find a way to display the calculated Q as a simple
number other than doing the reverse dB calculation so it displays the
proper number but with a dB label... obviously not my first choice.
I can't find any docs on how I might tell LTspice how to format a
measurement display. Does that exist somewhere? Here are the commands
I am using...
..MEAS AC tmp max mag(V(N002,N001)); find the peak response and call it "tmp"
..MEAS AC BW trig mag(V(N002,N001))=tmp/sqrt(2) rise=1
+ targ mag(V(N002,N001))=tmp/sqrt(2) fall=last
..MEAS AC centerfreq WHEN mag(V(N002,N001))=tmp
..MEAS AC Q PARAM pow(10,centerfreq/(BW*20))
Here is what this displays
tmp: MAX(mag(v(n002,n001)))=(40.5139dB,0°) FROM 59000 TO 61000
bw=565.564 FROM 59716.6 TO 60282.1
centerfreq: mag(v(n002,n001))=tmp AT 60000
q: pow(10,centerfreq/(bw*20))=(106.089dB,0°)
It would be a bit nicer if this last line just displayed...
q: centerfreq/bw=106.089
best. It looks like there are a lot of third parties who are helping by
chipping in their shots at tutorials and docs. But they are mostly
introductions and getting started guides covering only the most basic
stuff.
I am trying to do what should be some simple measurements on a tuned
circuit. I want to see how various additions to a circuit alter the
tuned frequency, bandwidth and Q. So it would be nice to get these
numbers automagically. I've figured out how to get the bandwidth and
the tuned frequency and even the Q. But it printed the frequency and Q
in dB. The tuned frequency is no problem as it is also displayed
linearly, but I can't find a way to display the calculated Q as a simple
number other than doing the reverse dB calculation so it displays the
proper number but with a dB label... obviously not my first choice.
I can't find any docs on how I might tell LTspice how to format a
measurement display. Does that exist somewhere? Here are the commands
I am using...
..MEAS AC tmp max mag(V(N002,N001)); find the peak response and call it "tmp"
..MEAS AC BW trig mag(V(N002,N001))=tmp/sqrt(2) rise=1
+ targ mag(V(N002,N001))=tmp/sqrt(2) fall=last
..MEAS AC centerfreq WHEN mag(V(N002,N001))=tmp
..MEAS AC Q PARAM pow(10,centerfreq/(BW*20))
Here is what this displays
tmp: MAX(mag(v(n002,n001)))=(40.5139dB,0°) FROM 59000 TO 61000
bw=565.564 FROM 59716.6 TO 60282.1
centerfreq: mag(v(n002,n001))=tmp AT 60000
q: pow(10,centerfreq/(bw*20))=(106.089dB,0°)
It would be a bit nicer if this last line just displayed...
q: centerfreq/bw=106.089