pub struct Receiver { /* private fields */ }Expand description
A detector applied channel use after channel use (see the module).
Implementations§
Source§impl Receiver
impl Receiver
Sourcepub fn new(kind: DetectorKind, c: Constellation, llr: bool) -> Result<Receiver>
pub fn new(kind: DetectorKind, c: Constellation, llr: bool) -> Result<Receiver>
The receiver of the detector kind for the alphabet c, with bit LLRs if llr.
§Errors
Error::Config when LLRs are asked from a detector without soft output, or for
a detector that cannot be built (DetectorKind::detector).
Sourcepub fn constellation(&self) -> &Constellation
pub fn constellation(&self) -> &Constellation
The alphabet of every stream.
Sourcepub fn layers(
&self,
h: &ArrayView2<'_, C64>,
y: &[C64],
noise_var: f64,
out: &mut SoftOutput,
) -> Result<()>
pub fn layers( &self, h: &ArrayView2<'_, C64>, y: &[C64], noise_var: f64, out: &mut SoftOutput, ) -> Result<()>
Detect the layers of one channel use $y = H x + w$ and append them to out.
§Errors
The errors of the detector.
Sourcepub fn detect_uses<I, H, Y>(
&self,
uses: I,
alamouti: bool,
noise_var: f64,
channel: H,
received: Y,
out: &mut SoftOutput,
) -> Result<()>
pub fn detect_uses<I, H, Y>( &self, uses: I, alamouti: bool, noise_var: f64, channel: H, received: Y, out: &mut SoftOutput, ) -> Result<()>
Detect the channel uses uses in turn and append them to out: use i has the
channel channel(i) ($n_{r} \times n_{t}$) and the received vector
received(i) ($n_{r}$); with alamouti, the pairs of consecutive uses carry the
blocks of Alamouti’s code, detected with the channel of the first use of the pair
(Receiver::decode_alamouti), otherwise every use carries one vector of layers
(Receiver::layers).
§Errors
The errors of channel and of the detector; Error::Shape for an odd number of
uses with Alamouti’s code.
§Examples
use comnum_mimo::receiver::{DetectorKind, Receiver, SoftOutput};
use comnum_mapping::constellation::Constellation;
use comnum_math::{C64, linalg::identity};
let c = Constellation::qam(4)?.normalized();
let rx = Receiver::new(DetectorKind::Zf, c.clone(), false)?;
let x: Vec<Vec<C64>> = (0..3).map(|i| vec![c.points()[i], c.points()[3 - i]]).collect();
let mut out = SoftOutput::default();
rx.detect_uses(0..3, false, 1e-3, |_| Ok(identity(2)), |i| x[i].clone(), &mut out)?;
assert!(out.symbols.iter().zip(x.concat()).all(|(a, b)| (a - b).norm() < 1e-12));Sourcepub fn decode_alamouti(
&self,
h: &ArrayView2<'_, C64>,
y: &ArrayView2<'_, C64>,
noise_var: f64,
out: &mut SoftOutput,
) -> Result<()>
pub fn decode_alamouti( &self, h: &ArrayView2<'_, C64>, y: &ArrayView2<'_, C64>, noise_var: f64, out: &mut SoftOutput, ) -> Result<()>
Decode one block of Alamouti’s code (the two channel uses are the columns of y,
$n_{r} \times 2$) and append its two symbols to out.
§Errors
The errors of Ostbc::decode.