Mathematics of mixers - Page 1
Forum section: electronics / projects

author: dnessett
author_rank: Regular Contributor
timestamp: August 20, 2018, 11:41:20 pm
content: This is a nit-picky question.The standard mathematical representation of a mixer is the product of the input signals. So, if one input is v1(t) = V1sin(w1(t)) and the other input is v2= V2sin(w2(t)), where Viis the amplitude of the ith input signal (i=1,2) and wiis the frequency of the ith input signal, then the mixed signal is represented as:V1sin(w1(t)) * V2sin(w2(t)).However, the mixer output is a voltage, whereas the quantity specified above has units voltage squared. So, it seems this simple mathematical representation is missing something, say a square root somewhere. For example, the mixer equation might be:sqrt(V1)sin(w1(t)) * sqrt(V2)sin(w2(t))This would result in an output signal with the appropriate units.Any signal analysis experts out there who care to comment?

author: mark03
author_rank: Frequent Contributor
timestamp: August 21, 2018, 12:06:19 am
content: I consider any signal represented on a block or signal-flow diagram to be effectively dimensionless, abstracted away from the physical implementation. A signal could be a voltage signal, a current signal, or something else.

author: rfeecs
author_rank: Frequent Contributor
timestamp: August 21, 2018, 12:14:28 am
content: You might look at this app note on analog multipliers:http://www.analog.com/media/en/training-seminars/tutorials/MT-079.pdfThey describe the output as Vout = (Vx * Vy) / K. K is a scale factor that takes care of the units.In a real RF mixer, the situation is more of the RF is being switched on and off by the LO. So you are multiplying a sine wave by a square wave. This classic app note gives some of the math:http://www.rfcafe.com/references/articles/wj-tech-notes/Mixers_in_systems_part1.pdf

author: Doc Daneeka
author_rank: Contributor
timestamp: August 21, 2018, 02:40:47 am
content: Mathematically the argument of trig functions is dimensionless (angle) and their value is dimensionless, this is for any transcendental function. that mixer function is dimensionless. Units are just a linear scale factor - you dont need to do anything to make the output units 'right' - you can scale by anything you want, sqrt(V), V, V^2018 anything

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 21, 2018, 02:48:42 am
content: Right, the units wouldn't work out. That's why there's a gain coefficient with units of V/V^2 on such a multiplier.Tim

author: CatalinaWOW
author_rank: Super Contributor
timestamp: August 21, 2018, 04:19:26 am
content: I agree with OP. There is a subtle truth here, the output of a mixer is proportional to power.

author: JS
author_rank: Frequent Contributor
timestamp: August 21, 2018, 05:31:21 am
content: Quote from: CatalinaWOW on August 21, 2018, 04:19:26 amProportional to the power of what exactly?As has been said, you can measure the output of the mixer in volts, so units is volts, transistors doesn't care for units, that's just out convention to agree on something, they just take the input signal and do whatever they are set up to do.Now, if you feed the same signal to both inputs of an ideal mixer now you will be seeing something proportional to the instantaneous power of that signal, as the math happens match that. But if the signals are different you are just half way to find one point of the intercorrelation between both signals, if you integrate the output from start to finish of the universe, you have a single point of the autocorrelation of both signals, the point of t=0. Or, at any point, you have the product of both signals which is what you are usually interested when you placed a mixer in the circuit.JS

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 21, 2018, 09:18:39 am
content: Quote from: JS on August 21, 2018, 05:31:21 amHrm, it would be the geometric average of the two voltages, as applied to a resistance say.So,V^2 / R = PwhereV = sqrt(V1*V2)This doesn't explain how you get a voltage back out again, or what the resistance is. Again, those are just unit conversion constants...Tim

author: Neganur
author_rank: Unknown
timestamp: August 21, 2018, 11:12:09 am
content: sin(a) * sin(b) = 1/2 * (cos(a-b) - cos(a+b))not sure I understand the questionoh I see, v(local oscillator) * v(rf), voltage squared is the issue?they are just magnitudes

