Skip to content

Commit

Permalink
add quad_gain option for QUAD demode
Browse files Browse the repository at this point in the history
  • Loading branch information
baskiton committed Oct 3, 2023
1 parent 8c0b0eb commit 0dc1ad8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ Each frequency object contain:
| ccc_rs_dualbasis | Boolean | _Optional. Only for **CCSDSCC** decoder._ Reed-Solomon Dualbasis. `false` by default |
| ccc_rs_interleaving | Number | _Optional. Only for **CCSDSCC** decoder._ Reed-Solomon Interleaving. `4` by default |
| ccc_derandomize | Boolean | _Optional. Only for **CCSDSCC** decoder._ Descrambling. `true` by default |
| quad_gain | Number | _Optional. Only for **QUAD** mode._ Quadrature demodulation gain. `1.0` by default |


#### modulations
Expand Down
23 changes: 18 additions & 5 deletions sats_receiver/gr_modules/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,19 @@ def _validate_config(config: Mapping) -> bool:

# 'channels', # only for GMSK

# 'sats_file', # optional, only for SATS decode
# 'sats_name', # optional, only for SATS decode
# 'sats_norad', # optional, only for SATS decode
# 'sats_tlm_decode', # optional, only for SATS decode
# 'grs_file', # optional, only for SATS decode
# 'grs_name', # optional, only for SATS decode
# 'grs_norad', # optional, only for SATS decode
# 'grs_tlm_decode', # optional, only for SATS decode

# 'ccc_frame_size' # optional, only for CCSDSCC decode
# 'ccc_pre_deint' # optional, only for CCSDSCC decode
# 'ccc_diff' # optional, only for CCSDSCC decode
# 'ccc_rs_dualbasis' # optional, only for CCSDSCC decode
# 'ccc_rs_interleaving' # optional, only for CCSDSCC decode
# 'ccc_derandomize' # optional, only for CCSDSCC decode

# 'quad_gain', # optional, only for QUAD demode
]))
and (config['mode'] != utils.Mode.QPSK or 'qpsk_baudrate' in config)
and (config['mode'] != utils.Mode.GMSK or 'channels' in config)
Expand Down Expand Up @@ -167,7 +176,7 @@ def __init__(self,
self.connect((self.demodulator, 1), (self.post_demod, 1))

elif self.mode == utils.Mode.QUAD:
self.demodulator = gr.analog.quadrature_demod_cf(1)
self.demodulator = gr.analog.quadrature_demod_cf(self.quad_gain)

elif self.mode in (utils.Mode.QPSK, utils.Mode.OQPSK):
oqpsk = self.mode == utils.Mode.OQPSK
Expand Down Expand Up @@ -333,6 +342,10 @@ def ccc_rs_interleaving(self) -> int:
def ccc_derandomize(self) -> bool:
return self.config.get('ccc_derandomize', True)

@property
def quad_gain(self) -> float:
return self.config.get('quad_gain', 1.0)


class Satellite(gr.gr.hier_block2):
@staticmethod
Expand Down

0 comments on commit 0dc1ad8

Please sign in to comment.