Adjusting Center Frequency
Frequency Shifting
Assume that we want to observe the FM signal, with a frequency range of approximately 88~108 MHz. Within this frequency range, there are many radio station signals, each occupying about 200 kHz, with the center frequency of each radio station located at the center of each band. Suppose the signal we want to receive is at 98 MHz. We can set the receiving frequency center of the HackRF One antenna to 98 MHz. However, in general, there may be some errors between the set value and the obtained result, so the frequency may still need to be adjusted appropriately. Therefore, the more common method we use is to fix the center frequency of the receiving frequency and process the received signal using frequency shifting and filtering. Assuming the center frequency is 100 MHz and the sampling frequency is 10 MHz, the effective observation frequency is 95~105 MHz, providing us with more flexibility.
The common practice is to multiply the signal by , which is equivalent to adding to each frequency component, or shifting the signal graph to the right by Hz. If we set the center frequency of the received signal as and multiply it by , the signal at the center frequency will shift to .
Practical testing using GRC:
Setting the module parameters as follows:
- Samp_rate: 10e6
- Soapy HackRF: Center_Freq=100e6
- Range: fs=0~6e6
- Signal Source: Freq=fs
- Freq_Sink: Freq_Center=100e6
Experimental results obtained by moving to 2 MHz:
Filtering Observation Frequency
Assume that the center frequency of the radio station we want to observe is , and we need to move to the center of the frequency and then use a low-pass filter to filter out other high-frequency components. In the above operation, assuming the original observation center frequency is , when all spectra shift to the right by , the original observation center frequency becomes . If , then .
Modify the system as follows:
- Range: f=96e6~104e6
- Signal Source: freq=100e6-f
Simulation results (f value is 100.7 MHz):
Low-Pass Filtering
We can add a low-pass filter to only keep the spectrum near the center of the observation frequency.
- LPF: Cutoff freq=80e3, Transition_Width=20e3
Simulation results (f value is 100.7 MHz):
Frequency Shifting and Filtering
The process of adjusting the frequency above: multiply the signal by a Signal Source, and then pass it through a low-pass filter. As this method is commonly used, GNU Radio provides a Frequency Xlating FIR Filter module to do this. This module shifts the original center point of the signal to a new frequency and performs low-pass filtering with the new frequency as the center to preserve the desired channel signal.
Try modifying the system as follows:
Note the parameter settings for the Frequency Xlating FIR Filter:
- Taps: firdes.low_pass(1, samp_rate, 80e3, 20e3)
- Center Frequency: f-100e6 (note the usage here, which equals the frequency offset)
firdes is a module used by GNU Radio to design FIR filters, and the four parameters of the low_pass function are Gain, Sample Rate, Cutoff Freq, Transition Width.
Simulation results (f value is 100.7 MHz):
The simulation results are consistent with the above results. Using the Frequency Xlating FIR Filter can make the system look neater. However, the drawback is that the adjusted frequency, before passing through the filter, the intermediate signal cannot be pulled out for observation using Frequency Sink.
Exercise 3
Explore the frequency range of 88~108 MHz (common FM band) using the methods mentioned above and estimate how many radio stations are there approximately.