Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
Signal Waveform Sent Out on Channel 0
I set my NanoVNA-H to sweep from 3.5 MHz to 3.6 MHz and then listened to the signals on a shortwave receiver.
I could hear a signal at 3.5 MHz and 3.6 MHz and possibly the sweep points in between. Harmonics were also heard with the 3rd harmonic much stronger than the second harmonic. The sweep appeared to repeat about 17 times every 5 seconds. Is a square wave signal being sent out for each frequency in the sweep? What is the off time between each pulse? This is really just for curiosity as I try to understand the operation of these very useful instruments. Thanks, Kent AA6P |
Remember a square wave consists of a sum of odd harmonics. That's why the
toggle quoted message
Show quoted text
3d is stronger than the 2d harmonic. Dave - W?LEV On Mon, Aug 30, 2021 at 7:47 PM Kent AA6P <kawill70@...> wrote:
I set my NanoVNA-H to sweep from 3.5 MHz to 3.6 MHz and then listened to --
*Dave - W?LEV* *Just Let Darwin Work* |
On 8/30/21 12:47 PM, Kent AA6P wrote:
I set my NanoVNA-H to sweep from 3.5 MHz to 3.6 MHz and then listened to the signals on a shortwave receiver.yes, it sends out the square wave for each frequency.? And, the bands are structured so that you use fundamental for band 0, third harmonic for band 1, fifth for band 2. If you have an oscilloscope, that's probably the easiest way to do it. However, the timing between frequencies isn't fixed - the firmware sends commands to the synthesizers for the new frequencies, then waits for the Lock signal (si5351_wait_pll_lock in si5351.c ), then enables the output and grabs the data. There's some other delays in the code as well.? I do not envy the folks who wrote si5351.c - finding a bullet proof algorithm to program arbitrary frequencies into a part like that is tricky. There are multiple combinations of parameters where the arithmetic works out, but not all work as well. static bool sweep(bool break_on_operation) { ??? pll_lock_failed = false; ??? for (int i = 0; i < sweep_points; i++) { *??????? int delay = set_frequency(frequencies[i]);** **??????? delay = delay < 3 ? 3 : delay;** **??????? delay = delay > 8 ? 8 : delay;** * ??????? tlv320aic3204_select(0); // CH0:REFLECT ??????? wait_dsp(delay); ??? /* bunch of stuff */ ??? } static int set_frequency(uint32_t freq) { ??? int delay = 0; ??? if (frequency == freq) ????? return delay; ??? delay += adjust_gain(freq); ??? int8_t ds = drive_strength; ??? if (ds == DRIVE_STRENGTH_AUTO) { ????? ds = freq > FREQ_HARMONICS ? SI5351_CLK_DRIVE_STRENGTH_8MA : SI5351_CLK_DRIVE_STRENGTH_2MA; ??? } ??? delay += *si5351_set_frequency_with_offset(freq, frequency_offset, ds);** * ??? frequency = freq; ??? return delay; } here's the key routine... with stuff snipped out static int current_band = -1; /* ?* configure output as follows: ?* CLK0: frequency + offset ?* CLK1: frequency ?* CLK2: fixed 8MHz ?*/ #define CLK2_FREQUENCY 8000000L int si5351_set_frequency_with_offset(uint32_t freq, int offset, uint8_t drive_strength) { ? int band; ? int delay = 3; ? uint32_t ofreq = freq + offset; ? uint32_t rdiv = SI5351_R_DIV_1; /* a bunch of stuff to figure out which band we're in, and to calculate related parameters, like which divider modes the PLL will use */ #if 1 ? if (current_band != band)??? ??? ??? // turn off output when switching bands ??? si5351_disable_output(); #endif ? switch (band) { ? case 0: ??? // stuff snipped ??? si5351_set_frequency_fixedpll(0, SI5351_PLL_A, PLLFREQ, ofreq, ????????????????????????????????? rdiv, drive_strength); ??? si5351_set_frequency_fixedpll(1, SI5351_PLL_A, PLLFREQ, freq, ????????????????????????????????? rdiv, drive_strength); ??? //if (current_band != 0) ????? si5351_set_frequency_fixedpll(2, SI5351_PLL_A, PLLFREQ, CLK2_FREQUENCY, ??????????????????????????????????? SI5351_R_DIV_1, SI5351_CLK_DRIVE_STRENGTH_2MA); ??? break; ? case 1: ??? // Set PLL twice on changing from band 2 ??? if (current_band == 2) { ????? si5351_set_frequency_fixeddiv(0, SI5351_PLL_A, ofreq, 6, drive_strength); ????? si5351_set_frequency_fixeddiv(1, SI5351_PLL_B, freq, 6, drive_strength); ??? } ??? // div by 6 mode. both PLL A and B are dedicated for CLK0, CLK1 ??? si5351_set_frequency_fixeddiv(0, SI5351_PLL_A, ofreq, 6, drive_strength); ??? si5351_set_frequency_fixeddiv(1, SI5351_PLL_B, freq, 6, drive_strength); ??? si5351_set_frequency_fixedpll(2, SI5351_PLL_B, freq * 6, CLK2_FREQUENCY, ????????????????????????????????? SI5351_R_DIV_1, SI5351_CLK_DRIVE_STRENGTH_2MA); ??? break; ? case 2: ??? // div by 4 mode. both PLL A and B are dedicated for CLK0, CLK1 ??? si5351_set_frequency_fixeddiv(0, SI5351_PLL_A, ofreq, 4, drive_strength); ??? si5351_set_frequency_fixeddiv(1, SI5351_PLL_B, freq, 4, drive_strength); ??? si5351_set_frequency_fixedpll(2, SI5351_PLL_B, freq * 4, CLK2_FREQUENCY, ????????????????????????????????? SI5351_R_DIV_1, SI5351_CLK_DRIVE_STRENGTH_2MA); ??? break; ? } ? if (current_band != band) { *??? si5351_reset_pll();** **??? si5351_wait_pll_lock();* #if 1 *si5351_enable_output();* #endif ??? delay += 10; ? } ? current_band = band; ? return delay; }
|
On 8/30/21 1:37 PM, W0LEV wrote:
Remember a square wave consists of a sum of odd harmonics. That's why theand what's interesting, is that it appears that for band 0, it uses the fundamental for both stimulus and receiver LO. for band 1, it uses the 3rd harmonic for the stimulus and the 5th harmonic for the receiver LO for band 2, it uses the 5th harmonic for the stimulus, and the 7th harmonic for the receiver LO (at least, that's how the PLLs are programmed) ? uint32_t ofreq = freq + offset; ? uint32_t rdiv = SI5351_R_DIV_1; ? if (freq > config.harmonic_freq_threshold * 3) { ??? freq /= 5; ??? ofreq /= 7; ? } else if (freq > config.harmonic_freq_threshold) { ??? freq /= 3; ??? ofreq /= 5; ? } There's some other monkeying around with PLL divisors (band 1 uses 6, band 2 uses 4)
|
Jim - Thanks very much for the information. I hadn't realized the complexity involved in the firmware.
I tried to view the NanoVNA scan with a tinySA but it only captured a portion of the signals on any given sweep. One interesting question is whether the use of square waves has any impact on the results. I assume an antenna would respond to the harmonics as well which could increase the magnitude of any reflected signal. Maybe the harmonics are down enough in amplitude to not be an issue. 73, Kent AA6P |
On 8/30/21 7:54 PM, Kent AA6P wrote:
Jim - Thanks very much for the information. I hadn't realized the complexity involved in the firmware.Kind of need to look at the mixer performance to figure it out. Maybe that's why a different multiple is used for the LO? |
The use of different frequencies for stimulus and sensing surprises me. Does anyone know why this is done, or indeed how it's even possible? Presumably watching at 3/5 or 5/7 of the stimulus signal should yield essentially nothing...
toggle quoted message
Show quoted text
- Roland 9V1RT ------------------------------------------------------------------------ On 31/8/21 7:47 am, Jim Lux wrote:
On 8/30/21 1:37 PM, W0LEV wrote:Remember a square wave consists of a sum of odd harmonics. That's why theand what's interesting, is that it appears that for band 0, it uses the |
Roland,
toggle quoted message
Show quoted text
It is very tricky! In order to work above the 300MHz (or so) maximum of the S5351 synthesizer, harmonics are used. I don't remember the exact details, but it goes something like this: Suppose the IF frequency is 10kHz. To measure at 500MHz, the stimulus fundamental would be 500MHz / 3 . The tricky part is that the local oscillator fundamental is 500.010MHz / 5 . The fundamental stimulus and local oscillator frequencies are far apart, so they do not produce strong mixer products anywhere near the 10kHz IF frequency. Only the desired harmonics near 500MHz are at the 10 kHz IF separation, so they can measure the circuit behavior at that frequency. This means, of course, that the stimulus signal has a huge component at the fundamental, but as long as passive components are being measured this is OK. Amplifiers and other potentially non-linear devices can present measurement problems in this scheme. --John Gord On Mon, Aug 30, 2021 at 10:35 PM, Roland Turner wrote:
|
Presumably watching at 3/5 or 5/7 of the stimulus signal should yield essentially nothing...Transmitter and LO can be programmed to different frequencies, this makes the trick. Let's show it with a simple example: If you want to measure e.g. @ 600 MHz then you program the transmitter to 200 MHz (3rd harmonic is 600 MHz), while the LO is set to 120.006 MHz (5th harmonic is 600.030 MHz). If you mix TX_3rd and LO_5th you will get 30 kHz IF while all other harmonic mix frequencies are far above, you can use a simple lowpass for separation. With both oscillators working at 3rd harmonic (200 MHz and 200.010 MHz) you will see the mix of the fundamentals (200 x 200.01 -> 10 kHz), the mix of both 3rds at 30 kHz and the mix of both 5ths at 50 kHz, you would need a narrow bandpass to filter the wanted 30 kHz out. |
The receivers only tune to the measurement frequencies and make the measurements at those frequencies, they reject the unwanted harmonics. Using a square wave stimulus is fine for passive components like antennas and filters but it can be problematic for active circuits like amplifiers, where the unwanted harmonics can cause behavior different from a sinusoidal stimulus, such as gain compression.
Only capturing a few frequencies of the sweep reveals an issue with using a swept spectrum analyzer to measure a time-varying signal, namely "probability of intercept", where the signal and measurement system need to be tuned to the same frequency at the same time or the signal will be missed. 73, Don N2VGU |
On 8/30/21 10:35 PM, Roland Turner via groups.io wrote:
The use of different frequencies for stimulus and sensing surprises me. Does anyone know why this is done, or indeed how it's even possible? Presumably watching at 3/5 or 5/7 of the stimulus signal should yield essentially nothing...No, that's what the PLL is programmed for, say you want 450 MHz, the stimulus is programmed for 450/3 comes out at the fundamental (say 150 MHz) and the third harmonic (450 MHz). The LO PLL is programmed for 450.005/5 = 90.001 MHz, so the VNA will be sensitive to 90.001 MHz, 180.002 (less so, 2nd harmonic), 270.003 MHz, 360.004, and 450.005 - only the 450.005 is lined up right. Of course "real mixers" have some intermods, so the 150 MHz that is going into the UUT, and into the receiver as well, so the 3x5 intermod (3xRF, 5xLO) will come in at the right frequency - but that should be low.
|
On 8/31/21 12:11 AM, Ho-Ro wrote:
ok, John pushed the <Reply> button faster ;)As it happens, the IF is 5 kHz (5 cycles in 48 samples, at 48 kHz) but yes, that's how the math works out. I'm sure there's plenty of "non-ideal" behavior with higher order intermods in the mixer, but it works "well enough" - and as you note, the vast majority of people are measuring linear passive devices. |
IF on eddy fw - 5kHz
IF in my fw - 12kHz edy555 NanoVNA ADC speed = 48k (measure both channel in some time) my fw NanoVNA ADC speed = 192k for H and 384k for H4 NanoVNA measure 48+48 16bit samples of reference/reflect or reference/thru data And made DSP for detect IF amplitude/phase change (depend from reference signal) |
On 8/31/21 10:54 AM, DiSlord wrote:
IF on eddy fw - 5kHz Thanks for clarifying that. So for 48 samples at 192kHz, that's 0.25 milliseconds - so 3 cycles. That changes the noise bandwidth a bit (~4 kHz instead of ~1 kHz) - I think, though, that some of the newer firmware averages multiple measurements, so that helps drive down the noise as well. |
On Tue, Aug 31, 2021 at 12:24 PM, Jim Lux wrote:
Yes fw allow select bandwidth 4k and less (this reduce noise), it measure 48 x N samples for this, but this N time slow (but anyway more faster, faster ADC allow more better align measure intervals and wait generator ready timings). PS H4 measure 96 samples for one period (1.5 cycle can`t use for 48 samples), so it use some bandwidth, but measure 2x more data |
On 8/31/21 12:38 PM, DiSlord wrote:
On Tue, Aug 31, 2021 at 12:24 PM, Jim Lux wrote:So you doThat changes the noise bandwidth a bit (~4 kHz instead of ~1 kHz) - I think,Yes fw allow select bandwidth 4k and less (this reduce noise), it measure 48 x N samples for this, but this N time slow (but anyway more faster, faster ADC allow more better align measure intervals and wait generator ready timings). for N repetitions: ??? grab 48 samples ??? Multiply by sin/cos and sum ??? accumulate sums and you make sure that the phases line up the same. That's subtly different than say, accumulating 48*N samples and multiplying by a 48*N sin/cos table, but reasonably close. I'd have to model it to know what the filter skirts look like, but to a first order, the SNR would be sqrt(N) better than with the 48 sample integration. |
Yes NanoVNA accumulate 48 * N samples multiplie on sin/cos table (calculated for used IF)
H/H4 not use window functions for this (i not see improvements) V2 made same calculation (V2 measure 50 samples), but apply Gauss window function for this 50 samples, this allow little improve SNR PS i restore dump command, and soon release new version, this allow get raw measured ADC data from NanoVNA |
On 8/31/21 1:27 PM, DiSlord wrote:
Yes NanoVNA accumulate 48 * N samples multiplie on sin/cos table (calculated for used IF) I wouldn't expect the window to affect the SNR a huge amount - windowing is more about "sidelobe levels", "adjacent bin rejection", "spectral leakage", or "scalloping loss", and those really aren't applicable here.? Maybe for rejecting harmonic content from "the wrong LO and fundamental harmonics". Looking at Table 1 in Harris's 1978 paper on "Use of Windows for Harmonic Analysis" (IEEE Proc, v66, #1, Jan 1978) which is sort of my "go-to" reference for run of the mill windows - The noise bandwidth is actually smallest (1.0) for a rectangular window, which sort of makes sense, since the rectangular window is the matched filter for the signal. Gaussian windows are 1.39 to 1.90 noise bandwidth for alpha from 2.5 to 3.5? (w(n) = exp(-0.5 * (alpha * n/(N/2))^2) ) - that's about a 2dB change in SNR, and for most nanoVNA measurements, the SNR is pretty high (tens of dB). |
If the 50 ohm circuitry on Channel 0 operates as a directional coupler for SWR measurements, it would seem that harmonics of the square wave signal would affect SWR measurements.
"If the r.f. applied to the bridge contains more than one frequency - for example, harmonics - the s.w.r. at the "off" frequencies usually will be very high, and a relatively small voltage will give a good-sized meter reading." An antenna may resonate at odd harmonics of the design frequency but I don't believe the frequencies are exact multiples especially when a transmission line is being used. I believe the professional VNAs generate sine wave signals. 73, Kent AA6P |
to navigate to use esc to dismiss