Costas Loop: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
(Created page with "Category:Block Docs Category:Stub Docs This is the template for the "Page-per-block Docs". This first section should describe what the block...")
 
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:Block Docs]]
[[Category:Block Docs]]
[[Category:Stub Docs]]
A Costas loop carrier recovery module, great for synchronizing to BPSK, QPSK, and 8PSKThe Costas loop locks to the center frequency of a signal and downconverts it to baseband.
This is the template for the [[:Category:Block_Docs|"Page-per-block Docs"]]This first section should describe what the block does and how to use it, using however many paragraphs necessary. Note that the title of the wiki page should match the block's name in GRC, i.e. the one defined in the block's .grc file. Look at the [[FFT]] Block for a good example.
* When order=2: used for BPSK where the real part of the output signal is the baseband BPSK signal and the imaginary part is the error signal.
* When order=4: can be used for QPSK where both I and Q (real and imaginary) are output.
* When order=8: used for 8PSK.


As this is a basic template, it's also in the [[:Category:Stub_Docs|"Stub Docs category"]]. Please improve it.
The Costas loop can have two output streams:
# stream 1 (required) is the baseband I and Q;
# stream 2 (optional) is the normalized frequency of the loop
 
There is a single optional message input for a noise floor estimate used to calculate the SNR of a sample.
 
The block uses 'phase_est' tag generated by the [[Correlation Estimator]]. This helps to correct the phase offset which is crucial for synchronization process.
 
More details can be found online:
 
J. Feigin, "Practical Costas loop design: Designing a simple and inexpensive BPSK Costas loop carrier recovery circuit," RF signal processing, pp. 20-36, 2002.


== 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>


; Param 1 (''R'')
; Loop Bandwidth (''R'')
: 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).
: Internal 2nd order loop bandwidth (~ 2pi/100)
 
; Order
: The loop order, either 2, 4, or 8, see above.


; Param 2
; Use SNR
: blah blah blah
: Use or ignore SNR estimates (from noise message port) in measurements; also uses tanh instead of slicing.


== 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.
See [[QPSK_Mod_and_Demod#Phase_and_Frequency_Correction]]


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


; C++ files
; C++ files
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-digital/lib/costas_loop_cc_impl.cc costas_loop_cc_impl.cc]


; Header files
; Header files
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-digital/lib/costas_loop_cc_impl.h costas_loop_cc_impl.h]


; Public header files
; Public header files
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-digital/include/gnuradio/digital/costas_loop_cc.h costas_loop_cc.h]


; Block definition
; Block definition
: [https://github.com/gnuradio/gnuradio TODO]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-digital/grc/digital_costas_loop_cc.block.yml digital_costas_loop_cc.block.yml]

Latest revision as of 15:02, 9 December 2023

A Costas loop carrier recovery module, great for synchronizing to BPSK, QPSK, and 8PSK. The Costas loop locks to the center frequency of a signal and downconverts it to baseband.

  • When order=2: used for BPSK where the real part of the output signal is the baseband BPSK signal and the imaginary part is the error signal.
  • When order=4: can be used for QPSK where both I and Q (real and imaginary) are output.
  • When order=8: used for 8PSK.

The Costas loop can have two output streams:

  1. stream 1 (required) is the baseband I and Q;
  2. stream 2 (optional) is the normalized frequency of the loop

There is a single optional message input for a noise floor estimate used to calculate the SNR of a sample.

The block uses 'phase_est' tag generated by the Correlation Estimator. This helps to correct the phase offset which is crucial for synchronization process.

More details can be found online:

J. Feigin, "Practical Costas loop design: Designing a simple and inexpensive BPSK Costas loop carrier recovery circuit," RF signal processing, pp. 20-36, 2002.

Parameters

(R): Run-time adjustable

Loop Bandwidth (R)
Internal 2nd order loop bandwidth (~ 2pi/100)
Order
The loop order, either 2, 4, or 8, see above.
Use SNR
Use or ignore SNR estimates (from noise message port) in measurements; also uses tanh instead of slicing.

Example Flowgraph

See QPSK_Mod_and_Demod#Phase_and_Frequency_Correction

Source Files

C++ files
costas_loop_cc_impl.cc
Header files
costas_loop_cc_impl.h
Public header files
costas_loop_cc.h
Block definition
digital_costas_loop_cc.block.yml