author: xaxaxa
author_rank: Regular Contributor
timestamp: August 21, 2018, 11:13:50 am
content: I don't think most real-life mixers are actually multipliers; the LO port is distinct from the RF/IF port and is generally amplified to saturation before driving either diode switches or FET switches. I think a better model is a inverting/noninverting amplifier with a digital input that determines whether it inverts.Although there are analog mixer ICs but those cost orders of magnitude more...

author: CatalinaWOW
author_rank: Super Contributor
timestamp: August 21, 2018, 01:20:08 pm
content: The ability to measure the output in volts is a red herring. Think of a multplier chip with both inputs fed by the same voltage. Output is voltage squared, which is proportional to power. Details will involve impedance of the input (which determines power at input) and impedance of the load on the output, which determines proportionality constant.In mixers which saturate on one of the inputs the simple equation no longer applies. The v on that leg is no longer relevant, only the saturation voltage. But even there a power interpretation is not wrong. All other things being equal the output of a mixer run on ten volts will be greater than one run on five.

author: mikerj
author_rank: Super Contributor
timestamp: August 21, 2018, 01:35:54 pm
content: Quote from: xaxaxa on August 21, 2018, 11:13:50 amThat pretty much defines the difference between a mixer and a multiplier.

author: dnessett
author_rank: Regular Contributor
timestamp: August 21, 2018, 04:03:46 pm
content: The reason I asked this question is I am studying the principles behind heterodyne based phase noise measurements of oscillators. It is pretty standard in the mathematical formulation of the problem to represent the mixer as the product of the output of the two oscillators (for example, see section 8.9.1 inTime and Frequency: Theory and Fundamentals). I think they model a mixer as a multiplier because they don't want to get bogged down in the mixer details, e.g., whether it is a diode double balanced mixer, a gilbert cell mixer, etc.In any case, the literature in this field has settled on this model, so I am trying to understand how to use it appropriately. So far, the most promising approach was suggested byrfeecs, who referencedthis tutorial. Since the mixer introduces conversion loss/gain, wouldn't it be possible to introduce a constant Kmixerthat has units Volts-1and use it as a multiplier? That is,Mixer output = Kmixer*V1sin(w1(t)) * V2sin(w2(t))From what I have read, the conversion loss for a passive mixer is normally on the order of 5 dB to 10 dB, which would put K in the range of .56 to .1. Any reason why this would not work?

author: CatalinaWOW
author_rank: Super Contributor
timestamp: August 21, 2018, 05:03:59 pm
content: I think it would work with the caveat that conversion loss is probably in dB power (10 log 10) and you may need a factor of two to get where you are headed.

author: dnessett
author_rank: Regular Contributor
timestamp: August 21, 2018, 10:48:54 pm
content: Quote from: CatalinaWOW on August 21, 2018, 05:03:59 pmGood point. Thanks.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 22, 2018, 12:12:18 am
content: Right, multiplication works to the first order but real mixers are higher order, usually a few exponentials thanks to semiconductor diodes.If you consider the transfer function of a diode in terms of its Taylor series, the terms go as x^n / n! (for the exponential). Put a sinusoid in, and you get powers of sines, which once you apply trig identities (polynomial in sin^n x <--> polynomial in sin n*x), gives harmonics.Because the terms get smaller as the order (n) increases: for small inputs, the first few terms dominate. We can approximate it as a parabolic section, i.e., of the form x^2, give or take a constant offset, a linear error and a gain term (out = gain * x^2 + linear * x + offset).So if we use a single diode as a mixer for small signals, we can use this approximation, and it acts as a multiplier.(More specifically, when you apply two sinusoids -- two frequencies, that is -- you get the sum and difference frequencies, as well as the 2nd harmonics. This is just as easy to show with trig identities, it's just that much more tedious..)Conversely, when the input is large, the higher order terms dominate, and you get higher harmonics, IM3 and so on. You can calculate IM3 intercept this way, for example, by equating the amplitude of terms (after doing the trig transform, mind).As it happens, there are many downsides to operating in the small signal regime. It's better to overdrive one port, which makes the mixer more like a switching element. Indeed, the LO port (voltage) waveform will be a sloppy square wave, in a typical (over-driven LO, under-driven RF) balanced diode mixer.The biggest downside is probably that you can't guarantee a very strong RF signal won't show up and overdrive your LO -- in other words, you don't get a linear response, well, a bilinear response to be more precise, over as much range as you can get otherwise. Total dynamic range is set by thermal noise at the bottom, and nonlinearity at the top (typically in terms of compression and IMD). Probably also, impedance is too high for practical bandwidth purposes (diode impedance is inversely proportional to forward current), and for introducing yet more insertion / mixer loss (in addition to the ideal ~6dB mixer loss you are expecting).Likewise, the downside for overdriving the mixer is you need to deal with all the harmonics and higher order mixing products. This is overall better: a strategic change, rather than having to somehow figure out a better circuit. The usual choice is to pick your LO above the tuning band, such that the band width lands neatly between LO harmonics and IF lands well below the RF band. Thus keeping images at maximum distance where they can be filtered effectively.The double downside is, if you want a truly vast tuning range (like for a spectrum analyzer), you need IF either at zero (direct conversion) (or in whatever gap is left below the RF band, if your RF doesn't include DC), or IF above RF, and LO that much further above. Which is very demanding on LO range, stability and purity!Tim

