The Simplest Possible Mixer, using MOSFETs.

When a curious person searches the Internet for the circuit diagrams of (electronic) mixers, there is a certain complexity of what he or she will find. Just for people who might not know, the type of mixer I’m referring to is a component which does not add two signals together – which is what the naming might seem to suggest – but rather, which multiplies two signals. In certain cases the mixer will produce output, that contains an additive component as well as a multiplied component. But it’s the multiplied component circuit designers are interested in, because that can be used:

  1. In order to produce ‘mixed frequencies’, between two input frequencies, such as between a local oscillator and a Radio Frequency, resulting in an Intermediate Frequency,
  2. In order to act as a phase discriminator, the output of which will be maximally positive or negative, when two input signals are in-phase, but the output-voltage of which will be some neutral voltage, when the input waves are 90⁰ out-of-phase with each other. In this latter case, two reasonably constant input amplitudes are assumed.

What search results will often show, is somewhat complex mixers, that require either one or two balanced inputs – meaning inputs conditioned such, that they each appear differentially between two input electrodes – and which have as advantage for being designed that way, low distortion of the wave-form(s) supplied differentially in this way.

But sometimes, low distortion is not required. For example, in the case of a PLL – a “Phase-Locked Loop” – It’s assumed that the feedback voltage changes the frequency of a VCO – a “Voltage-Controlled Oscillator” – but with the intended result that two outputs lock in some phase-position, so that the two frequencies that are inputs to the phase-discriminator will be exactly the same frequency. This latter need often arises in the design of ICs. This latter application does not require that the phase-discriminator be particularly linear, nor that its output-voltages, that become feedback voltages, be in any range other than the range which the VCO requires as input.

And so the question can arise, what the simplest way might be to design a mixer, with the added detail that both inputs are unbalanced inputs – i.e., that each input appears at one terminal, and not in an opposing way, at two terminals – and for the sake of argument, our IC might be limited to using enhancement-mode, N-channel MOSFETs as the main active component. And this would be my solution:

Coinc-Det_1.svg

The concept is very simple. If Vin1 and Vin2 are at 180⁰, then M1 and M2 don’t conduct simultaneously. Therefore, R1 and Vcc (the supply voltage) achieve maximally positive average output-voltage. If Vin1 and Vin2 are at 0⁰ phase-position, the two transistors will become conductive in a way that coincides. Therefore, this is actually a Coincidence Detector. And the average  output-voltage will be maximally negative in that case. And, if Vin1 and Vin2 are at a 90⁰ phase-position, then the average output-voltage will be somewhere between the two values mentioned before.

I suppose it should be mentioned that, if the circuit designer knows ahead of time that one of the two inputs has a much higher amplitude than the other, or a more predictable amplitude, then this usually stronger input should be fed to Vin1.

As part of a feedback loop, the output needs to be followed by a low-pass filter, that emulates an integrator over the time-constant which is the fastest, with which that feedback loop is supposed to be able to react to a change in one of the frequencies. The simplest low-pass filter consists of a resistor followed by a capacitor… (:1)

And so, when looking for a way to implement a phase-discriminator, the curious person needs to choose which of the following has greater priority:

  • The simplest circuit-design, or
  • The lowest amount of distortion.

The circuit above will certainly give the highest amount of distortion. :-P

(Updated 7/9/2019, 16h55 … )

Continue reading The Simplest Possible Mixer, using MOSFETs.

Hypothetical Variable Gain Amplifier

What I find is that in recent years, the term ‘Variable Gain Amplifier’ has changed in meaning, to correspond more to a ‘Variable Attenuation Stage’, after a fixed-gain amplifier. And this seems especially true, when applied to ‘IF Stages’ – ‘Intermediate Frequency Stages’ – Of a radio receiver. I’ve also observed that low-distortion technologies are preferred in recent years, as opposed to the high-distortion technologies that manufacturers were limited to, say, in the 1970s, when ‘AGC’ was first being marketed to consumers.

Yet, even with the technologies that are now available, there are sometimes added constraints. For example, if one wanted the variable-resistance component either to be optical – for lowest distortion – or, for that to be a JFET – easier to implement – then, this component might need to exist externally to an IC, just because the IC itself may be engineered only to allow for two complementary types of transistors, those being, an enhancement-mode N-channel MOSFET and an enhancement-mode P-channel MOSFET. Further, The properties of such MOSFETs can sometimes be inconvenient, in the form of high Threshold voltage, named ‘VT0′, which is the voltage required to make the transistors start to conduct. Practical values of VT0 may be more suited to logic circuits, than to the processing of low-amplitude, analog RF or IF frequencies. A thinner oxide layer for the entire IC can reduce the required VT0.

