Jess Chen
|
Before I begin, let me first say that while Mathematica is very powerful, it also has a steep learning curve. I highly recommend investing in the first training course if you decide to buy it. Also, as I write this, I realize I should have mentioned the "List" function too.
As for the functions I mentioned, I first state the problem. In an RF receiver chain, several stages have programmable gain to keep the output signal at the optimal level while the input signal swings over a wide dynamic range. Let suppose the RF front end has 3 gain states while two down stream stages have 10 states each. That makes a total of 300 gain states. For a given input signal level and a target output signal level, there may be several composite gain states that produce the same gain. I call gain states with essentially the same gain, "degenerate" gain states. Degenerate gain states do not all perform the same, some have lower noise figures while others have higher compression points. From the degenerate gain states, how do we select the "best" one?
I start by computing the composite gain, noise figure, compression point, and a label for ALL possible gain states. I then filter out those states that do not meet noise and linearity constraints. If any degeneracy remains, I select the gain states with superior noise or linearity performance. The result is an optimal set of gain states. Hopefully, the resulting gain states support the desired range of input signals. Gaps in the supported input signal levels indicate that the existing architecture does not meet end-to-end specifications. The key step in this approach is to characterize all possible gain states.
My Mathematica implemenation of this approach to RF systems design is based primarily on one Mathematica function, the Outer function. I use the Outer function to characterize all possible gain states. The Outer function is a generalization of the outer product. The outer product of two vectors, {a,b} and {c,d}, is the following matrix:
{{a*c,a*d},{b*c,b*d}}.
The outer product computes all possible products of the components of the two vectors. Mathematica's Outer function does the same thing but is not confined to just two vectors and is not confined to just "*" as the operator. Also, the operator is not confined to scalar arguments like "a" and "c" or to scalar outputs like a*c. In fact, I replace "a" with a list comprised of {gain, noise figure, compression point, and label}. "b" would represent the same list but for a different gain state. The hyper-list {a,b,...} would characterize all gain states of the first stage. The "{c,d,...}" list would do the same for the second gain stage, and so on. I replace the "*" operator in the outer product with a list of operators that compute composite {gain, noise figure, compression point, label} for a particular composite gain state. The composite gain function merely sums the dB of gains from each stage. The composite noise figure function applies the Friis formula for cascaded noise figure. The composite compression point comes from a simillar formula. Mathematica has another function, "List", ideally suited to iterative computations like the Friis formula. You specify a function (e.g. two stage Friis formula), a starting output, and a list of arguments. The List function then iterates through the arguments to compute the cascaded results.
I also used the "Map" function many times. Map applies a function to all elements of a list. For example, I could use the Map function to convert a list of frequencies into a list of attenuations based on a transfer function. I would "Map" the transfer function over the list of frequencies. I have not mentioned all the functions I used, only some of the key functions.
One could implement this overall approach to receiver design in Matlab, or C, or any other language but I don't think the result would be as flexible. I implemented this approach in Matlab once. Matlab is better suited for, and faster at, long simulations but in my opinion, Mathematica is better at higher levels of abstraction. In this application, the higher level of abstraction makes the code more flexible. If it's done right, adding or subtracting another stage is trivial: just add another element to the list of stages. If you want to add another parameter, just add it to the lists. If you want to add another output, like blocker level, just add that function to the function list. Nowhere in the Mathematica code did I have to use a "for, next" loop. A "for" loop would have required knowledge of the length of the chain. Since Mathematica is also a word processor, it's easy to document your work. The data visualiztion capabilities are also very good.
I have also used the Outer function to compute and track all possible mixer spurs and then flag those culprit spurs that fall into any one of a set of victim bands. In this case, string manipulation played a key role and I found the Mathematica's string manipulation capabilities superior to those found in other tools.
Again, I must warn you that although Mathematica is a very power tool for RF systems design and analysis (in my opinion), it takes patience to learn. I have not regretted the time it took me to learn Mathematica. On the contrary, once I got into it, it was fun to use.
-Jess
|