Skip to content
Snippets Groups Projects
Commit 9cb7740b authored by Jan David Mol's avatar Jan David Mol
Browse files

Merge branch 'minor-enhancement-frequency-bands' into 'master'

Minor enhancement frequency bands

See merge request !961
parents ad254c3c a777ad1c
No related branches found
No related tags found
1 merge request!961Minor enhancement frequency bands
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
from dataclasses import dataclass from dataclasses import dataclass
from .constants import CLK_160_MHZ, CLK_200_MHZ from .constants import CLK_160_MHZ, CLK_200_MHZ
from .sdp import subband_frequency, are_subbands_decreasing
@dataclass(frozen=True) @dataclass(frozen=True)
...@@ -37,6 +38,17 @@ class Band: ...@@ -37,6 +38,17 @@ class Band:
# return first match # return first match
return matching_bands[0].name return matching_bands[0].name
@property
def spectral_inversion(self) -> bool:
"""Whether the spectrum is inverted, and thus should be inverted back by SDP."""
return are_subbands_decreasing(self.nyquist_zone, False)
def subband_frequency(self, subband: int) -> float:
"""The central frequency of the given subband index, if SDP is configured accordingly."""
return subband_frequency(
subband, self.clock, self.nyquist_zone, self.spectral_inversion
)
# Global list of all supported frequency bands # Global list of all supported frequency bands
bands = {} bands = {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment