Skip to content

Iq tool center freq lock #1010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vladisslav2011
Copy link
Contributor

@vladisslav2011 vladisslav2011 commented Dec 2, 2021

Problem: It is possible to change the center frequency while playing an IQ file. The
real file center frequency does not get shifted to correct position in this
case, so the spectrum plot/waterfall becomes shifted from actual played
frequency, bookmarks become not valid, freqCtrl shows wrong frequency,
plotter shows wrong frequency and so on.

This PR changes frequency setting logic to be more staraightfroward
and consistent.

Independent of frequency change event source (freqctrls, plotter, remote)
do the things in a same way: calculate new center and offset, taking into
account the fact, that the center frequency may be loked due to IQ file
playback, set the new frequency on a receiver side, then update all GUI
controls to reflect changes.
Enforce new frequency limits on the plotter side when IQ playback is started.

The "Ignore limits" checkbox still makes it possible to change center frequency
even when playing IQ file.

Next in series: #1011

Close #951

@vladisslav2011 vladisslav2011 mentioned this pull request Dec 2, 2021
@vladisslav2011 vladisslav2011 force-pushed the iq_tool_center_freq_lock branch from 2b6287e to a02ac19 Compare December 2, 2021 19:28
@vladisslav2011
Copy link
Contributor Author

Rebased onto updated iq_tool_center_freq_fix + some code style fixes.

@vladisslav2011 vladisslav2011 force-pushed the iq_tool_center_freq_lock branch from a02ac19 to f74ab12 Compare December 3, 2021 22:59
@vladisslav2011 vladisslav2011 mentioned this pull request Dec 3, 2021
@vladisslav2011 vladisslav2011 force-pushed the iq_tool_center_freq_lock branch from 59db607 to 12f38f9 Compare December 15, 2021 22:30
@vladisslav2011 vladisslav2011 marked this pull request as draft December 18, 2021 20:06
@vladisslav2011 vladisslav2011 force-pushed the iq_tool_center_freq_lock branch 2 times, most recently from 2630308 to b172870 Compare December 18, 2021 21:23
@vladisslav2011
Copy link
Contributor Author

Rebased on top of current iq_tool_center_freq_fix.

@vladisslav2011 vladisslav2011 marked this pull request as ready for review December 18, 2021 21:23
@vladisslav2011 vladisslav2011 force-pushed the iq_tool_center_freq_lock branch 2 times, most recently from 71c77b3 to a7e242f Compare December 27, 2021 03:08
@vladisslav2011 vladisslav2011 force-pushed the iq_tool_center_freq_lock branch 2 times, most recently from 12b4da6 to ceaa48c Compare December 31, 2021 00:24
@argilo
Copy link
Member

argilo commented Dec 31, 2021

There are quite a few code changes here, so it would be very helpful to have some explanation of what's going on.

Some questions:

  • In what ways is it possible to accidentally change the hardware frequency?
  • What are the consequences of changing the hardware frequency during I/Q playback?
  • What changes were necessary to solve this?

@vladisslav2011
Copy link
Contributor Author

vladisslav2011 commented Dec 31, 2021

  • In what ways is it possible to accidentally change the hardware frequency?

Wheel over freqCtrl, middle button dragging of plotter horizontal axis, dockrxopt frequency input.
I do it all the time while using the IQ Tool.
It is possible to change hardware frequency with remote command 'F', but it is highly unlikely that anybody would use remote control while playing IQ file.

  • What are the consequences of changing the hardware frequency during I/Q playback?

Bookmarks become not valid, freqCtrl shows wrong frequency, plotter shows wrong frequency and so on.

  • What changes were necessary to solve this?

The main change is here: ceaa48c#diff-2fc3518522047c9d0c5d1f75d1de006499a71e9812311c7228c892a5250bad48R866-R885
Other changes were made to remove event flow loops and make all frequency changes and widgets updates go through MainWindow::setNewFrequency.

Thanks for a review.
I think, we can close #951 with this PR too.
I'll do required changes, make some tests and reopen the PR soon.

@vladisslav2011 vladisslav2011 marked this pull request as draft December 31, 2021 11:00
@vladisslav2011 vladisslav2011 force-pushed the iq_tool_center_freq_lock branch from ceaa48c to 4d2f6a2 Compare December 31, 2021 11:45
@vladisslav2011 vladisslav2011 marked this pull request as ready for review December 31, 2021 13:18
@vladisslav2011 vladisslav2011 force-pushed the iq_tool_center_freq_lock branch from 4d2f6a2 to f26e78b Compare December 31, 2021 18:03
@argilo
Copy link
Member

argilo commented Dec 31, 2021

What if the filename does not have a frequency, or the frequency is incorrect? Should the user not be allowed to adjust the frequency in those cases?

@argilo
Copy link
Member

argilo commented Dec 31, 2021

