0
\$\begingroup\$

I'm trying to measure the center frequency of band pass fillter. And use

.meas maxGain MAX V(Xo)/V(xi)

I can get the max gain easily.

But I cannot find a way to get the frequency at the max gain point. I tried

.meas AC res FIND frequency AT V(Xo)/V(Xi)=0dB

.meas AC res FIND frequency AT V(Xo)=108.8m

The log shows: res: frequency=(-1.#INFdB,0? at 0

How to solve it?

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

Here is one way to do it. (V(a) used instead of the ratio, for simplicity)

enter image description here

For a good tutorial on the MEASURE command, join the groups.io LTSpice group, and look in Files / z_yahoo / Tut / MEASURE

\$\endgroup\$
5
  • 2
    \$\begingroup\$ To the OP: note how Eamon used mag() for checks, and how maxGain is multiplied by 0.99999. The last part has to do with rounding. Finding the BW like this might not work for ripples in passband (e.g. Chebyshev), in which case you might have to measure the BW as two separate freqs, .meas f1 find freq when mag(v(a))=maxGain/10**(Ap/20) cross=first and cross=last for f2, then use .meas bw param f2-f1 and .meas fc param sqrt(f1*f2). Don't forget about .opt meascplxfmt=cartesian for results not in dB, and the nr. of points/dec (.AC is fast, 1k pts is safe to use). \$\endgroup\$ Commented Oct 29, 2020 at 8:19
  • \$\begingroup\$ Thanks for the extra detail. TBH I cheated by looking in the tutorial that I referenced... .MEAS syntax is practically undocumented in the official help, so looking at the tutorial is the best way to find a particular recipe. \$\endgroup\$
    – Eamon
    Commented Oct 30, 2020 at 0:17
  • \$\begingroup\$ Many thanks in advance! I'll try soon! \$\endgroup\$
    – FNJU
    Commented Oct 30, 2020 at 5:52
  • \$\begingroup\$ @Eamon Well, it is documented, but in the general spartan tone of the whole manual. Though the 0.999... part comes through practice. \$\endgroup\$ Commented Oct 30, 2020 at 7:43
  • \$\begingroup\$ @Eamon Sorry it's a little weird I cannot see the pics in your answer now... would you please post it again (text would be better), thanks:) \$\endgroup\$
    – FNJU
    Commented Oct 31, 2020 at 0:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.