"Sampler??"

Jul 28, 2024 Last reply: 1 year ago 55 Replies

Gentlemen,



I'm in the process of trying to track down a fault in my main HP spectrum analyzer. I've narrowed the issue down to the area of this "sampler" which is part of a phase locked loop. I'm not sure I fully understand its function, however. In particular, I'm extremely confused as to why they're calling it a "sampler" because when that term arises, I typically think of something doing akin to what a sampling oscilloscope does: noting voltage levels at predetermined intervals. AFAICS, this "sampler" is doing no such thing. It's just a harmonic mixer, surely? If not, I must be nuts. YOU get to decide!



Block diagram here:

formatting link
Short functional description here:
formatting link


From the description, it sounds just like the circuit of a sampling oscilloscope. An SRD impulse generator and some diodes, probably.

Post the schematic of the sampler circuit.

A sampler IS a harmonic mixer.

This - see link - is about as much detail as they provide. Seems the "sampler" is perhaps proprietory and they don't want it copied I would guess.

formatting link
I don't know how you equate a sampler to a harmonic mixer; I don't see any similarity at all.

Too bad they don't call it a "frequency sampler". In essence (perhaps over simplified) that's what it does. It produces the frequencies above and below the center frequency (the spectrum) to be portrayed on the screen. As you noted, it does that by harmonic mixing. You might want to think about it with a change in your statement about an oscilloscope: From "noting voltage levels at predetermined intervals." to "noting voltage levels at predetermined frequencies."

Maybe that helps. Ed

It’s good that they don’t call it that, because that’s not what it does. Stroboscopic sampling is familiar from old Westerns, where the spoked wheels of wagons seemed to turn backwards in certain speed ranges.

(I haven’t watched a movie for a looong while, but I expect that that effect gets removed in post these days. )

Cheers

Phil Hobbs

I still can't see where the 'sampling' bit comes into it. AFAICT, there's are two signals into this thing and one signal out. The signal from the LHS is passed through a very fast diode which generates harmonics from that fundamental. The signal from the RHS is unmodified and mixed with the desired harmonic to give the necessary output signal which is then filtered to get rid of the unwanted mixing products. If that's all correct, as I believe it is, where does any *sampling* come into it?

The only difference is whether you think about it in the frequency domain or in the time domain. The circuit doesn't care.

With some simplification, one could say a mixer alternately multiplies its input signal by +1 or -1, whereas a sampler multiplies its input by 0 or 1. The functions are very similar.

Jeroen Belleman

I can get my head around that kind of sampling no problem. But there's nothing analagous to that going on with this device AFAICS. Perhaps I don't have a good enough understanding of what happens in a mixer. Come to think of it, I don't really know anything about them other than you input two different frequency signals which intermodulate and you get the sum and the difference of them at the output; then filter for the one you need. Is this intermodulation some form of sampling?

On 2024-07-28 19:04, Cursitor Doom wrote: > On Sun, 28 Jul 2024 20:28:25 -0000 (UTC), Phil Hobbs wrote: >

More or less, sometimes a lot more. Here goes.

**FREQUENCY MIXING** In signal processing theory, we often model a mixer as multiplying the RF input signal by a sinusoidal local oscillator (LO) to produce the intermediate frequency (IF) output. ['IF' isn't a great name, because it sounds like there's only one frequency there. In fact there are nearly always lots of components at different frequencies, which we have to separate with filters.]

That’s mathematically pretty simple, requiring only the formulas for products of sines and cosines. Those are simple to derive from the definitions if you forget which way the signs go. For reference,

cos(a+b) = cos a cos b - sin a sin b (1) cos(a-b) = cos a cos b + sin a sin b (2)

so

sin a sin b = 0.5 * [ cos(a-b) - cos(a+b) ] (3) and cos a cos b = 0.5 * [ cos(a-b) + cos(a+b) ] (4)

the sin * cos versions come from the formula for sin(a+b), and are left as an exercise for the reader. ;) (In real life, you can put the phase shifts into the arguments rather than using different formulas.)

Mixers like this are said to be *bilinear*, because they're linear in both inputs--if you multiply 2x * y, or x * 2y, you get 2xy.

The net is that you get two copies of your signal, one upshifted by the LO frequency and the other downshifted. (There’s an absolute value in the downshifted frequency, because it’s convenient to deal with positive frequencies.)(*)

**SWITCHING MIXERS** Most real mixers are a bit different, because linear mixing is hard to do well. A radio has to deal with whatever comes in from the antenna, which may well include other signals that are much stronger than the one you want, and a bad mixer will cause all sorts of problems when that happens. (Search for 'cross modulation' for one example. Ignore the AI results.)

Thus most mixers are switching types, which are effectively multipliers where the LO is a fixed-amplitude square wave rather than a variable-amplitude sine. You can verify with your favorite math program that a square wave

SQ(t) = 1 0< t < pi = -1 pi < t < 2*pi (and so on) (5)

