hackrf one course lesson 11

SDR with HackRF One (Lesson 11: Replay)

Lesson 11 Overview

  • Being a good neighbor on the spectrum
  • QT vs. WX GUI in GNU Radio
  • Saving a waveform to file
  • Inspectrum
  • Transmitting
  • Replaying a captured radio signal
  • Using multiple HackRF Ones

In order to clearly see my screen during the demonstrations, viewing the video in full screen mode may help. Even better: You can download this video in high resolution (720p). (torrent)

Homework

  1. Capture a radio signal and save it to a file with hackrf_transfer ( Hint: use the -r option).
  2. Convert the file from unsigned 8-bit integers to 32-bit floats. This can be done with:
    sox foo.s8 foo.f32

    or:

    cat foo.s8 | csdr convert_s8_f > foo.cfile

    or with convert_s8_cfile.grc.

  3. Analyze the file with GNU Radio Companion and/or inspectrum to verify that you captured your signal of interest.
  4. Determine how many distinct sample values are present in your signal. (Hint: The number should be no more than 256.)
  5. How many bits of dynamic range does your signal span. (Hint: take the base 2 logarithm of the number of distinct sample values.)

Resources

hackrf one course lesson 10

SDR with HackRF One (Lesson 10: Filters)

Lesson 10 Overview

  • Lesson 9 homework review
  • Filter frequency response
  • Finite Impulse Response (FIR) filters
  • Multiply-accumulate (MAC) operations
  • Convolution
  • FIR filter performance
  • HackRF One baseband filter effectiveness
  • Low pass filters
  • High pass filters
  • Band pass filters

In order to clearly see my screen during the demonstrations, viewing the video in full screen mode may help. Even better: You can download this video in high resolution (720p). (torrent)

Homework

1. Create a flowgraph like the one in the video or like the screenshot below.

2. Add two more taps with sliders to the filter in the flowgraph.

3. Run the flowgraph and adjust the sliders to try to create a low pass filter with the stop band least 20 dB below the pass band and with a filter (pass band) bandwidth close to half the visible bandwidth. Judge the edge of the pass band as the point where the frequency response passes 3 dB below the highest response within the pass band.

4. Create a flowgraph containing a Low Pass Filter block. (Hint: You can use a flowgraph from a previous lesson.)

5. Execute the flowgraph or use the Generate function in GNU Radio Companion to generate the Python program output.

6. Locate the Python program output. (Hint: The filename is listed, without its .py extension, in the Options block in the upper left corner of the flowgraph.)

7. Use a text editor or file viewer to view the Python program and look for the firdes (FIR design) function within the program.

8. Under what conditions is the firdes function executed?

Resources

hackrf one course lesson 9

SDR with HackRF One (Lesson 9: Aliasing)

Lesson 9 Overview

  • Lesson 8 homework review
  • FSK demodulation
  • Negative frequencies
  • Aliasing
  • Lesson 4 homework review
  • Mysteries solved
  • Cosine as sum of two complex exponentials
  • Sampling theorem<
  • Anti-aliasing filters
  • Bandpass sampling

n order to clearly see my screen during the demonstrations, viewing the video in full screen mode may help. Even better: You can download this video in high resolution (720p). (torrent)

Homework

1. Create a flowgraph like the one in the screenshot below.

2. Run the flowgraph and use the Average option to view the frequency content of the noise.

3. Add a Low Pass Filter to the flowgraph, using sliders to control the filter’s cutoff frequency and transition width. Configure both sliders with a default value of samp_rate/8, a minimum of samp_rate/1000, a maximum of samp_rate/2, and 1000 steps.

4. Observe how the filter’s frequency response changes when adjusting the sliders. The Average option may be helpful.

5. Check your CPU utilization with the transition width set very low. How does it compare to the utilization observed with the transition width set to a moderate value?

6. Try high pass and band pass filters instead of a low pass filter.

Resources

hackrf one course lesson 8

SDR with HackRF One (Lesson 8: On-Off Keying)

