...
Prof. Heng CH has created a very comprehensive guide on how to setup LTSpice and how to run simulation.
Please download it from LumiNUS Canvas or here:
...
Make sure you choose "Gear" under the Default Integration Method.
...
Note: if you already selected Gear but your simulation stopped half way halfway and never move moved forward, consider redo redoing the recoding of signals.
...
Use Net labels to tidy up your schematic. In the below example, all port labelled ports labeled -Vcc is supplied with -5V from the power source at the bottom, similarly, all ports labelled labeled Vcc is supplied with 5V.
...
Always remember to include the OpAmp library files by write writing them into the SPICE directive.
An example of a schematic used OpAmp LM6172, LM7171B, and AD8056.
The file name following ".inc" should be exactly the same as the library file downloaded from LumiNUSCanvas. And make sure they are under the same folder as your schematic.
...
If you want to test the performance of you your LTSpice design, you can feed the recorded noisy signal as the input of the circuit, and probe the waveform at the output to observe, or save the output as a .wav file, then feed it into GNURadio to see what's the PSR count of the filtered signal.
To do so:
- Right-click the power source, under "style", choose "PWL FILE="..."".
- Fill in the path to the .dat file, or simply click "Browse" and select the file
- Use Net Name to label your output, i.e. VOUTvout
- Add analysis command line ".tran 0 4ms"
- Add this line in the SPICE directive: ".wave ' name_the_file.wav ' 16 4e6 VOUTvout".
- 16 is the number of bits, ranging from 1 to 32. The higher the bits the slower the simulation
- 4e6 is the sample rate of the simulation. Similarly, the higher the sample rate, the slower the simulation. You need to make sure this sample rate is the same at the GNURadio setting (4MHz).
Note |
---|
The sample rate of your LTSpice simulation should match the sample rate of your opamp_file.grc fs_in. |
...