is given by

SQ(t) = sin(t) + sin(3 t)/3 + sin(5 t)/ 5 +.... , (6)

i.e. the sum of all the odd harmonics, with an amplitude falloff on the higher-order terms.

Thus when you multiply your RF signal A*sin(omega1 t) by the LO signal SQ(omega t), you get

IF = sin( omegaR t) * [ sin( omegaL t) + sin( 3*omegaL t)/3 + ....), (7)

which using (3) is

2*IF = cos[(omegaR-omegaL) * t] + cos[(omegaR-3*omegaL) * t]/3 + ... - cos[(omegaR+omegaL) * t] - cos[(omegaR+3*omegaL) * t]/3 - .... (8)

The top line of (8) is the lower sideband (LSB) contributions, and the bottom line is the upper sideband (USB) ones. We get contributions of all orders (2N+1), where N is any integer. (Eventually the LSB frequencies cross 0 Hz and start back up again, which takes a bit more thought if we care about stuff that far out.)

The amplitudes of these components fall off like 1/(2N+1), which is not very fast--the far-out 15*omegaL terms are down by only 24 dB compared to the 1*omegaL terms. Thus we usually need to filter out the higher-order terms. (**) This added complexity is usually worth it, because switching mixers are much stronger (i.e. resistant to intermod and other spurious products) than proper multipliers. They also tend to be cheaper, and work over a much wider frequency range.

**SAMPLING** The positive part of a square wave has the same width as the negative part. If we notionally make the positive part narrower and narrower, and taller and taller to keep the area the same (***), we arrive at the sampling mixer.

The usual mathematical notation for the sampling function is sha(x), after the Cyrillic letter that looks like III smushed together into one character. For now, we note that the positive peaks of sin(omegaL*t) are also peaks (positive or negative) of sin[ (2N+1) * omegaL * t]. Thus all the odd-order harmonics of omegaL come in at the same strength, and don't fall off like 1/(2N+1) as in the square wave case.

That means that with suitable filtering, we can use the sampling mixer to effectively mix omegaR with omegaL * (2N+1), i.e. as a harmonic mixer. That's often very useful in instruments.

If we lowpass filter the IF, so that we just get the baseband component, we can use the sampling mixer as a phase detector in a PLL, still at any N we like.

And of course we can just use it to take stroboscopic samples of a repetitive waveform, as in a sampling scope.

Cheers

Phil Hobbs (Who occasionally gets the urge to actually explain something)

(*) Every once in awhile we get into an argument round here, because some folks think that there's no way to get different frequencies in the output without nonlinearity. That's true for a single input port, but not when you have two, as we see by construction.

(**) For an actual radio, there will be a lot of other signals on the RF port, which will lead to an absolute forest of spurious products if you don't choose the IF frequency correctly, and choose the correct sideband. A good *frequency plan* will give a nice clean RX signal using not-too-horrible filters, but it sure doesn't happen by accident.

(***) With the negative part's amplitude reduced to keep the DC response zero, of course.

(There's actually a factor of 4/pi in front of all that, which I forgot about. Otherwise OK.)

Cheers

Phil Hobbs

Mixing = sampling = multiplication.

Many thanks indeed for that *fully comprehensive* explanation, Phil. At times like this when I have to grasp something of this nature I find strong coffee and donuts help enormously. I'm about to place a special order I suspect....

Apples = oranges = pears is an equally valid statement!

I don't see the relevance here. If by 'sampling gate' you mean 'sample & hold' - which I assume you do - that's a different part of the loop altogether from the part labled 'sampler' in the block diagram.

Yes, it's a block diagram which shows the device labeled as a "sampler" comes before the phase detector, after which comes the sample and hold part.

No. And I've never made any secret of that here.

I can't fix it if I don't fully understand what it does, hence the original question. Anyway, it's clear that regardless of what HP call the thing, it's just a harmonic mixer and if I proceed on that basis, I should be able to trace the issue.

It may look that way to you, but all that that signifies is that you haven't studied the subject, and have yet to work out that you need to.

Phil Hobbs has spelled it all out in some detail, but that all seems to have gone way over your head.

John Larkin has got it more or less right, but his presentation is a trifle over-simplified, if still not down to your level.

Technically, a sampler works in the Nyquist/Shannon sense, namely multiplies a signal by a unit impulse. A sample-and-hold is a bit different, because its output is a boxcar waveform, not a series of impulses. The frequency response is different.

The sampler in you spectrum analyzer block diagram is what it says, a sampler. HP wouldn't lie about that.

This is actually a pretty good book:

formatting link
It's not as simple as it sounds, but a pretty good read.

In our world, some understanding of "signals and systems" is fundamental. Summing, multiplying, filtering, correlating, thinking freely in time and frequency domains. S+S is not instantly obvious, and takes some work to understand, but ultimately having instincts and tools for this stuff is valuable and great fun.

LT Spice can help visualize cases, since you can see both waveforms and FFTs.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required