author: bson
author_rank: Unknown
timestamp: August 22, 2018, 02:18:52 am
content: Quote from: dnessett on August 20, 2018, 11:41:20 pmTechnically, it's V*sin(wt), not V*sin(w(t)). The frequency is constant, not a function of time, and the sine is a function of an angle, not a frequency.As for the units... Given a phase offset p2(with p1= 0):V1sin(w1t)*V2sin(w2t+p2)= V1V2sin(w1t)sin(w2t+p2)= V1V2*1/2[cos((w1-w2)t-p2) - cos((w1+w2)t+p2)]= 1/2*V1V2cos((w1-w2)t-p2) - 1/2*V1V2cos((w1+w2)t+p2)= 1/2*V1V2sin(π/2-(w1-w2)t+p2) - 1/2*V1V2sin(π/2-(w1+w2)t+p2)= 1/2*V1V2sin(π/2-(w1-w2)t+p2) + 1/2*V1V2sin((w2-w1)t+p2-π/2)To answer your question, it's easy to see why the unit of the 1/2 factor must be V-1("per volt").As you can see the mixing is a little more complex than just multiplying the magnitudes as you get two mirrored cosine products. These are called side bands; one is the upper side band the other the lower side band. The phase difference carries through to both side bands. (As a result, if it's unimportant relative to the input it's constant and can be dropped for convenience.) The spectrums of the two side bands are mirrored (a low spur in the USB becomes a high spur in the LSB and vice versa).Oh, andnote: the phase difference is NOT a reactive AC phase (between voltage and current). It's purely a relative signal phase!

author: dnessett
author_rank: Regular Contributor
timestamp: August 22, 2018, 03:18:48 am
content: Quote from: bson on August 22, 2018, 02:18:52 amYes, I failed to proof the equation. I also should have written v2(t) = V2sin(w2t), not v2= V2sin(w2(t)).Quote from: bson on August 22, 2018, 02:18:52 amI don't follow you. The 1/2 factors (there are two of them) are:1/2*V1V2sin(π/2-(w1-w2)t+p2), and1/2*V1V2sin((w2-w1)t+p2-π/2)The unit of bothareisVolts2, not Volts-1. Perhaps I misunderstand what you mean by "the 1/2 factor".