Lesson 8 Overview

  • Analyzing a garage door opener remote
  • On-Off Keying (OOK)
  • fcc.gov
  • fcc.io
  • Rolling codes
  • Fixed codes

In order to clearly see my screen during the demonstration, viewing the video in full screen mode may help. Even better: You can download this video in high resolution (720p). (torrent)

Homework

  1. Find a garage door opener remote control or similar device. Does it have an FCC ID?
  2. If it has an FCC ID, look it up. What is the device’s operating frequency?
  3. Use GNU Radio Companion to find the signal produced by the device. You will probably need to hold down the button to make it transmit continuously. At what frequency did you find the device? (Hint: If your device does not have an FCC ID, try frequencies from 300 MHz to 433 MHz.)
  4. Look at the FFT plot of the signal. Does it appear to have very narrow bandwidth like my remote, or does it span more than a few kHz?
  5. Use a scope plot to look at the signal. Adjust the time scale and amplitude scale so that you can see complete data packets. Does it look like On-Off Keying (OOK)?
  6. If you are able to visually decode the transmitted bits, does the same sequence of bits repeat while you hold down the button? Does the sequence change if you release the button and press it again?

Resources

hackrf one course lesson 7

SDR with HackRF One (Lesson 7: Complex Numbers in DSP)

Lesson 7 Overview

  • Lesson 6 homework review
  • Why we use complex numbers in DSP
  • Amplitude modulation
  • Frequency modulation

In order to clearly see my screen during the demonstration, viewing the video in full screen mode may help. Even better: You can download this video in high resolution (720p). (torrent)

Homework

  1. Launch GNU Radio Companion and locate the block called Quadrature Demod. This block implements the method for frequency demodulation presented in the video. Notice that it takes complex input and produces real-valued (float) output which is a sequence of angles.
  2. Can you find a block that implements our method of amplitude demodulation? It should take complex input and produce real-valued (float) output where each output sample is the magnitude of an input sample.

Resources

hackrf one course lesson 6

SDR with HackRF One (Lesson 6: Complex Numbers)

Lesson 6 Overview

  • Negative numbers
  • Complex numbers
  • The complex plane
  • Complex arithmetic
  • Complex exponentials
  • Tau
  • Rectangular coordinates and polar coordinates
  • Complex number terminology
  • Quadrature terminology

In order to clearly see my screen during the demonstration, viewing the video in full screen mode may help. Even better – you can download this video in high resolution (720p). (torrent)

Homework

  1. A weather station measures wind direction once per minute. Write a program to indicate the average direction over a five minute period. Try it on the following sets of readings:
    • 12°, 15°, 13°, 9°, 16°
    • 358°, 1°, 359°, 355°, 2°
    • 210°, 290°, 10°, 90°, 170°
  2. Modify your program to handle wind speed input in addition to direction.

Resources

hackrf one lesson 5

SDR with HackRF One (Lesson 5: HackRF One)

Lesson 5 Overview

  • Packaging and enclosure
  • USB port
  • LEDs
  • Buttons
  • ANTENNA port
  • CLKIN and CLKOUT ports
  • libhackrf
  • hackrf-tools
  • Testing USB transfer rates
  • Updating firmware and CPLD
  • RF amplifier

In order to clearly see my screen during the demonstration, viewing the video in full screen mode may help. Even better: You can download this video in high resolution (720p). (torrent)

Homework

  1. Download the latest HackRF release.
  2. Update the firmware on your HackRF One. For this and the subsequent steps, you may want to boot to Pentoo or the GNU Radio Live DVD.
  3. Update the CPLD on your HackRF One. There is a known bug that prevents this from working on Windows. How about trying one of those live Linux distros?
  4. Determine the maximum sample rate supported by a USB port.
hackrf one lesson 4

SDR with HackRF One (Lesson 4: Mysteries)

Lesson 4 Overview

  • Lesson 2 homework review
  • Sample rates
  • Throttle block
  • The Atari effect
  • Negative frequencies
  • Data types
  • Quantization error

In order to clearly see my screen during the demonstration, viewing the video in full screen mode may help. Even better: You can download this video in high resolution (720p). (torrent)

