Difference between revisions of "Root Raised Cosine Filter"

From GNU Radio
Jump to navigation Jump to search
(Added section with working example)
(add example flowgraph; revise parameter descriptions)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
[[Category:Block Docs]]
[[Category:Block Docs]]
 
This filter is a convenience wrapper for a FIR filter and a firdes taps generating function.
The most common usage documented in the tutorials and examples is:
 
firdes.root_raised_cosine(nfilts, nfilts, 1.0/float(sps), 0.35, 11*sps*nfilts)
 
        self.rrc_taps = filter.firdes.root_raised_cosine(
            nfilts,          # gain
            nfilts,          # sampling rate based on 32 filters in resampler
            1.0,            # symbol rate
            self._excess_bw, # excess bandwidth (roll-off factor)
            ntaps)
Source: https://github.com/gnuradio/gnuradio/blob/4849af9ad83bc16d21e2c63ab95bab1755289c2f/gr-digital/python/digital/generic_mod_demod.py#L126
 
Note the sampling rate is not the sample_rate in the .grc file
 
Numerous block diagrams in this wiki use this block, unfortunately none of those examples include a .grc file so their usage is a mystery. However, the above form us used in the PSK tutorial and several other tutorials and examples. I could not find nor create a working example that conforms to the next section. Discussion from someone else's attempt: https://lists.gnu.org/archive/html/discuss-gnuradio/2018-05/msg00274.html
 
Another common usage is:
 
taps = filter.firdes.root_raised_cosine(nfilts, nfilts * sps, 1.0, excess_bw, 11*sps*nfilts)
 
as in https://github.com/gnuradio/gnuradio/blob/94d52b9ac28739a4b9ddf1a66c45d0bf5ea19e87/gr-digital/python/digital/qa_pfb_clock_sync.py
 
----
 
This filter is a convenience wrapper for an 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
: Symbol rate, must be a factor of sample rate. Typically ((samples/second) / (samples/symbol)).


; Alpha (''R'')
; Alpha (''R'')
: Excess bandwidth factor
: Excess bandwidth factor, also known as alpha. (default: 0.35)


; Num Taps (''R'')
; Num Taps (''R'')
: Number of taps
: Number of taps (default: 11*samp_rate)


== 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, unfortunatelyThe 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.
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 16:32, 4 March 2021

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

Parameters[edit]

(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)
Symbol rate, must be a factor of sample rate. Typically ((samples/second) / (samples/symbol)).
Alpha (R)
Excess bandwidth factor, also known as alpha. (default: 0.35)
Num Taps (R)
Number of taps (default: 11*samp_rate)

Example Flowgraph[edit]

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[edit]

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