author: TheUnnamedNewbie
author_rank: Super Contributor
timestamp: August 22, 2018, 06:19:46 am
content: I think the key here is that mixers (or multipliers, depending on how you want to define them) arenot multiplying voltages- they are multiplyingsignals, represented in your case by voltages. However, they could just as well be represented by currents (as is common when discussing Gilbert cell mixers) or power levels. Given in most cases your ports will be of a certain well-controlled impedance, you can just switch between these units with some basic math. You can't really keep the two signals with their units, and they become unit-less, and the unit is inside of the K factor.The multiplication is just a simple way of representing it. Think of a very basic diode being used as mixer:On the input we apply the sum of our signals:$$ V_{in}(t) = V_{LO}(t) + V_{RF}(t) = v_{LO} \cdot \sin(\omega_{LO} t) + v_{RF} \cdot \sin(\omega_{RF} t) $$If we use theShockley diode equation, the output current is given by:$$ I_{out}(t) = I_{S} \Bigg(\text{exp}\bigg(\frac{V_{in}(t)}{n V_{T}}\bigg)-1\Bigg)$$This is then usually approximated with the Taylor series:$$e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots $$$$\text{exp}\bigg(\frac{V_{in}(t)}{n V_{T}}\bigg)- = 1 + \frac{V_{in}(t)}{n V_{T}} + \frac{\bigg(\frac{V_{in}(t)}{n V_{T}}\bigg)^2}{2!} + \frac{\bigg(\frac{V_{in}(t)}{n V_{T}}\bigg)^3}{3!} + \cdots $$And that is how we get that typical multiplying behavior with all those harmonics. Note that unlike what some people have suggested, there are actually 'true' multiplying mixers that do not have all these harmonics, such as potentiometric mixers. But we then drive them hard for noise reasons, that all those harmonics are still on the output, not due to the mixer but because our LO is a square wave that has a bunch of harmonics itself.But let me get back to the question at hand - where do the units go in the first place?The Shockley diode equation actually gave us a clue. Look at all the units there, and you will figure out what is going on. Inside that exponential we have the input signal, units of Volt, that is divided by the thermal voltage, unit of, you guessed it, Volt. In other words, that entire exponential is a unit-less value. The unit of Ampere actually comes from this saturation current \$I_{S}\$, which depends on the design of our diode. So when we use the Taylor series (well, Maclaurin series) to give us the multiplying representation, we need to 'take into account' the fact that our value of x in the exponential has lost its unit, and thus the fact that it is squared doesn't give any strange squared voltages. I think it speaks for itself that you can just use your impedance to get from output current to output voltage, and all of this scaling and conversion is just lumped together in the \$K_{mixer}\$ term, as is the scaling you should do with the \$V_{T}\$ term.Of course, this is just for a very simple diode mixer (not even a ring mixer, but literally just a diode), however, you will find that in other mixer types, you have similar conversions - for example in the potentiometric mixer, the LO the input voltage is converted into a conductance with the saturated mos equation, and then this conductance is multiplied with the second input voltage to give us the output current, which can then be turned into an output voltage using the output impedance of the system. Again, this is all captured in the \$K_{mixer}\$ term, and we just pretend our input signals are unit-less. you could, I guess, just say that the \$K_{mixer}\$ contains a 1/V term, but the reason we don't is because we are already making a lot of hand-wavy unit-ignoring assumptions - we pretend that DC term is not there, and that we only have only one output frequency, which we don't, and generally ignore any phase component, etc... So while we are at it, why don't we just ditch those units too?EDIT: I'm fixing some of the math appearance

author: bson
author_rank: Unknown
timestamp: August 22, 2018, 06:26:02 am
content: Quote from: dnessett on August 22, 2018, 03:18:48 amFactors and their units:1/2 is V-1V1is VV2is Vsin(...) is unitlessThe product, 1/2*V1V2sin(...) is V-1V2Which of course is V.

author: rhb
author_rank: Super Contributor
timestamp: August 23, 2018, 01:17:43 am
content: A "mixer" performs a frequency shift. In the frequency domain, when you "mix" two signals, you're performing a convolution. A convolution in either domain is a multiplication in the other. It's been 30+ years since I took Integral Transforms I & II, but I'm fairly certain that this applies to all integral transforms, not just the Fourier variety. They all involve an integration of a multiplication by an exponential kernel.Whereas an analog mixer is unavoidably non-linear, you can do linear mixing in the discrete domain. However, TANSTAFL, you've moved the error terms from the multiplier to the ADC and AFE. As a wild guess, Armstrong coined the term "mixer" and when Wiener et al set to work they called it a "multiplier". They pretty much had to as Fourier had already set the mathematical terminology 100 years before Armstrong invented the heterodyne concept.