Resampler Adjustment

User avatar
W2PA
Posts: 86
Joined: Sun Apr 09, 2017 6:34 pm
Location: LaGrangeville, NY
Contact:

Re: Resampler Adjustment

Postby W2PA » Fri May 22, 2020 4:40 pm

Gary,

JT is of course correct - but I don't believe John (W1JA) was asserting that the WSJT-X cal function improves things (we have discussed it). He used WSJT-X cal only to observe frequency instability in Thetis as a function of the Thetis resampler setup, and saw a 10x difference in frequency stability between the two settings. All adjustments he's talking about are in Thetis, not WSJT-X. What he observed caught my interest.

The absolute variance in frequency was merely 2Hz (worst case) or less. While that small amount may have an effect on encode/decode effectiveness, what might have more pronounced effect is its rate of change during a single 15-second FT8 cycle. Maybe I'm misunderstanding something but it seems to me that this wobble rate might have a greater effect than the drift magnitude, since FTx modes use phase modulation.

At any rate, I tried it myself, checking the "force" boxes in the Thetis resampler and noticed a similar improvement. In totally unscientific, subjective observations while operating I found a noticeable increase in my ability to get responses. Interestingly, I also noticed that the lopsidedness of signal reports evened out. By this I mean I have consistently noticed that I receive lower reports than I send, many more times than the other way around (i.e. when I receive a higher report than I send). On making the change this evened out dramatically. This is as close to a measurable thing I've come across so far.

Will continue to experiment.
73,
Chris, W2PA
User avatar
W1JA
Posts: 48
Joined: Sun Apr 09, 2017 3:19 pm

Re: Resampler Adjustment

Postby W1JA » Fri May 22, 2020 6:43 pm

Gary, I never intended to mean that absolute frequency accuracy has anything to do with FT mode performance. (As long as one is in an FT sub-band. ;) ) I was reporting what I did chronologically, and I did start out with a desire to check the absolute accuracy of my 200D. Maybe I should have left that part out.

Chris, I'm glad you notice this effect also. For me, it's a night-and-day difference. I was almost to the point of giving up on the FT-modes. I also notice the same thing you mentioned about signal reports.

Another thing: When I started with FT-8 in 2017, I didn't have this problem. It developed only in recent months. What changed, I wonder. A firmware change? A degradation in the reference oscillator in our Apache-Labs hardware? Or maybe it's just the more-crowded FT sub-bands.
K9RX
Posts: 312
Joined: Fri Apr 14, 2017 3:47 pm

Re: Resampler Adjustment

Postby K9RX » Sat May 23, 2020 1:29 pm

thanks guys - I stand fully corrected. Keep up the great work.

Gary
K9RX
User avatar
w-u-2-o
Posts: 2717
Joined: Fri Mar 10, 2017 1:47 pm

Re: Resampler Adjustment

Postby w-u-2-o » Sat May 23, 2020 2:58 pm

Not seeing this problem here. Running Thetis 2.7.0 (a3). I used WWV on 10MHz around 1030 local time in DIGU mode as the calibration signal. Resampler on or off, I saw some wobbulation (I love that term :D ) on the order of +/- 0.2Hz, and during any 15 second epoch (commensurate with FT8 transmission length) it was typically but not always much less than that.

I need to do this experiment over again with a signal generator so that I can remove ionospheric variability from the measurement.

If you are having trouble with the resampler and wish to use it try changing your VAC buffer size and/or ringbuffer settings.

Pay no attention to the WWV sidebands in the plots below, they changed like crazy depending on what was being modulated by WWV at the time. Only the carrier counts. Band conditions also changed quite a bit over the 20 minutes I played with this.

Resampler ON:

Resamp ON DIGU.JPG
Resamp ON DIGU.JPG (569.34 KiB) Viewed 4356 times


Resampler OFF:

Resamp OFF DIGU.JPG
Resamp OFF DIGU.JPG (515.91 KiB) Viewed 4356 times
User avatar
W2PA
Posts: 86
Joined: Sun Apr 09, 2017 6:34 pm
Location: LaGrangeville, NY
Contact:

Re: Resampler Adjustment

Postby W2PA » Sun May 24, 2020 4:07 pm

