# Frequency mixer

In electronics, a mixer, or frequency mixer, is an electrical circuit that creates new frequencies from two signals applied to it. In its most common application, two signals are applied to a mixer, and it produces new signals at the sum and difference of the original frequencies. Other frequency components may also be produced in a practical frequency mixer.
Mixers are widely used to shift signals from one frequency range to another, a process known as heterodyning, for convenience in transmission or further signal processing. For example, a key component of a superheterodyne receiver is a mixer used to move received signals to a common intermediate frequency. Frequency mixers are also used to modulate a carrier signal in radio transmitters.

## Types

The essential characteristic of a mixer is that it produces a component in its output which is the product of the two input signals. Both active and passive circuits can realize mixers. Passive mixers use one or more diodes and rely on their nonlinear current–voltage relationship to provide the multiplying element. In a passive mixer, the desired output signal is always of lower power than the input signals.
Active mixers use an amplifying device (such as a transistor or vacuum tube) that may increase the strength of the product signal. Active mixers improve isolation between the ports, but may have higher noise and more power consumption. An active mixer can be less tolerant of overload.
Mixers may be built of discrete components, may be part of integrated circuits, or can be delivered as hybrid modules.
Mixers may also be classified by their topology:
* An unbalanced mixer, in addition to producing a product signal, allows both input signals to pass through and appear as components in the output.
* A single balanced mixer is arranged with one of its inputs applied to a balanced (differential) circuit so that either the local oscillator (LO) or signal input (RF) is suppressed at the output, but not both.
* A double balanced mixer has both its inputs applied to differential circuits, so that neither of the input signals and only the product signal appears at the output. Double balanced mixers are more complex and require higher drive levels than unbalanced and single balanced designs.
Selection of a mixer type is a trade off for a particular application.
Mixer circuits are characterized by their properties such as conversion gain (or loss), noise figure and nonlinearity.
Nonlinear electronic components that are used as mixers include diodes and transistors biased near cutoff. Linear, time-varying devices, such as analog multipliers, provide superior performance, as it is only in true multipliers that the output amplitude is proportional to the input amplitude, as required for linear conversion. Ferromagnetic-core inductors driven into saturation have also been used. In nonlinear optics, crystals with nonlinear characteristics are used to mix two frequencies of laser light to create optical heterodynes.

### Diode

A diode can be used to create a simple unbalanced mixer. The current $I$ through an ideal semiconductor diode is primarily an exponential function of the voltage $V_{D}$ across it is:
    $I=I_{\mathrm {S} }\left(e^{qV_{\mathrm {D} } \over nkT}-1\right)$
where $I_{\mathrm {S} }$ is the saturation current, $q$ is the charge of an electron, $n$ is the nonideality factor, $k$ is the Boltzmann constant, and $T$ is the absolute temperature. The exponential can be expanded as the power series
    $e^{x}=\sum _{n=0}^{\infty }{\frac {x^{n}}{n!}}=1+x+{\frac {x^{2}}{2}}+{\frac {x^{3}}{6}}+{\frac {x^{4}}{24}}+{\frac {x^{5}}{120}}+\dots$
The ellipsis represents all higher powers of the sum. Because higher powers fall off with ${\tfrac {1}{n!}}$, they can be assumed to be negligible for small signals, so an approximation using just the first three terms is:
    $e^{x}-1\approx x+{\frac {x^{2}}{2}}\,.$
Suppose that the sum of the two input signals $v_{1}{+}v_{2}$ is applied to a diode, and that an output voltage is generated that is proportional to the current through the diode (perhaps by providing the voltage that is present across a resistor in series with the diode). Then, disregarding the constants in the diode equation, the output voltage will be proportional to:
    $v_{\mathrm {o} }=(v_{1}+v_{2})+{\frac {1}{2}}(v_{1}+v_{2})^{2}+\dots$
In addition to the original two signals $v_{1}{+}v_{2}$, this output voltage has ${\tfrac {1}{2}}(v_{1}+v_{2})^{2}$, which when rewritten as ${\tfrac {1}{2}}v_{1}^{2}+v_{1}v_{2}+{\tfrac {1}{2}}v_{2}^{2}$ is revealed to contain the multiplication of the original two signals $v_{1}v_{2}$.
If two sinusoids of different frequencies are fed as input into the diode, such that $v_{1}{=}\sin at$ and $v_{2}{=}\sin bt$, then the output $v_{\text{o}}$ becomes:
    $v_{\mathrm {o} }=(\sin at+\sin bt)+{\frac {1}{2}}(\sin at+\sin bt)^{2}+\dots$
Expanding the square term yields:
    ${\begin{aligned}v_{\mathrm {o} }&=(\sin at+\sin bt)+{\frac {1}{2}}(\sin ^{2}at+2\sin at\cdot \sin bt+\sin ^{2}bt)+\dots \\&=(\sin at+\sin bt)+{\frac {1}{2}}\sin ^{2}at+\color {blue}\sin at\cdot \sin bt\color {black}+{\frac {1}{2}}\sin ^{2}bt+\dots \end{aligned}}$
According to the prosthaphaeresis product to sum identity $(\sin a\sin b={\tfrac {\cos(a-b)-\cos(a+b)}{2}})$, the product $\color {blue}\sin at\cdot \sin bt$ can be expressed as the sum of two sinusoids at the sum and difference frequencies of $a{+}b$ and $a{-}b$:
    ${\begin{aligned}\color {blue}\sin at\sin bt\color {black}&={\tfrac {1}{2}}\cos[(a-b)t]-{\tfrac {1}{2}}\cos[(a+b)t]\\&={\tfrac {1}{2}}\sin[(a-b)t+{\tfrac {\pi }{2}}]+{\tfrac {1}{2}}\sin[(a+b)t-{\tfrac {\pi }{2}}]\,.\end{aligned}}$
These new frequencies are in addition to the original frequencies of $a$ and $b$. A narrowband filter may be used to remove undesired frequencies from the output signal.

### Switching

Another form of mixer operates by switching, which is equivalent to multiplication of an input signal by a square wave. In a double-balanced mixer, the (smaller) input signal is alternately inverted or non inverted according to the phase of the local oscillator (LO). That is, the input signal is effectively multiplied by a square wave that alternates between +1 and -1 at the LO rate.
In a single-balanced switching mixer, the input signal is alternately passed or blocked. The input signal is thus effectively multiplied by a square wave that alternates between 0 and +1. This results in frequency components of the input signal being present in the output together with the product, since the multiplying signal can be viewed as a square wave with a DC offset (i.e. a zero frequency component).
The aim of a switching mixer is to achieve the linear operation by means of hard switching, driven by the local oscillator. In the frequency domain, the switching mixer operation leads to the usual sum and difference frequencies, but also to further terms e.g. ±3f$_{LO}$, ±5f$_{LO}$, etc. The advantage of a switching mixer is that it can achieve (with the same effort) a lower noise figure (NF) and larger conversion gain. This is because the switching diodes or transistors act either like a small resistor (switch closed) or large resistor (switch open), and in both cases only a minimal noise is added. From the circuit perspective, many multiplying mixers can be used as switching mixers, just by increasing the LO amplitude. So RF engineers simply talk about mixers, while they mean switching mixers.

## Applications

The mixer circuit can be used not only to shift the frequency of an input signal as in a receiver, but also as a product detector, modulator, phase detector or frequency multiplier. For example, a communications receiver might contain two mixer stages for conversion of the input signal to an intermediate frequency and another mixer employed as a detector for demodulation of the signal.