Hi Dan, IMD testing in RF can be done with two tone testing and looking at the spectrum of the output or you can use a single input, step its value and plot gain against the power out. In a well behaved amplifier the gain will drop 1dB when non linearity starts to arrive. There is a rule of thumb that OIP3 is12-14dB above the P(-1dB) point. Radio hams would use the ARRL or RSGB handbook to read up on this. Designers of amateur radio circuits would use the book Experimental Methods of RF design, affectionately known as EMRFD. Out of print but really useful.?
?
For two tone testing you could look at a file in the archive; Two_Tone_OIP3_EMRFD_fig2-57_ATC.zip and get some useful background.
?
Apply two voltage sources in series, give each an internal impedance (Rser) of 25 Ohms, ensure your amplifier has a 50 Ohm load on its output. You need to run a .TRAN analysis of course to see non-linear effects.
?
The three settings of the .TRAN command are critical to allow use of the FFT command. The start and stop times MUST start and end near zero, the maximum timestep has to be kept very small. Look at the voltage out after simulation and zoom right in to the stop and start of the waveform. It may help to use two tones (frequencies) that make this easier, I use 14 and 14.2MHz (in real life my two tone oscillator has a separation of only 20kHz, but it doesn't seem to matter)
?
The theory of two tone testing is that if you apply 14MHz (f1) and 14.2MHz(f2) you will see and putput spectrum with these two tones, and also tones at 13.8 and 14.4MHz (and a smorgsbord of frequencies of multiplies of each tone added or subtracted from multiplies of the other tones) The 13.8 and 14.4 tones are twice f2 less f1 and twice f1 less f2. If you record the amplitude of one of the fundamental tones and one of the intermodulation products you can get the OIP3 by adding half the difference to the amplitude of the main tone. You must correct for the fact that the FFT uses dBv by adding 13 to get dBm.
?
It's a pity you can't use .MEAS on fft waveform results but instead you can use .MEAS commands to plow through the .RAW simulation results and extract the amplitude of one tone. The sequence of 4 or 5 commands to do this are in Tony's example.
?
It took me a while to understand how these worked, you can think of it as realizing that you can measure DC (zero Hertz) by averaging and that "mixing" a desired frequency to zero hertz allows you to measure the desired frequency, with the added complication you don't know the phase of the desired f so you have to use quadrature waveforms and combine the results.
?
I hope that all helps, the forum here is about LTspice and not circuit design but hopefully you find the above useful. I sometimes wish the forum had better "examples of good practice" and more tutorial related examples, rather than being full of people's problems.
?
I am a radioi amateur in the UK, my callsign is MI5AFL, (I am listed in QRZ if you are a member of the tribe of amateurs)
Regards
Ian McCrum
MI5AFL
?