Yet, the possibility exists for even a MOSFET to operate in ‘Triode Mode’, which is a mode in which it is Not ‘Saturated’. This mode is achieved when:

VDS < VGS – VT0

The problem in trying to reach this mode seems to arise in the fact that if, VT0 is already a higher-than-desired voltage, VGS-VT0 is likely to be a lower-than-desired voltage-range, since VGS is also limited by the supply voltage.

In Triode Mode, a MOSFET effectively behaves like a variable resistor, which decreases in value as the Gate voltage continues to increase.

And so to summarize what form the task might take, to make the Variable Gain Amplifier monolithic with a MOSFET-based IC, I constructed the following, hypothetical diagram, which does not explicitly nail down what VT0 is supposed to be, nor the supply voltage:

Serge_VCR_3b.svg

 

What I seem to have noticed however, in order for the suggested IF stage to work, is that the actual signal should not have a ‘Peak Amplitude’ at the Gate of the last amplifier stage, greater than (0.1V). Yet, the feedback-loop itself, that adjusts attenuation, could play a role in keeping that peak amplitude close to (0.1V).

(Corrected 7/7/2019, 11h05 … )

Continue reading Hypothetical Variable Gain Amplifier

Web-Optimizing Lossless Images

One subject which has caught my interest in recent times, is how to publish lossless images on the Web – and of course, optimize memory-use.

It has been a kind of default setting on most of my desktop software, that I’ll either save images as JPEGs – that are lossy but offer excellent file-sizes – or as PNG-Format files – that are losssless, but that still offer much better file-sizes than utterly uncompressed .BMP-Files would offer. Yet, I might one day want even smaller file-sizes than what PNGs can offer, yet preserve the crisp exactitude required in, say, schematics.

The ideal solution to this problem would be, to publish the Web-embedded content directly in SVG-Files, which preserve exact curves literally at any level of magnification. But there are essentially two reasons fw this may not generally be feasible:

  1. The images need to be sourced as vector-images, not raster-images. There is no reasonable way to convert rasters into vector-graphics.
  2. There may be a lack of browser-support for SVG specifically. I know that up-to-date Firefox browsers have it, but when publishing Web-content, some consideration needs to be given to older or less-CPU-intensive browsers.

And so there seems to be an alternative which has re-emerged, but which has long been forgotten in the history of the Web, because originally, the emphasis was on reducing the file-size of photos. That alternative seems to exist in GIF-Images. But there is a basic concern which needs to be observed, when using them: The images need to be palletized, before they can be turned into GIFs – which some apps do automatically for the user when prompted to produce a GIF.

What this means is, that while quality photos have a minimum pixel-depth of either 24 or 32 Bits-Per-Pixel (‘BPP’), implying 8 Bits Per Channel, and while this gives us quality images, the set of colors needs to be reduced to a much-smaller set, in order for GIFs actually to become smaller in file-size, than what PNG-Files already exemplify. While 8-bit-palletized colors are possible, that offer 1/255 colors, my main interest would be in the 4-bit or the 1-bit pallets, that either offer the so-called ‘Web-optimized’ standard set of 16 colors, or that just offer either white or black pixels. And my interest in this format is due to the fact that the published images in question are either truly schematic, or what I would call quasi-schematic, i.e. schematic with colors.

What this means for me as a writer, is that I must open the images in question in GIMP, and change the ‘Image -> Mode’ to the Web-optimized, or the 1-bit Pallets, before I can ‘Export To GIF’, and when I do this, I take care to choose ‘Interlaced GIF’, to help browsers deal with the memory-consumption best.

In the case of a true 1-bpp schematic, the effect is almost lossless, as the example shown below has already occurred elsewhere in my blog, but appears as sharp here as the former, PNG-formatted variety appeared:

schem-1_8

In the case of a quasi-schematic, there is noticeable loss in quality, due to the reduction in color-accuracy, but a considerable reduction in file-size. The lossless, PNG-format example is this:

quasi-schem-1_1

While the smaller, GIF-format File would be this:

quasi-schem-1_9

There is some mention that for larger, more-complex schematics, GIFs take up too much memory. But when the image really has been large in the past, regardless of what I might like, I’ve been switching to JPEGs anyway.

There could be some controversy, as to whether this can be referred to as lossless in any way.

The answer to that would be, that this results in either 1 or 4 bit-planes, and that the transmission of each bit-plane will be without alteration of any kind – i.e., lossless. But there will be the mentioned loss in color-accuracy, when converting the original pixel-values to the simplified colors – i.e. lossy.

Continue reading Web-Optimizing Lossless Images