[last updated: 2019-05-23]
SDR home page
Java: Editing, Compiling, & Executing
SDR - Tutorial2
SDR - Tutorial3
-----
Note: These notes are written for Linux, on my Dell Precision laptop.
- This study starts with this tutorial, which takes you through the process of writing your own code for interface to an SDR dongle:
(link to:) Excellent tutorial by G0KLA on SDR's, Python, & Java
- G0KLA says you can use either Java or Python for programming, though "Java is much faster," so even though I've done some Python, I will dig into learning Java (plus all but first couple of sections of the tutorial use Java and no Python).
- Java installation notes:
- At this point, I have successfully installed Java on the Linux Dell.
Later I will install the Eclipse IDE
- Download G0KLA tutorial SDR java files and create initial directory structure:
- Copy files from SDR-master to start building my SDR project:
- In SDR-master/scr/tutorial1 directory, there is SdrTutorial1.java,
which is the program that will run and test the Oscillator program/class,
which itself is located in the signal sub-directory.
- Copy both the SdrTutorial1.java file and the signal sub-directory
into the SDR/src/tutorial1 directory.
Remember to create a signal directory in the bin branch.
- Edit the first line of SdrTutorial1.java to read:
package tutorial1;
- In the signal directory, edit the first line of Oscillator.java to read:
package tutorial1.signal;
- At this point, the Oscillator program compiles successfully with:
$ javac Oscillator.java,
However the SdrTutorial does not, needing the JTransforms FFT library.
- Download and install FFT:
- I found this library by searching for JTransforms:
(link to:) github.com/wendykierp/JTransforms
- First time around I downloaded the zip file at the top, but even after much gnashing of teeth I could not make it work, as it needed other classes/dependencies (jlargearrays, math3, perhaps others) that I could not make work.
Then I got a critical tip from g0KLA (Thank you, Thank you, Thank you) and next time scrolled down the github page to find:
JTransforms-3.1-with-dependencies.jar
- Downloaded this file, moved it into SDR/lib/JTransforms folder, then double-clicked to extract.
Note that .jar files contain compiled classes, and do not include .java source files.
- Edited CLASSPATH to include complete path to:
SDR/lib/JTransforms, below which is the org directory that is used in the package declarations.
- Success, mostly. SdrTutorial1.java compiled successfully, and I moved the class file into SDR/bin/tutorial1, then moved into SDR/bin, and it successfully executed with $ java tutorial1.SdrTutorial1.
- However the data returned was not sine wave, but the 65-datapoint frequency domain later in the tutorial. Say what?
It turns out that in the tutorial, he describes code to do both, look at sinewave output of the Oscillator, as well as calculate and return the freqency domain data. Problem is, both versions use the same filename, SdrTutorial1, and the version in SDR-master is in fact the frequency domain version.
- I'm going to rename the frequency domain version SdrTutorial2, and type in code for the sinewave version as SdrTutorial1
- This concludes tutorial1
Proceed to: tutorial2
- G0KLA tutorial recommends using the Eclipse IDE:
(link to:) download
I have not yet downloaded or investigated it.
.
.
.
eof