Installing and using LTspice IV (now including LTXVII), From beginner to advanced

I was looking for a way to verify the operation of a digital BiQuad filter. There are plenty of on-line calculators that will give the filter coefficients if you provide the filter parameters, but I was unable to find a sim program that would run a Bode plot given the filter coefficients. I found this article on-line from EDN magazine that appears to do this in LTSpice:https://www.edn.com/use-ltspice-to-simulate-mixed-continuous-and-sampled-systems/


I'm new to LTSpice and was looking for some help in setting this up. I was able to create the delay element and the arb voltage source with the filter equation, but I'm having trouble running a Bode plot and referencing the various taps on the delay lines. Attached is the schematic file and symbol file in LTSpice that I created.

If anyone could tell me what I'm missing, I would appreciate it.
 

Attachments

  • BiQuad.asc
    2.2 KB · Views: 51
  • Z-1.asc
    513 bytes · Views: 42
The BiQuad filter is implemented in a TI DSP. VituixCAD appears to be for designing speakers so it will not work. Are the LTSpice active filters analog or digital?
It can just plot the graph of any filter system,not just designing loudspeaker systems. So it will most definitely work. In fact, I have done that many times myself.

A Biquad is either digital or analog, the transfer function is the same.
Either way it can also be done in LTSpice.
 
https://www.analog.com/en/technical...pplying-the-laplace-transform-in-ltspice.html

There might be a 3rd party solution, but I couldn't find it in the infamous ZZZ or ValVol folders.
The 2nd order Complex Zero block might be helpful, but I don't know what you want to do with it.
This is part of LTSpice own library, which can be found in the "SpecialFunctions" folder.

Either that, or pick the easier route with VituixCAD ;)
 
Last edited:
Pspice model from the TI website:

https://www.ti.com/product/OPA1632#design-development

You can of course auto-generate a symbol from within LTspice but I took a stab at creating one similar to the symbol in the "Application Diagram" on page 1 of the datasheet. I verified the symbol's pin order against the SPICE model. You will need to rename the symbol file to OPA1632.asy.

Caveat: I haven't tested this myself.
Good find, good job, works nicely - but after more extensive exploration, it seems pins 2 and 7 don't function as expected.
 
Last edited:
Member @bordodynov has a different model for the OPA1632 on his website:

http://bordodynov.ltwiki.org/

I've extracted and attached it here (with a .txt extension added so that it could be uploaded). Maybe this one will work better. You would think that TI's own model would be reliable but I've run into problems with other TI models before. So maybe this is one of those cases too.
 

Attachments

  • Opa1632.mod.txt
    7.7 KB · Views: 48
Thanks for this.

I've tried both models and attach a simple .asc file which can demonstrate the functionality issues of both models:

TI model - pin 2 (OCM) not functional; pin 7 (Enable) functional
Bordodynov's model - neither pin 2 nor pin 7 functional

These aren't really important issues - one doesn't need LTspice to understand how to use these features.
 

Attachments

  • OPA1632 test.zip
    7.7 KB · Views: 63
Hi there.


I do not now how to put a deadtime into these pulse setup. I had .param fsw =90k and include tdead=(200)
Unfortanely I do not now where to inlude this in the params of the voltage source.

I use now this. PULSE(0 10 {1/fsw/2} 1n 1n {1/fsw/2} {1/fsw+2n}) and use two voltage sources to drive a half bridge.

that is

first PULSE(0 10 {1/fsw/2} 1n 1n {1/fsw/2} {1/fsw+2n})
second inverted PULSE(10 0 {1/fsw/2} 1n 1n {1/fsw/2} {1/fsw+2n})

Someshere in that tekst I need the tdead parameter inserted, but where. Put it in delay like PULSE(0 10 {1/fsw/2+tdead} 1n 1n {1/fsw/2} {1/fsw+2n})
did delay just one half of square.

Thanks
 
Hi all.

I've got a question regarding the LTSpice ".measure" command.

When doing AC analysis, I would like to calculate the difference in magnutide for any two frequencies. It's easy to do using cursors.
But when stepping different values, it would be handy to be able to use the ".measure" command for this.
I can find the magnitide for the two frequencies independently, but i cant seem to figure out how to put them together into one line.

The following finds the magnitude in dB for 100K and 1000k
.meas AC Mag_1 FIND mag(V(Out)/-V(x)) WHEN freq=100k
.meas AC Mag_2 FIND mag(V(Out)/-V(x)) WHEN freq=1000k

I would like LTSpice to find (Mag_1 - Mag_2) for me. Is this doable?
 
Hi Mark
Thank you for the quick response.

Doing:
.meas AC Mag_1 FIND mag(V(Out1)/-V(x1)) WHEN freq=100000
.meas AC Mag_2 FIND mag(V(Out1)/-V(x1)) WHEN freq=1000000
.meas AC MY_RESULT PARAM (Re(Mag_1) - Re(Mag_2))

Results in:
mag_1: mag(v(out1)/-v(x1))=(38.6871dB,0°) at 100000
mag_2: mag(v(out1)/-v(x1))=(1.18032dB,0°) at 1e+006
my_result: (re(mag_1) - re(mag_2))=(38.5706dB,0°)

I would expect a slightly different result here. ( ~ 37.5dB )
 
Member
Joined 2011
Paid Member
LTSPICE subtracted the magnitudes and then converted the result into dB (!!!)

38.6871dB ---> magnitude = 85.972
1.18032dB ---> magnitude = 1.1455

delta_magnitude = (85.972 - 1.1455) = 84.827
convert 84.827 to dB ---> 38.5706dB

If you want to subtract dB, I suspect you need to divide magnitudes.
proof: (85.972 / 1.1455) = 75.052 ---> convert to dB ---> 37.507 dB
 
LTSPICE subtracted the magnitudes and then converted the result into dB (!!!)

38.6871dB ---> magnitude = 85.972
1.18032dB ---> magnitude = 1.1455

delta_magnitude = (85.972 - 1.1455) = 84.827
convert 84.827 to dB ---> 38.5706dB

If you want to subtract dB, I suspect you need to divide magnitudes.
proof: (85.972 / 1.1455) = 75.052 ---> convert to dB ---> 37.507 dB

I understand. Thank you
 
Hi all wish you all the best for the new year as a start.

I have installed ltspice 17.1.15 and find a bug.

When I try to set 0.2 volts 1Khz I get it as on picture. I can not get it right, also not when edit the tekst itselfs.

only delete and set it that valeu works, one time.


regards
 

Attachments

  • ScreenHunter 06.jpg
    ScreenHunter 06.jpg
    102.4 KB · Views: 33