Posting my results, using latest versions of SW and FW on ANAN-8000DLE. One is re-samper-on ("Force" unchecked) and one is re-sampler off ("Force" checked). In a one-minute time period at 15 MHz (WWV), I get 0.297 Hz variation checked, 3.4 Hz unchecked - a factor of 11.4 difference in "wobbulation".

(BTW, notice on the right, I'd just earlier worked 3D2AG on 17m with re-sampling off. I'd been unable to get a reply with re-sampling on. Off took 2 calls.)
Attachments
2020-05-22.png
2020-05-22.png (71.7 KiB) Viewed 4319 times
2020-05-22 (1).png
2020-05-22 (1).png (69.41 KiB) Viewed 4319 times
73,
Chris, W2PA
User avatar
w-u-2-o
Posts: 2717
Joined: Fri Mar 10, 2017 1:47 pm

Re: Resampler Adjustment

Postby w-u-2-o » Sun May 24, 2020 4:56 pm

Chris,

How are you getting it to make any measurements in FT8 mode? I have to be in Freq Cal mode to get it work.

What happens when you put WSJT-X in Freq Cal mode and select DIGU on the radio?

I just did another test with 2.2.0RC1. No difference. It was a bit better, but I think that's because the ionosphere for this trial was less active.

I also plotted the frequency deltas versus time. No real pattern, which again suggested random, ionospheric induced propagation effects.

73,

Scott

Resamp ON 2.2.0RC1.JPG
Resamp ON 2.2.0RC1.JPG (526.23 KiB) Viewed 4310 times


Delta Freq Plot.JPG
Delta Freq Plot.JPG (67.07 KiB) Viewed 4310 times
User avatar
W2PA
Posts: 86
Joined: Sun Apr 09, 2017 6:34 pm
Location: LaGrangeville, NY
Contact:

Re: Resampler Adjustment

Postby W2PA » Sun May 24, 2020 8:15 pm

Hi Scott,

Observant question! I should have explained more details.

It wasn't in FT8 mode - it was in Freq Cal mode in DIGU, VAC on (of course). But since I had been previously operating FT-8, the remnants of my previous QSO were still in the entry slots.

I'm holding out hope that some combination of settings might make this difference disappear. Your results give me hope that might be possible. More experiments needed. Maybe I'll get back to it for a while tomorrow.
73,
Chris, W2PA
User avatar
w-u-2-o
Posts: 2717
Joined: Fri Mar 10, 2017 1:47 pm

Re: Resampler Adjustment

Postby w-u-2-o » Sun May 24, 2020 8:56 pm

I'm sorry, Chris, but that doesn't match the behavior of WSJT-X here. In frequency calibration mode the controls and displays look like those shown in my screen shots. Your controls and display look like those when you are in FT8 mode. Something's not right...
N8UR
Posts: 7
Joined: Fri Dec 28, 2018 6:59 pm

Re: Resampler Adjustment

Postby N8UR » Mon Jun 08, 2020 7:34 pm