I guess the core of the problem is the behaviour of the main frequency control, which currently changes the hardware frequency rather than the channel filter offset. I sometimes find this annoying even when using hardware inputs, because changing the hardware frequency is disruptive. (It is not instantaneous, especially when using remote devices, it shifts the waterfall, and it invalidates FFT averages.)

I agree that it makes sense for the main frequency control to adjust the channel filter offset during I/Q playback. It might even make sense for that to be the default for hardware inputs. (SDR# works this way, for instance.)

I'll have to play around with this a bit more and think about what, if anything, should be done to allow the hardware frequency to be adjusted during I/Q playback.

@argilo
Copy link
Member

argilo commented Dec 31, 2021

One minor issue: if an I/Q file is opened using the I/O Devices panel instead of the I/Q tool, then the current frequency continues to be used, even if it is well outside the viewable range:

Screenshot from 2021-12-31 17-31-58

Getting it back in range using the main frequency control is a bit painful. Clicking on the FFT gets it back in range more easily.

The frequency should probably be clamped to be within the bounds of the FFT.

@vladisslav2011
Copy link
Contributor Author

What if the filename does not have a frequency, or the frequency is incorrect?

This case is addressed by this PR: #1026

what, if anything, should be done to allow the hardware frequency to be adjusted during I/Q playback.

I think, the hardware frequency should be adjusted during IQ playback only in the same way, it had changed during recording of the corresponding file. This may be implemented by processing tags, generated by SigMF source in future.
Another case, when hardware frequency is changing during IQ recording is satellite signal recording with remote control to compensate the doppler shift. In that case the hardware frequency should not be adjusted during playback due to obvious reasons...

The frequency should probably be clamped to be within the bounds of the FFT.

This can be done in MainWindow::setNewFrequency. Then it may be possible to remove bounds checking in the plotter. I'll try to implement this and update this PR.

@vladisslav2011 vladisslav2011 force-pushed the iq_tool_center_freq_lock branch from f26e78b to 4eb4a87 Compare January 1, 2022 01:20
@vladisslav2011
Copy link
Contributor Author

The frequency should probably be clamped to be within the bounds of the FFT.

Done.
My tests show no regressions nor UX degradation.
Bounds checking in the plotter is done only to prevent moving the waterfall/spectrogram far away from visible area while zooming. Nothing to do here.

@vladisslav2011 vladisslav2011 force-pushed the iq_tool_center_freq_lock branch from 4eb4a87 to 762f804 Compare February 18, 2022 18:56
@vladisslav2011 vladisslav2011 force-pushed the iq_tool_center_freq_lock branch from 762f804 to 4691351 Compare August 9, 2022 16:01
@vladisslav2011 vladisslav2011 force-pushed the iq_tool_center_freq_lock branch 2 times, most recently from 7a4ad32 to 625a696 Compare August 9, 2022 16:28
@vladisslav2011 vladisslav2011 force-pushed the iq_tool_center_freq_lock branch from 625a696 to fb47032 Compare August 21, 2022 00:14
@vladisslav2011 vladisslav2011 force-pushed the iq_tool_center_freq_lock branch from fb47032 to 70b7523 Compare October 3, 2022 21:53
@vladisslav2011 vladisslav2011 force-pushed the iq_tool_center_freq_lock branch from 70b7523 to 0fd25ea Compare October 20, 2022 12:07
@vladisslav2011 vladisslav2011 force-pushed the iq_tool_center_freq_lock branch from 0fd25ea to f91f6a9 Compare November 5, 2022 00:46
@vladisslav2011 vladisslav2011 force-pushed the iq_tool_center_freq_lock branch from f91f6a9 to 38f6e3a Compare November 15, 2022 16:01
@argilo argilo added the feature label Mar 25, 2023
@vladisslav2011 vladisslav2011 force-pushed the iq_tool_center_freq_lock branch from 38f6e3a to 6e8596e Compare July 28, 2023 17:31
...while playing back IQ file.

Problem: It is possible to change the center frequency while playing an
IQ file. In this case the real file center frequency does not get shifted
to a correct position, so the spectrum plot/waterfall becomes shifted from
actual played frequency, bookmarks become not valid, freqCtrl shows wrong
frequency, plotter shows wrong frequency and so on.

This commit changes frequency setting logic to be more staraightfroward
and consistent.

Independent of frequency change event source (freqctrls, plotter, remote)
do the things in a same way: calculate new center and offset, taking into
account the fact, that the center frequency may be loked due to IQ file
playback, set the new frequency on a receiver side, then update all GUI
controls to reflect changes.

Enforce new frequency limits on the plotter side when IQ playback is
started.
@vladisslav2011 vladisslav2011 force-pushed the iq_tool_center_freq_lock branch from 6e8596e to 754f8b2 Compare April 3, 2025 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

set_rf_freq() does not check hw tuning result
2 participants