Root Raised Cosine Filter: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
No edit summary
No edit summary
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:Block Docs]]
[[Category:Block Docs]]
This filter is a convenience wrapper for an fir filter and a firdes taps generating function.
The '''Root Raised Cosine Filter''' blocks acts as a matched filter. Its primarily purpose is extracting a known digital signal out of noise; it does this more effectively than a low-pass filter, squelch, or other blocks.
 
[[File:Matched_Filter_Total_System.jpg|881px|thumb|right|Root Raised Cosine Filter implements match filtering to pull square pulses out of an channel containing artificial Gaussian white noise.]]
 
This filter is a convenience wrapper for a FIR filter and a firdes taps generating function.


== Parameters ==
== Parameters ==
(''R''): <span class="plainlinks">[https://wiki.gnuradio.org/index.php/GNURadioCompanion#Variable_Controls ''Run-time adjustable'']</span>
(''R''): <span class="plainlinks">[https://wiki.gnuradio.org/index.php/GNURadioCompanion#Variable_Controls ''Run-time adjustable'']</span>


; Decimation
; FIR Type
: Description of parameter, provide any tips or recommended values.  Note that the name of the parameter above should match the param's label that shows up in grc (e.g. Sample Rate).
: options: [Complex->Complex (Decimating), Complex->Complex (Interpolating), Float->Float (Decimating), Float->Float (Interpolating)]
 
; Decimation or Interpolation
: decimation or interpolation factor (depending on which type is chosen above).


; Gain (''R'')
; Gain (''R'')
: Overall gain of filter (typically 1.0)
: Overall gain of filter (default 1.0)


; Sample Rate (''R'')
; Sample Rate (''R'')
: Sample rate in Hertz.
: Sample rate in samples per second.


; Symbol Rate (''R'')
; Symbol Rate (''R'')
: Symbol rate, must be a factor of sample rate
: The baud rate. The RRCF seems to work best setting this parameter to ''baud_rate * 2''


; Alpha (''R'')
; Alpha (''R'')
: Excess bandwidth factor
: Excess bandwidth factor, also known as alpha. (default: 0.35) With a very small alpha, say 0.001, the RRCF block produces sinusoidal-shaped symbols and culls more noise, whereas a large alpha produces more flat-topped symbols.


; Num Taps (''R'')
; Num Taps (''R'')
: Number of taps
: Number of taps. This defaults to <code>11*samp_rate</code>, but this default is not actually in the code and such a default produces extremely high CPU costs. If the number of samples per symbol is known, a better default would be <code>working_sps * num_symbols</code> which allows the filter to rolloff across <code>num_symbols</code> on either side. Its often handy to work with a small number of samples/symbol, say 8, and a reasonable rolloff for <code>num_symbols</code> may be 32, in which case Num Taps is quite small and thus the RRCF block consumes fewer CPU resources. Experiment with this number to find a useful range for the filter in your situation. Note that the number of generated filter coefficients will be <code>num_taps + 1</code>.


== Example Flowgraph ==
== Example Flowgraph ==


Insert description of flowgraph here, then show a screenshot of the flowgraph and the output if there is an interesting GUI. Currently we have no standard method of uploading the actual flowgraph to the wiki or git repo, unfortunately. The plan is to have an example flowgraph showing how the block might be used, for every block, and the flowgraphs will live in the git repo.
=== Frequency-Shift Keying ===
 
If you have demodulated Frequency-Shift Keying signal using a [[Quadrature Demod]] block, and you know the baud rate of the signal, and thus the duration of each symbol, the RRCS is useful for pulling these symbols out of the noise. In the process, the RRCS generates sinusoidal waves in place of the original square-wave symbols, rising from and falling to 0 and peaking at the center of each symbol. This result is extremely advantageous for clock recovery, as blocks like [[Symbol Sync]] need to lock onto the center of each symbol in order to reliably extract bits. The RRCS accomplishes both steps at once.
 
In the below example, the RRCF performs match filtering against a Frequency-Shift Keying signal. No noise has been introduced in this example; it just isolates the narrow channel containing the signal, demodulates it, and then performs match filtering. In this example, Symbol Rate is set to <code>baud_rate * 2</code>.
 
<gallery mode="packed">
File:RRCF_flowgraph.png|An example flowgraph of this block, demonstrating how the RRCF implements a match filter against the demodulated FSK signal.
File:RRCF_example.png|The RRCF isolates the square-wave symbols and produces sinusoidal waves, peaking in the center of each symbol.
</gallery>
 
=== Waveform Shaping ===
 
This flowgraph can be found at [https://github.com/duggabe/gr-morse-code-gen/blob/master/MorseGen_xmt.grc].  Two Root Raised Cosine Filters in series produce a Raised Cosine Filter which is used for keying waveform shaping, thereby reducing key clicks.
 
[[File:MorseGen_xmt_fg.png|800px]]


== Source Files ==
== Source Files ==


; C++ files
; C++ files
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/master/gr-filter/lib/firdes.cc]


; Header files
; Header files

Latest revision as of 15:28, 4 April 2023

The Root Raised Cosine Filter blocks acts as a matched filter. Its primarily purpose is extracting a known digital signal out of noise; it does this more effectively than a low-pass filter, squelch, or other blocks.

Root Raised Cosine Filter implements match filtering to pull square pulses out of an channel containing artificial Gaussian white noise.

This filter is a convenience wrapper for a FIR filter and a firdes taps generating function.

Parameters

(R): Run-time adjustable

FIR Type
options: [Complex->Complex (Decimating), Complex->Complex (Interpolating), Float->Float (Decimating), Float->Float (Interpolating)]
Decimation or Interpolation
decimation or interpolation factor (depending on which type is chosen above).
Gain (R)
Overall gain of filter (default 1.0)
Sample Rate (R)
Sample rate in samples per second.
Symbol Rate (R)
The baud rate. The RRCF seems to work best setting this parameter to baud_rate * 2
Alpha (R)
Excess bandwidth factor, also known as alpha. (default: 0.35) With a very small alpha, say 0.001, the RRCF block produces sinusoidal-shaped symbols and culls more noise, whereas a large alpha produces more flat-topped symbols.
Num Taps (R)
Number of taps. This defaults to 11*samp_rate, but this default is not actually in the code and such a default produces extremely high CPU costs. If the number of samples per symbol is known, a better default would be working_sps * num_symbols which allows the filter to rolloff across num_symbols on either side. Its often handy to work with a small number of samples/symbol, say 8, and a reasonable rolloff for num_symbols may be 32, in which case Num Taps is quite small and thus the RRCF block consumes fewer CPU resources. Experiment with this number to find a useful range for the filter in your situation. Note that the number of generated filter coefficients will be num_taps + 1.

Example Flowgraph

Frequency-Shift Keying

If you have demodulated Frequency-Shift Keying signal using a Quadrature Demod block, and you know the baud rate of the signal, and thus the duration of each symbol, the RRCS is useful for pulling these symbols out of the noise. In the process, the RRCS generates sinusoidal waves in place of the original square-wave symbols, rising from and falling to 0 and peaking at the center of each symbol. This result is extremely advantageous for clock recovery, as blocks like Symbol Sync need to lock onto the center of each symbol in order to reliably extract bits. The RRCS accomplishes both steps at once.

In the below example, the RRCF performs match filtering against a Frequency-Shift Keying signal. No noise has been introduced in this example; it just isolates the narrow channel containing the signal, demodulates it, and then performs match filtering. In this example, Symbol Rate is set to baud_rate * 2.

Waveform Shaping

This flowgraph can be found at [1]. Two Root Raised Cosine Filters in series produce a Raised Cosine Filter which is used for keying waveform shaping, thereby reducing key clicks.

MorseGen xmt fg.png

Source Files

C++ files
[2]
Header files
TODO
Public header files
Taps creation
Filter definition
Block definition
[3]