A while ago I posted a topic about "ghost" decodes I was seeing on FT-8 with WSJT-X (see viewtopic.php?f=6&t=3431&p=11398#p11398).

Today, I was finally able to pin down the cause, and it is the rational resampler. Attached is a shot of the WSJT-X waterfall showing an S9ish unmodulated carrier. At the bottom the rational resampler was turned off. A couple of minutes later, I turned the resampler on and you can see first an immediate frequency jump followed by a long period of wander while the resampler settles down. You can also see the strong 100 Hz spurs that appear at the same time. After 10 or more minutes, the resampler seems to stabilize and at that point the spurs go away -- though anecdotally I've noticed that CPU load or temperature changes can cause another period of resampler "hunting" and accompanying ghost decodes. (I turned the resampler off shortly before the end of the run; you can see the small noise burst near the top when that happened.)

I don't know what is causing the 100 Hz spurs, but they are certainly tied to the resampler's action. They are related to the strength of the signals in the passband; with an S5 signal the spurs were noticeable only for the first minute or two after the resampler was turned on; with a stronger signal, they were there as shown in the attachment.

At this point I haven't tried the various resampler options to see if they resolve the problem; it may just be that in my case leaving the resampler off is the best answer, as I don't see glitches. I'm just happy knowing where the ghosts were coming from, and that I can eliminate them!
Attachments
rational_resampler_1.png
rational_resampler_1.png (898.84 KiB) Viewed 4095 times
K9RX
Posts: 312
Joined: Fri Apr 14, 2017 3:47 pm

Re: Resampler Adjustment

Postby K9RX » Tue Jun 09, 2020 12:09 pm

Seems a reasonable conclusion you've come to ...

I've not bothered with the resampler for a long long time. Just don't mess with it. Seems almost a solution looking for a problem. Since perturbations in CPU action elsewhere cause clicks and jumps in the TX signal - and since these also induce the resampler to 'start anew' it just seemed fruitless. I've had very good success since I've stopped obsessing over it and setting the affinity. Still have jumps occasionally.

I swear one update from Microsoft maybe a few months ago improved that situation - as if they finally recognized that THEY are causing havoc to programs at times by poor core management ... note I mention TX and you're here focusing on RX ... but I believe they're one in the same.

did you try just not using it at all? Apologies if you mention that earlier on. I know I'm comparing apples to different apples somewhat as I am still using 3.4.9 and not Thetis which you are - but I believe the outcomes are the same. I see mention of setting "FORCE" using Thetis so not sure there's been any overall improvement in the action of the resampler.

Gary
K9RX
User avatar
w-u-2-o
Posts: 2717
Joined: Fri Mar 10, 2017 1:47 pm

Re: Resampler Adjustment

Postby w-u-2-o » Tue Jun 09, 2020 4:27 pm

Just a minor point of clarification: it is the "variable resampler" not the "rational resampler". This capability was first released in PowerSDR 3.4.8:

https://apache-labs.com/community/viewtopic.php?f=6&t=2763&p=5184&hilit=variable+resampler#p5184

In contrast to Gary's experience, I've found that using the resampler substantially improves (decreases) the number and severity of the audio artifacts (glitches, etc.) that I notice. And, if you look at my earlier posts in this topic, I do not observe any significant instability in the resampling rate, i.e. the signals are rock solid in WSJT-X et al.

Obviously if you are getting the performance you want with the resampler disabled then perhaps there is no point in trying to get it to work better. However, I'd suggest trying to pare down your VAC buffer size and VAC buffer latency settings (both RingBuffer and PortAudio) to the minimum that provides you with reliable VAC audio. This may improve resampler performance for you.

The only problem I have experienced with the resampler is that it will periodically go unstable on me, particularly when starting Thetis. To reset the resampler I will uncheck and recheck the "Manual" checkbox on Ringbuffer In setting. Sometimes it takes a few tries to get it stable again. By "stable" I mean that all over and under-flow counters have stopped counting. If you see them counting then your resampler is not stable and you will definitely get poor results under those conditions.

73,

Scott
K1LSB
Posts: 81
Joined: Wed Feb 05, 2020 5:25 pm

Re: Resampler Adjustment

Postby K1LSB » Tue Jun 09, 2020 6:13 pm

w-u-2-o wrote:The only problem I have experienced with the resampler is that it will periodically go unstable on me, particularly when starting Thetis.

Scott,

What is a "resampler", and why can't I find it in the Thetis software or documentation (I've always been a Thetis user)? Why is it called that, what does it do, how does it work, etc?

The definition and/or operating theory of a resampler has heretofore evaded all of my efforts to find. I was under the assumption that there is no resampler in Thetis but your statement forces me to abandon that assumption.

TIA,
Mark
User avatar
w-u-2-o
Posts: 2717
Joined: Fri Mar 10, 2017 1:47 pm

Re: Resampler Adjustment

Postby w-u-2-o » Tue Jun 09, 2020 7:37 pm

Mark,

Did you read the link I posted above? If not, please do that and let us know if that answers your questions.

73,

Scott
K1LSB
Posts: 81
Joined: Wed Feb 05, 2020 5:25 pm

Re: Resampler Adjustment

Postby K1LSB » Tue Jun 09, 2020 8:21 pm

Scott,

I've read that post before.

1) The post is specifically about PowerSDR, not Thetis. The post speaks of "Resampler" checkbox in Setup > Audio > VAC1" but I see no such checkbox in Thetis.

2) It also speaks of a "diagnostic display" but I can't find that either.

