# LT Spice For Radio Amateurs: PART 7

So what do you do when you need to make a complex transformer like a 10 turn trifilar winding with a center tap that you might find at the input and output of a diode ring mixer, like the double balanced mixer below? Well you use a Spice Directive. If you have not forgotten everything you have learned so far, you might recall that all the way back in part one of this literary travesty that the last button in our list was the Spice Directive button and like all good men everywhere, our purpose is to push buttons, and with the pushing of this button your entire existence is now complete.

So in the circuit above we have a double balanced mixer, from left to right you have the local oscillator, a 10 turn trifilar winding, the diode ring, another 10 turn trifilar winding and finally the RF input. The IF output is at R1. As well are all experts in the field, we know that a diode mixer likes to have 50 ohm terminations all all its ports. So the LO, RF and IF are all 50R.

So we have a 2MHz input signal, being mixed with a 7MHz local oscillator to give the sum and difference frequencies, 7 + 2 = 9, 7 -2 = 5 so when we run this, we should be able to see 5 and 9MHz peaks which we can then filter out the one we don’t want and keep the other as the IF.

But before we do that, a Spice Directive for transformers always follow the same rules, they are numbered k1, k2, k3 etc followed by the group of inductors you want to make up the transformer, L1 L2 L3 and the final number 1 sets the coupling to perfect, you can of course set this to a number less than one and have imperfect coupling between the windings if you wish to simulate a lower Q than perfection.

So we run a transient analysis on our mixer circuit and we get a bonkers output that looks like this. Now like all good and proper mad scientists you might conclude that something is wrong, that this circuit is a failure and should should be confined to the annals of electronics history where the smoke has escaped and the shmoo released. But you would be wrong of course, because the thinkers out there will have realized that diode mixers are NON LINEAR and that the output will be the Sum and the Difference of the inputs plus all the fart noises, aka Harmonics.

So if we pull up the FFT window we can see then that we have 2 main peaks, one at 5MHz=LO-RF and 9MHz=LO+RF. And you can also see the double balanced action where the LO and RF are attenuated in the output quite substantially, and then in the rest of the spectrum you see those + and – pairs with their harmonics attenuated. It is actually a rather cool way to come to understand what a Double Balanced Mixer does and kind of how its doing it, visually.

So anyway, you now know how to make complex transformers, how to set the turns ratios and all that jazz and do quite a lot now in LT Spice. Perhaps its time to find a circuit that you have used before in a project, lay it out in LT Spice and simulate it and see if it does what it says it does, to see if you can improve it and make it better, or perhaps even find a better solution altogether. And do not forget to have fun.

# LT Spice For Radio Amateurs: PART 6

So anyone who is not living in the 1850’s would have noticed a few years ago a revolution in signal generation with the advent of cheap micro controllers and modules in the way of the Arduino AD9850 DDS VFO. Now cheap and highly accurate signal sources were available to the masses, but they did have some limitations. Firstly the DDS output has a 200 ohms impedance, secondly its output was low, in around 300mv p-p and thirdly its output gain was not uniform across the entire frequency range and if it was being used as a local oscillator feeding a diode ring mixer the output needed to be amplified and buffered.

Alas poor Yorick, the internet came to everyone’s rescue with some eager beaver grabbing a handful of parts and some popcorn transistors and knocking up a buffer amplifier to add to the DDS to bring its output up to ear destroying levels, well -7dbm needed to drive the input of a diode mixer. But, was it any good? We now have enough peanuts in the brain box to test this thing and see if it was really all that up to scratch.

First lets run a transient analysis and take a look at the waveform. Its not very sinusoidal now is it. It is clipping hard on the negative rail and well when any form of clipping happens we make fart noises AKA harmonics. So here is a new trick to add to your LT Spice bag of tricks, we can look at the FFT output and see the harmonic content.

RIGHT CLICK the waveform window, select VIEW->FFT and you will get a nice frequency analysis of the harmonic content, we can see that the 2nd and 3rd harmonic are about -20db down on the fundamental. This might be important in your design and if this was the FFT display of a final amplifier you should be hitting panic buttons because the Law is generally the 2nd harmonic needs to be -50db down on the fundamental. Check with your local authority to be sure to be sure because a clean signal is a nice signal. However, with a DDS buffer, this may or may not be a problem in your design.

Next we can perform an AC Analysis on buffer amp and see its gain over a range of frequencies. We can see there is a large rolloff in gain from about 10Mhz and onward and by 28Mhz we have lost almost -3db gain. Now this might be enough to stop your diode ring mixer from turning on if your -7dbm signal is now more like -10dbm, the mixer will not mix, and that might suck bad for your circuit.

So now you know enough to make simulations on amplifiers and buffer stages to see if they actually do what you want them to and if you are really cleaver you will now be thinking of ways of optimizing this circuit to make it work better, like by rebiasing Q1 by adding a low value resistor from emitter to ground so that its not clipping the negative rail, by adding a low pass filter maybe to clean up the harmonics and by optimizing component values to get a flatter gain response. What you do will depend on your actual needs and implementation. Either way have fun.

# LT Spice For Radio Amateurs: PART 5

All radios are made up of some rather standard blocks we use over and over, we have filters, amplifiers, mixers, that is is, no rocket surgery required. A product detector is not someone searching for a product to buy, its just a mixer, a beat frequency oscillator is nothing more than an amplifier with positive feedback to make it go bonkers in a controlled manner and filters, well they just filter out the crap we do not want.

Sure this is an over simplification, but it is near enough to being the truth. I know for myself, once i got my head around the nomenclature of radio and started to see things for what they really are, that things started to make sense to me. So in the next few parts, lets take a look at some of the specific things we can do in LT Spice to get a better understanding of the performance of our circuit under test, starting with filters.

So this is a filter I have used in a number of projects before. I think we have all used someone else’s design without really knowing if that design is any good or not. So, now that we can used LT Spice, we can see for ourselves if someone else’s design is actually any good, or if their design is rubbish. And when we look around the net we see these kinds of blocks being copied over and over and this assume that its good, if might just be that everyone is copying the same bad design.

So if you are paying attention to the above schematic you will notice some things different. Previously we have performed Transient Analysis, and now we are doing something different, performing an AC Analysis which will allow us to sweep the circuit under test with a range of frequencies and get a Bode Plot at the end to look at.

We set up our voltage source with an AC Amplitude of 1 and of course 50R series resistance as the filter is 50 ohms impedance in and out.

Next click SIMULATE->Edit Simulation Command and select the AC Analysis tab. Change the type of sweep to Octave, and add in the other details, for the number of sample points, start and stop frequency. Click ok, then run the simulation and let the fun begin.

Now, if you click on the trace number n004 in my case, you can add upto 2 cursors per trace and move them about to to take some measurements. Cursor 1 is showing the center frequency of the filter, 7.150MHz and its at -6db, cursor 2 is at 12MHz and its -54db, 54 minus 6 is 48db DOWN on the bandpass. Which is good information to be able to work out, you can then tell how far attenuated the Image frequency of your mixing scheme is, the IF freq etc etc to see if your filter is good enough for your task.

Now we have only done this with a single Bandpass filter, you can also do the same with the Low Pass Filters on your transmitters and do the same math to work out how great the attenuation is of the 2nd and 3rd harmonics. A clean signal is a good signal. But I will leave that up to you to try. And now you know enough about how to use LT Spice to perform AC Analysis and to design, align and specify the properties of filters. Get out there and have fun, test your designs and make sure your homebrew radios present the cleanest signal they can.