Homework

  1. Start with the flowgraph from the lesson 2 homework. Add a scope sink.
  2. How do the scope and FFT change if you change the data type of every block from complex to float?
  3. When using the float data type, what happens if you specify a negative source frequency? How does that differ from the behavior when using the complex data type?
hackrf one lesson 3

SDR with HackRF One (Lesson 3: What is a Decibel?)

Lesson 3 Overview

  • Understanding decibels
  • Mistakes commonly made with decibels
  • How to master decibels

In order to clearly see my screen during the demonstration, viewing the video in full screen mode may help. Even better: You can download this video in high resolution (720p). (torrent)

Homework

I’d like you to exercise your knowledge of powers of two and make a table that will help you understand decibels even better. Get out a pencil and paper for this one.

Make a column of whole decibels down the left side of the page. Fill in 0 dB, 1 dB, 2, 3, and so forth all the way to 30 dB.

Then fill in ratios in a second column in this order:

  1. 0 dB (1:1), 3 dB (2:1), 6 dB (4:1), 9 dB (8:1), and so forth through 30 dB (1024:1)
  2. 10 dB (10:1), 13 dB (Hint: It is 3 dB more than 10 dB.), 16 dB, and so forth through 28 dB
  3. 20 dB (100:1), 23 dB, 26 dB, and 29 dB
  4. 2 dB ( Hint: It is 10 dB less than 12 dB.), 5 dB, 8 dB, and so forth through 17 dB
  5. 1 dB (Hint: It is 10 dB less than 11 dB.), 4 dB, and 7 dB

Now you have a complete table of approximations! The worst approximation is 30 dB which should be exactly 1000:1.

Make a third column. This column will contain ratios just like the second column, but start at 30 dB instead of 0 dB. Fill in the ratios in this order:

  1. 30 dB (1000:1), 27 dB (Hint: It is 3 dB less than 30 dB.), 24 dB, and so forth through 15 dB
  2. 20 dB (100:1), 17 dB (Hint: It is 3 dB less than 20 dB.), 14 dB, and so forth through 5 dB
  3. 10 dB (10:1), 7 dB (Hint: It is 3 dB less than 10 dB.), 4 dB, and 1 dB

It is possible to do more (for example, by starting with 12, 9, 6, and 3 dB) from this direction, but you start having to deal with more decimal places. It isn’t as convenient as working with the powers of two that you used in the second column. However, just filling in a few values in the third column can give you a feeling for the amount of error introduced by using the 3 dB approximation. Notice, for example the discrepancy between the ratios in the second and third columns for 7 dB. The true value of the 7 dB ratio is between those two approximations.

Can you figure out a way to determine the precise amount of error introduced by the 3 dB approximation?

Thanks to Tim Shepard for teaching me this exercise!

hackrf one lesson 2

SDR with HackRF One (Lesson 2: Digital Signal Processing)

Lesson 2 Overview

  • Lesson 1 homework review
  • Introduction to Digital Signal Processing
  • A simple flow-graph

In order to clearly see my screen during the demonstration, viewing the video in full screen mode may help. Even better: You can download this video in high resolution (720p). (torrent)

Homework

  1. Create a flowgraph like the one in the video or the screenshot below.
hackrf one course lesson 2

2. Does the flowgraph behave differently if you remove the throttle block? (Connect the source directly to the sink.)

3. Does the FFT sink correctly indicate the frequency produced by the source? What if the source and sink have different sample rates configured?

4. What happens if you configure the signal source with various frequencies between 0 and 16k?

5. What if you specify frequencies greater than 16k? Any idea why?

6. What if you specify negative frequencies? Mathematically, is there a difference between cos(x) and cos(-x)?

7. Does the plot indicate the presence of any frequencies other than the one produced by the source? (Hint: Use Autoscale or increase dB/Div.) What is the apparent amplitude of the noise? Why is there any noise at all?

8. Try multiple signal sources added together. Are there any other interesting operations you could try?

9. Try various waveforms (instead of cosine) in the signal source.

Resources