3) It speaks of setting the "primary buffer size" and "VAC buffer size" but I can't find either of those defined or designated anywhere.

4) It also says that "the smallest possible ringbuffer on the receive side is 512, the smallest on the transmit side is 1024", but both default ringbuffer sizes on my screen (mine are labeled "In' and "Out" ringbuffers, not "Receive" and "Transmit") are 120, much smaller than either of the numbers noted in the post.

So the post you linked to is more confusing than enlightening, at least to me.

Regardless, I'm still not clear on exactly what a resampler is, or whether it's optional or not (can be enabled/disabled at will), or whether it's even recommended or not, or how it's used in Thetis.

I ask mainly because of your previous statement specifically mentioning the existence of a resampler in Thetis.
User avatar
w-u-2-o
Posts: 2717
Joined: Fri Mar 10, 2017 1:47 pm

Re: Resampler Adjustment

Postby w-u-2-o » Tue Jun 09, 2020 10:11 pm

K1LSB wrote:Scott,

I've read that post before.

1) The post is specifically about PowerSDR, not Thetis.


I had hoped you could make the leap between the two programs, but apparently not. The resampler is the same in both programs and performs the same functions for the same reasons, which are (quoted from the link above):

"Adaptive Variable Resampler:

This release of PowerSDR mRX (and in the equivalent Thetis release) introduces an optional Adaptive Variable Resampler option for VAC audio. The implementation is a true resampler and not just a data "smoother".

Since both the radio and the PC use different clocks to obtain their nominal 48KHz audio sampling rate, the rate in the radio will not exactly match the rate in the PC. This sample rate mismatch leads inevitably to audio buffer under- and over-runs that often result in audible glitches in the VAC audio streams, both transmit and receive. The resampler acts to transform audio data across the radio clock domain and the PC clock domain, thereby substantially eliminating these glitches. The resampler also works for those who are using the VAC IQ data output at all IQ sample rates, and spur levels will be extremely low even at 192KHz."


The post speaks of "Resampler" checkbox in Setup > Audio > VAC1" but I see no such checkbox in Thetis.


There are many differences in the UI between PowerSDR and Thetis. In Thetis the resampler is enabled by default, hence there is no longer a checkbox. However you can force disable it by selecting the "Force" checkboxes in the diagnostic display.

2) It also speaks of a "diagnostic display" but I can't find that either.


This is the same in both PowerSDR and Thetis and is comprised of the area marked "VAC1 Monitor" in both programs.

3) It speaks of setting the "primary buffer size" and "VAC buffer size" but I can't find either of those defined or designated anywhere.


I'm sorry that there is no specific documentation for every feature of both programs. That is unlikely to change unless someone volunteers to write it. At any rate (ha, a pun!) the audio portion of the code in Thetis is quite a bit different than in PowerSDR and there no longer is a Primary Buffer to be set. There is, however, in both programs, a Buffer Size setting in Setup > Audio > VAC1. You can't miss it (or maybe you can?)

4) It also says that "the smallest possible ringbuffer on the receive side is 512, the smallest on the transmit side is 1024", but both default ringbuffer sizes on my screen (mine are labeled "In' and "Out" ringbuffers, not "Receive" and "Transmit") are 120, much smaller than either of the numbers noted in the post.


Yes, ignore all that, it is PowerSDR specific. In Thetis, as already mentioned, the audio portion of the code has changed substantially. There are a number of new controls for Buffer Latency, none of which having any direct relationship with the resampler. However, anecdotally the resampler does seem to work better with smaller numbers in all of these boxes, and the VAC buffer size as well. You will have to experiment. I like to set the buffer to the minimum, port audio to 0 (manual), and then start messing with the ringbuffer (again on manual). You need a way to monitor receive audio coming via VAC1 to know what works and what doesn't, it can be very hard to determine this merely by looking at the waterfall in WSJT-X or Fldigi (for example). I like to use Voicemeeter because I can route the audio to my PC speakers and listen to it for glitches and whatnot when doing these adjustments.
K1LSB
Posts: 81
Joined: Wed Feb 05, 2020 5:25 pm

Re: Resampler Adjustment

Postby K1LSB » Wed Jun 10, 2020 1:33 am

Thank you for clarifying Scott, that does help a lot.

Return to “PowerSDR mRX”