I. Set up the files according to your design
- Files you are using:
- Tx and Rx with two individual computers, Tx: ook_pluto_tx.grc, Rx: ook_pluto_rx.grc,
- Tx and Rx with THE SMAE computers, Tx: and Rx: ook_pluto_rtlsdr.grc. (This will be the default setting for the demo on this page.)
- Change the message to one of your team members’ names or anything very unique, so that you can tell the signal received is indeed being transmitted by your team.
- Change the settings according to your design. (Circled values)
Choose correct cutoff for LPFs
PlutoSDR Sink transmits an OOK modulated signal and RTL-SDR Source captures signal between the BW of [(center_freq - 1/2*sample_freq) , (center_freq + 1/2*sample_freq)], downconverts to 0 centered..
Recall how to calculate 1st null band of a random binary signal from Lab 5, the data rate is given by fysm (Symbol rate). Based on your calculation, choose a proper cutoff for both signals.
Notice that with LPF 1 in use and cutoff set properly, you are likely to always detect the message with comparably good PSR. It is added for removing noise and also enables you to verify the transmission is done correctly. Otherwise, if we bypassed it, when interference is enabled, you are unable to receive the message transmitted properly. You are unable to tell if this is caused by the wrong setting, hardware issue, or interference.
Eventually, LPF 1 will be replaced by your circuit design.
II. Tx and Rx signal without interference
Once you have done setting up, we can test out the device and verify if all settings are correct.
- Connect two long antennas (silver extendable, one in each toolbox, two for each team), one of them to RTL-SDR, and another one to the Tx port of Adalm Pluto. (The short antenna that came with Adalm is not suitable for this task.)
- Place the Tx and Rx around 1 meter away.
- Run tx.grc and rx.grc, or stlsdr.grc.
- Make sure the "Enable Interference" checkbox at tx is unchecked.
- If everything is correct, you should be able to observe outputs at the console window (either the GNURadio or Python console.) There are two possible observations:
- Msg followed by Packet Count, Text Count, PSR, and Time. (Signifies that the receiver is able to receive and demodulate the message correctly, see example below.)
- "OOOOOOOOOOOOOOOOOOOOOOOOOOOOO". (Signifies that the receiver is receiving things but unable to demodulate the message expected, an overflow situation.)
- To fix the second scenario, double-check all the settings, and move Tx and Rx closer. Ask for help if you are unable to make it work.
III. Record signal with Waveform and Convert with Python Code
a. Recording
- We can record the signal through the yellow wired tapped out from RTL-SDR hardware. If you see two yellow wires, use either one.
- Connect a grounding wire to RTL-SDR, you can twine the naked wire near the antenna and screw it tightly to fix the wire. Some RTL-SDR might came with fixed wired from seniors, double-check if the wire is in contact properly and in a good condition.
- Connect wires to AD2:
- Grounding wire to GND
- Yellow wire to Scope (either 1 or 2)
- Setting Waveforms:
- “Settings -> Device Manager -> Option 2 (2x16k)” to maximize the buffer size
- Change the “mode” to “Record”
- Click “Config”, choose “Samples” of “32768”, “Rate” of “4 MHz”, “Base” of “7.5ms”, and click “Start”
- You can repeatedly click “Record” button to capture the data.
- At the side panel, click “Options”, uncheck “noise”, click “Zero offset”
- Once done, select ”File -> Export”. Under “Data” tab, select “Save” and store the data into “test.csv”. (You chan change the file name to anything you like, but remember to change the Python code accordingly)
RTL-SDR Downconversion
RTL-SDR performs a two-step downconversion:
- At the hardware level, it downconverts BW of [(center_freq - 1/2*sample_freq), (center_freq + 1/2*sample_freq)] to [(1.5 MHz- 1/2*sample_freq), (1.5 MHz+ 1/2*sample_freq)]. This 1.5MHz is determined. This means that the signal you tapped out from the yellow wire is centered at 1.5 MHz. The message signal will be centered at 1.5 MHz, 1st null at 1.5 MHz + fysm, and the noise signal will be centered at 1.5 MHz + fint.
- At the software level, the signal coming out from the RTL-SDR Source block is downconverted to 0 Hz centered.
- Keep in mind the magic number 1.5 MHz when you are designing the cutoff.
b. File Conversion
- Files you are using:
- test.csv
- csv2grcf.py
- The signal file saved is in a csv format. We need to convert it to other formats to be used for GNURadio or LTSPICE.
- Convert to GNURadio readable format: csv2grcf.py
- This converts "test.csv" into "time.dat" and "test.dat"
- "test.dat" can be read by GNURadio
- Convert to LTSPICE simulation input signal:
- (You can skip this step for now, revisit it when you have a LTSPICE design to test)
- Convert "test.csv" into "time.dat" and "test.dat"
- Move "time.dat" and "test.dat" into folder "/LTSPICE".
- Run bin2spice.py to convert "time.dat" and "test.dat" into "fin1.dat"
- "fin1.dat" can serve as an input signal to test your LTSPICE design.
- For a detailed guide on LTSpice simulation, see page: LTSpice Simulation
- Convert to GNURadio readable format: csv2grcf.py
IV. Read Recorded Signal with GNURadio
- Files you are using:
- opamp_file.grc
- test.dat
- Open "opamp_file.grc", and change parameters according to the setting in part I. You need to set the LPF cutoff as well.
- In "File Source" block, load "test.dat" converted from "test.csv" in the above step.
- Run the program, you should see similar outputs from part II. If the console window is empty, the signal is unable to be detected properly. Redo the recording and conversion.
Now, with step I - IV, you should be familiar enough with the SOP. However, this is the case when no interference has been involved. Repeat the above steps with interference enabled, record a few signals with different interference amplitude, and you can use these to determine a good level of suppression of your LPF.
If you are feeling lost at the moment, you may refer to the page: Typical Design Flow for a systematic approach.