Frequency Xlating FIR Filter: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
No edit summary
m (→‎Example 1: change from italics to code)
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:Block Docs]]
[[Category:Block Docs]]
This block performs a frequency translation on the signal, as well as downsamples the signal by running a decimating FIR filter on it. It can be used as a channelizer, to pull out a narrowband portion of a wideband signal, without that narrowband portion having to be centered in frequency.
The '''Frequency Translating Finite Impulse Response Filter''' block performs a frequency translation on the signal and simultaneously downsamples the signal via a decimating FIR filter. The main use of this block is an effective channelizer, to pull out a narrowband portion of a wideband signal, without that narrowband portion having to be centered in frequency. Channelization in this manner is particularly useful for Software Defined Radios (SDRs) that capture a wide bandwidth via a very high sampling rate, yet the desired signal only occupies a narrow slice of bandwidth.


[[File:freq-xlating-filter.png|250px]]
[[File:freq-xlating-filter.png|250px|right]]


(note- taken from http://blog.sdr.hu/grblocks/xlating-fir.html)
This block does not support C++ output, so it cannot be used when the output language of a flowgraph in GRC is C++.


See [http://blog.sdr.hu/grblocks/xlating-fir.html this page] or [http://www.andrej-mohar.com/frequency-xlating-fir-filter-and-channeling-basics-in-gnuradio this page] for more details.
See [http://blog.sdr.hu/grblocks/xlating-fir.html this page] for more details.


== Parameters ==
== Parameters ==
Line 26: Line 26:
; Sample Rate
; Sample Rate
: The sample rate of the input signal.
: The sample rate of the input signal.
== Example Flowgraph ==
=== Example 1 ===
Since sampling rate is mathematically correlated to the captured bandwidth via the Nyquist–Shannon sampling theorem, this block can safely downsample while isolating a narrow signal. This makes the block operationally identical to a series of Rotator, Bandpass, and Rational Resampler blocks, except the Frequency Xlating FIR Filter block does all these steps at once much more efficiently. So if your SDR is delivering I/Q samples at 2.56 million samples/second, but your Frequency-Shift Keying signal is 20 kHz wide, you can use the block to downsample to a minimum of 40 kS/s, saving substantial CPU resources in future processing steps. In practice though, it is often handy to use a higher-than-minimum sampling rate; this gives you extra samples that can be used for filter roll-off, averaged out to help pull a pulse signal out of noise, or for other purposes.
<gallery mode="packed">
File:Freq_Xlating_FIR_Filter_flowgraph.png|An example flowgraph of this block to isolate a narrow signal from within a wideband capture file.
File:Freq_Xlating_FIR_Filter_example.png|The Frequency Translating FIR Filter in practice.
</gallery>
In the above example, Taps is set to <code>firdes.band_pass(1.0, samp_rate, fsk_deviation/2 - bandpass_filter_width, fsk_deviation/2 + bandpass_filter_width, bandpass_filter_width)</code>, Center Frequency is set to <code>recording_offset + (fsk_deviation / 2)</code> and Sampling Rate is set to <code>samp_rate</code>. Due to the decimation factor of 2, the sampling rate on the output is now half.
=== Example 2 ===
This flowgraph uses the Frequency Xlating FIR Filter block to center Frequency Shift Keying tones around zero. Then a Quadrature Demod block can detect the high and low tones as positive or negative values. This decodes RTTY.
[[File:RTTY_rcv.png|800px]]
== Source Files ==
; C++ files
: [https://github.com/gnuradio/gnuradio/blob/main/gr-filter/lib/freq_xlating_fir_filter_impl.cc freq_xlating_fir_filter_impl.cc]
; Header files
: [https://github.com/gnuradio/gnuradio/blob/main/gr-filter/lib/freq_xlating_fir_filter_impl.h freq_xlating_fir_filter_impl.h]
; Block definition
: [https://github.com/gnuradio/gnuradio/blob/main/gr-filter/grc/filter_freq_xlating_fir_filter_xxx.block.yml filter_freq_xlating_fir_filter_xxx.block.yml]

Latest revision as of 21:56, 1 March 2023

The Frequency Translating Finite Impulse Response Filter block performs a frequency translation on the signal and simultaneously downsamples the signal via a decimating FIR filter. The main use of this block is an effective channelizer, to pull out a narrowband portion of a wideband signal, without that narrowband portion having to be centered in frequency. Channelization in this manner is particularly useful for Software Defined Radios (SDRs) that capture a wide bandwidth via a very high sampling rate, yet the desired signal only occupies a narrow slice of bandwidth.

Freq-xlating-filter.png

This block does not support C++ output, so it cannot be used when the output language of a flowgraph in GRC is C++.

See this page for more details.

Parameters

Decimation
The integer ratio between the input and the output signal’s sampling rate.
Taps
The vector of the complex or real taps of the FIR filter. You can generate these taps within the parameter box using firdes, for example:
Real taps:
 firdes.low_pass(1,samp_rate,samp_rate/(2*decimation), transition_bw)
Complex taps:
 firdes.complex_band_pass(1, samp_rate, -samp_rate/(2*decimation), samp_rate/(2*decimation), transition_bw)
Note: transition_bw is the transition bandwidth of the filter in Hz. The lower it is, the more taps the function will generate, and the more CPU time it will take to apply this filter. This parameter will determine the CPU usage and thus the execution speed of the block.
Center Frequency
The frequency translation offset frequency.
Sample Rate
The sample rate of the input signal.

Example Flowgraph

Example 1

Since sampling rate is mathematically correlated to the captured bandwidth via the Nyquist–Shannon sampling theorem, this block can safely downsample while isolating a narrow signal. This makes the block operationally identical to a series of Rotator, Bandpass, and Rational Resampler blocks, except the Frequency Xlating FIR Filter block does all these steps at once much more efficiently. So if your SDR is delivering I/Q samples at 2.56 million samples/second, but your Frequency-Shift Keying signal is 20 kHz wide, you can use the block to downsample to a minimum of 40 kS/s, saving substantial CPU resources in future processing steps. In practice though, it is often handy to use a higher-than-minimum sampling rate; this gives you extra samples that can be used for filter roll-off, averaged out to help pull a pulse signal out of noise, or for other purposes.

In the above example, Taps is set to firdes.band_pass(1.0, samp_rate, fsk_deviation/2 - bandpass_filter_width, fsk_deviation/2 + bandpass_filter_width, bandpass_filter_width), Center Frequency is set to recording_offset + (fsk_deviation / 2) and Sampling Rate is set to samp_rate. Due to the decimation factor of 2, the sampling rate on the output is now half.

Example 2

This flowgraph uses the Frequency Xlating FIR Filter block to center Frequency Shift Keying tones around zero. Then a Quadrature Demod block can detect the high and low tones as positive or negative values. This decodes RTTY.

RTTY rcv.png

Source Files

C++ files
freq_xlating_fir_filter_impl.cc
Header files
freq_xlating_fir_filter_impl.h
Block definition
filter_freq_xlating_fir_filter_xxx.block.yml