Automatic tuning of Linrad by MAP65


The purpose of this project was to allow Linrad to automatically track the MAP65 QSO frequency.

I modified the users_w3sz.c file that was created long ago and is a part of the Linrad source distribution, and created a file extra_w3sz.c that Leif will be adding to the Linrad distribution. I also added a few items to the file screendef.h.

Linrad can be compiled with these files by renaming users_w3sz.c to wusers_hwaredriver.c if you are using windows or users_hwaredriver.c if you are using Linux, and renaming extra_w3sz.c to users_extra.c, and using the modified screendef.h.  NOTE ADDED 2-24-2015:  These 3 files are all now a part of the standard Linrad distribution.  So do NOT download the files from this page; use the ones included in the Linrad distribution, renaming users_w3sz.c and extra_w3sz.c as noted above and then compile Linrad by doing "configure" and then "make linrad.exe" if compiling under Windows with minGW, for example.

The version of Linrad compiled in this manner will then follow the MAP65 QSO frequency without the need to click on the Linrad main spectrum or waterfall to change the Linrad receive frequency.

[Note:  If you want to have a system where a Master instance of Linrad controls the frequency of one or more Slave instances of Linrad, but does not follow MAP65's frequency, then read these instructions, and if the following files are not already a part of the Linrad source that you downloaded, then download extra_w3sz_hb9dri.c and users_w3sz_hb9dri.c from here to get the source code needed to make the change.]

This version of Linrad can then be used as a master instance to supply baseband data containing signal information for both H and V polarity to slave instances of Linrad.  Each of these slave instances of Linrad can then be run so as to select a different received signal polarization angle, at the same time as the master Linrad instance is supplying MAP65 with timf2 data for both received polarization angles.  In this way you can simultaneously run MAP65 which can receive with any polarization angle, and also multiple separate instances of WSJT to receive with H, V, +45, -45, right-circular, left-circular polarization, etc.

I have generally run MAP65 in parallel with a single instance of WSJT acting as a "backup", receiving its signal via my FT1000 MP and a transverter, with the receive polarization set to whichever of the polarizations H or V is closer to the actual polarization angle of the received station.

The reason I have done this is that I have found over the years that, just due to statistical variation, the WSJT decoder will sometimes decode a station that MAP65 did not, or vice versa. Over the course of many hundreds or perhaps even more than a thousand exchanges during a contest, even a small percentage of additional decodes makes a significant difference.

One disadvantage of my old FT1000/WSJT approach is that some decodes are missed due to selecting H when V should be selected, or vice versa, because the optimal receive angle was not known in advance.   Another disadvantage is that up to 3 dB can be lost if the signal is at 45 degrees and only H and V receive polarization angles are available.

I decided to do this after Leif pointed out that Linrad could be used to send both H and V polarization baseband information to multiple slave instances of Linrad which could then analyze multiple receive polarization angles, as noted above. With this technique it is possible to mimic in software the elegant hardware setup that Carsten DM1CG described as being used at DK0KK to analyze multiple receive polarization angles simultaneously.  By having Linrad track the MAP65 QSO frequency, the process is automated and Linrad need not be tuned manually.  In fact, once things are set up, Linrad does not need to be touched at all, or even visible on the screen, although it is important if you are using the smart noise blanker to check  things periodically to make sure that its settings are appropriate for the signals levels that you are receiving.

To set this up one needs to do the following:

1. Compile Linrad with the 3 files as above added. First configure. Then make.

2. Type the location of the MAP65 azel.dat file into the file named azel_location.txt that is located in the working master Linrad directory you have just used to compile Linrad. The location typed into the file needs to be specified using double backslashes where one backslash would ordinarily be used, e.g. C:\\MAP65\\azel.dat instead of C:\MAP65\azel.dat.

3. Start the Master instance of Linrad.  After selecting "N" from the main menu of the Master instance of Linrad, set the Master Linrad version up to send to a group address that will be acceptable to both MAP65 and the slave instances of Linrad. My network is, so I use I found that I couldn't use the obvious choice of when running multiple Linrad slaves; only one connection was permitted.  When you are done your network menu screen should look something like this:

4. Type "U" from the main Linrad menu to get to the audio input/output setup menu and type "A" to access the menus that are used to set up your input, and set up your input soundcard. Then type "B" to access the output setup menu, and type "Z" to disable soundcard output. When you are done the sound menu screen should look something like this:

5. Go back to the main Linrad menu and type "T" to enable network output. Type "W" to save the parameters.  Your main menu screen should look like this:

6. Make a separate disk directory for each polarization angle you want to receive. I currently am experimenting with 6 directories / receive polarization angles: H, -45, +45, V, R-circular, and L-circular. Place an installation of WSJT into each directory. I named my directories WSJT9-H, WSJT9-V, WSJT9-P45, WSJT9-N45, WSJT9-RC, and WSJT9-LC.

7. Create a Linrad slave directory in each WSJT directory, and place a standard version of Linrad with the usual support files into each of these directories.

8. Select "N" from the main menu of each Linrad slave instance and set the receive network address to (or your appropriate alternate choice) and select "12" (Rx input from network) and then "F" (Baseband, raw, 24 bit). When you are done your network menu screen should look something like this:

9. Type "U" from the main menu of each slave instance of Linrad and then type "A" to select input, and then type "Y" to select Network. If the network menu screen comes up again just type "0" to exit back to the main audio setup page.  Then select "B" and say "Y" to use PortAudio and then select the displayed device number for the Windows WDM-KS version of the Virtual Audio Cable that you are going to use to feed that instance of Linrad's companion instance of WSJT.  With the setup I described in #6 above, I need 6 Virtual Audio Cables.  My virtual audio cables have device numbers 58-63, but the numbers assigned to your devices will likely be different.  Note that these device numbers are NOT the same as the device numbers that will be used for these same devices in the WSJT setup menu.  An example of the Linrad audio output device page is below.

10. Start the Master instance of Linrad and type "D" to go to SSB mode and then set the hardware frequency appropriately. With my WSE hardware I set the frequency in the hardware box in Linrad to 144.125. Set the output sampling rate for the Master instance of Linrad to 22050. Then click anywhere on the main spectrum.

11. Start MAP65. Linrad's cursor should jump to the QSO frequency, if you have done everything correctly.

12. Set up your baseband filter so you send a reasonable audio passband to the slave receivers. I set it to give me an approximately 2.5 kHz bandwidth. Click on the polarization angle display text "Adapt" to turn it into "Fixed". Click to set the polarization angle to zero if it isn't already.

13. Start the first slave instance of Linrad and type "D" and click in the middle of the frequency band on the main display of this instance. Set your baseband filter by pulling it with the mouse, so that it is appropriate for WSJT. I set mine to approximately 2.5 kHz. Click on the polarization angle display text "Adapt" to turn it into "Fixed". Click to set the polarization angle to your desired value for that instance of WSJT.  Set your output audio sampling rate to 11025.

14. Repeat #13 for each separate polarization angle's instance of Linrad.

15.  Start the WSJT instance for your first polarization angle.  Review the WSJT device screen to see what device number you need for the input virtual audio cable.  You will also need to set an audio output device number, even though you won't be using WSJT to transmit, as MAP65 will do that.  In the screen below, 6 is the device number that should be chosen in order to use virtual audio cable 1 for audio in.  Device 11, Realtek HD Audio output, would be chosen for audio output.

The devices are then set up in WSJT by using the Setup>Options menu, which is shown below.  In this example I chose Device 6, Virtual Cable 1, as input and Device 11, Realtek HD Audio output as output.

16.  Repeat #15 for each instance of WSJT.

It looks complicated seeing it written out, but it is actually simple to set all of this up, and it needs doing only once. After that Linrad tracks MAP65 automatically.  The audio for the appropriate frequency is then sent to each instance of WSJT, and you just click on signals on the WSJT SpecJT displays to decode the signals of interest, as usual. Everything else happens automatically.

Running 6 instances of the slave Linrad plus a separate instance of WSJT for each of these slave instances of Linrad plus the master instance of Linrad plus MAP65 plus a MAP65-rig control add-on program on my old core2duo only leads to 30-35% CPU utilization.

The Master instance of Linrad has a window which I had added to Linrad years ago to allow me to set my transverter offset.  I had included both a crude offset for the transverter (e.g.116 MHz for a two meter transverter), and a fine offset, for hardware inaccuracies, compensation for the BFO offset, etc.  This box is visible at the upper left of the Linrad screen grab below.  1400 [Hz] is the offset I use at W3SZ.  To change the number, you just click on the "1400" and type in the value you want and then hit "Enter".  This screen grab also shows the baseband filter I use.  You can see that it is about 2500 Hz wide.  Note also that for proper orientation of the signal, the BFO bars are pulled to the left of center, not to the right.  Note that the polarization control is set to "Fixed" and 0 degree polarization.

Below is a screen grab of one of the slave Linrad instances.  You can see that I have clicked on the main display in the middle of the frequency display.  This is done when the program is started and then the frequency control is not touched again.  Note that I have the baseband filter set up approximately 2500 Hz.  I have set the polarization control to "Fixed" and I have set it to circular right-hand by first clicking at the upper left corner of the control to set the polarization to (-)135, and then clickon the left of the bar between the angular display and the Fixed/Adapt control to change the polarization type from linear to circular.  Note that the display shows a circle and displays an "R" indicating right hand circular polarization.

I set up shortcuts for each instance of Linrad and WSJT on the desktop, as well as for MAP65, so that I can quickly start the system.  This is shown below.

I have tested this and it all works.  I use it with three monitors to provide adequate room to view all of the MAP65 windows as well as both the SpecJT and Main windows for each instance of WSJT.  I also display the Master Linrad instance as well as three of the Linrad slaves. The fourth slave is minimized and rarely if ever needs to be viewed or touched.  It is important if you are using the smart noise blanker to check the master instance of Linrad periodically to make sure that its settings are appropriate for the signals levels that you are receiving.  Below is a screen grab showing the three monitor screens.  The left monitor displays MAP65 and the Visual Basic program that moves the FT1000MP to the appropriate MAP65 frequency.  The middle monitor has 3 of the 4 instances of WSJT; from left to right, they are Horizontal polarization, Vertical polarization, and +45 degrees polarization.  The monitor on the extreme right displays [from left to right] the +45 degree polarization instance of WSJT, the Master instance of Linrad, and the +45 degree polarization instance of the Linrad slave on the top, and the Horizontal and Vertical polarization instances of the Linrad slaves on the bottom.

Public Service Note:  Although these programs all make extensive use of Fourier transforms, these are not without risk.  Please use them responsibly to avoid untoward consequences.

Back to Top


Copyright 1997-2012 COPYRIGHT Roger Rehr W3SZ. All Rights Reserved

I am nerdier than 100% of all people.  Are you a nerd? Click here to find out!

Brought to you by the folks at W3SZ