g4ixt / QtTinySA

A Python 'TinySA' GUI programme using Qt5 and PyQt5
GNU General Public License v3.0
104 stars 26 forks source link

LO Freq Offset shift? #35

Closed majortom9 closed 7 months ago

majortom9 commented 8 months ago

Hi, Thanks for sharing your work, love it so far. Would you be able to implement a checkbox or something to integrate an LO offset, in order to shift the displayed frequency by a user defined LO Frequency Offset?

See below commit I added to do this (minus the necessary UI mods) for my limited use case. eg - looking at the IF output signal from a CBAND Satellite Antenna LNB output. This suits me, but it would be more flexible if there was a user configurable option to account for an external LO Offset like that, rather than hard coding it like I did.

https://github.com/majortom9/QtTinySA/commit/57145365022fb781325288889650f1548928f4e5

Here is an example display, for an input spectrum of 950-1150 MHz. This way it's displayed for me in terms of the actual over the air frequency. I would have given it a go myself, but I am not familiar with PyQt development. Have had limited experience with Qt / C++ though. IF output = 5150 MHz - Sat Freq (OTA).

Qt-Tiny-SA-v0-9-1-modified

g4ixt commented 8 months ago

Yes, I like that idea it will be useful for AO-100. I have just modified the v0.9.3 config database tables to allow for this enhancement in future (a checkbox and spinbox). Depending on how easy it is to code I might add it into the next 'release' but I have almost finished working on that.

majortom9 commented 8 months ago

that would be awesome, thanks. btw, in case I wanna play around, follow along... what IDE tool(s) are you using to develop on? No windows machines, so I am limited to linux tools here.

g4ixt commented 8 months ago

I haven't been able to add it to the version I was working on because (compared with the version you modified) I have made a lot of changes to the markers and it wasn't easy to replicate your changes without breaking things. I will do it for the next version. I have added a couple of things though: I modified the config database, ready, and added a module called 'freqOffset' in the display Class, and in the preferences dialogue I have put a LO freq spinbox and radio buttons for high/low mixing. None of this does anything yet.

I just pushed this latest version v0.10.0 to my development branch and my next jobs are to build and test executables and then deploy it to the main branch.

I use Anaconda with the Spyder 5.15.10 Python IDE and Qt Designer 5.15.2 for the GUI. Python version is 3.11.7. I use pyinstaller for building the executables. All running in Kubuntu Linux 22.04 LTS.

I use Windows 11 just for building and (rudimentary) testing the Windows .exe

majortom9 commented 8 months ago

Thanks for pushing those changes, helped a lot. Getting closer. Please feel free to double check it, use it, modify, or do something else entirely... but this git formatted patch works for me on top of your latest commit 06738c7 from 'main' branch, with a CBAND LNB (5150 LO). And I've checked that the math works out if a User had entered a North American Ku LNB (10750 LO). What I haven't looked in to yet is why the user defined LO Freq isn't getting saved in ~/.config/QtTinySA/QtTSAprefs.db

0001-use-LO-Offset-for-a-user-defined-external-LO.patch.txt.

The below pic is from my raspberrypi 3b+ with TinySA connected to a spare line of my satellite antenna system.

Qt-Tiny-SA-LO-Offset

And here is a pic of my settings dialog. Qt-Tiny-SA-LO-Offset-settings

majortom9 commented 8 months ago

I looked in to the database not saving the Lo Freq last nite, and it looks like this patch on top of the one above will fix that. The only thing left to make this a viable feature add, is figure out how to save the "High/Low" Setting in the preferences to the database. As it is right now, I have to toggle that from "Low" to "High" every time I open the app, since it's not saved. Needs to get added to one of the Sql Tables first. Then can worry about saving it.

qttinysa.patch.txt

majortom9 commented 8 months ago

I was able to modify the QtTSAprefs.db, 'numbers' table structure, using sqlitebrowser, and save the highLO setting status to the database. Now these three patches on top of your last commit, 06738c7e from 'main' branch are working for me. Take a look and see what ya think.

0003-save-external-LO-high-low-setting-to-the-database.patch.txt 0002-save-freqLO-to-database.patch.txt 0001-use-LO-Offset-for-a-user-defined-external-LO.patch.txt

g4ixt commented 7 months ago

I will have a look at your patches. I have been having a bit of a break after spending a lot of time on the 0.10.1 version and was just going to have a look at it again.

g4ixt commented 7 months ago

Implemented in v0.10.2