Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.0%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: moriglia
  • License: gpl-3.0
  • Language: Cython
  • Default Branch: main
  • Size: 123 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Created almost 2 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

QAM Reconciliation

DOI

Reverse Reconciliation Softening experimental code.

Library

The library contains mainly 3 parts: 1. a syndrome decoder 2. a noise mapper 3. some functions for the evaluation of mutual information

Compilation

Either with setuptools by the command bash python3 setup.py build_ext --inplace [--only SUBMODULE_NAME] or by make

Usage without installation

In order to use this code you have to add the project root to Python's search path, either by export PYTHONPATH=$PYTHONPATH:/root/to/this/directory or by running every command with bash PYTHONPATH=$PYTHONPATH:/path/to/this/directory python3 your_script.py [--your SCRIPT -s ARGUMENTS]

In your script you can import the extension classes for your simulations or experiments.

```python from qamreconciliation import Matrix, Decoder, NoiseMapper, PAMAlphabet import pandas as pd import numpy as np

df = pd.read_csv("code.csv") """ let's assume "code.csv" has 2 columns "vid","cid" 0,0 0,2 2,9 ... where each line represents an edge between variable node "vid" and checknode "cid" """

Create LDPC decoder

decoder = Decoder(df["vid"].tonumpy(), df["cid"].tonumpy()) matrix = Matrix(df["vid"].tonumpy(), df["cid"].tonumpy())

Create alphabet

bps = 2 # bit per symbol step = 2 # constellation step probabilities = np.array([0.15, 0.35, 0.35, 0.15], dtype=np.double) pa = PAMAlphabet(bps, step, probabilities)

Create noise mapper

SNRdB = 2 N0 = pa.variance * 10**(-SNRdB/10.0) nm = NoiseMapper(pa, N0/2)

Frame parameters

N = decoder.vnum # number of variable nodes K = N - decoder.cnum # number of information bits N_symb = N / bps

Alice generates random symbols

xi = pa.randomsymbols(Nsymb) # index of constellation symbol x = np.array(pa.indextovalue(xi)) # np.array is necessary because it outputs a TypedMemoryView

Bob receives noisy symbols

y = x + np.sqrt(N0/2)*np.random.randn(Nsymb) xhati = nm.harddecideindex(y) # decided symbols word = pa.demapsymbolstobits(xhati)

Bob generates the softening metric and the syndrome

n = nm.mapnoise(y, xhati) ## softening metric synd = mat.evalsyndrome(word)

Alice uses her symbols to build the LLR for Bob's decisions

exploiting the softening metric

llr = nm.demaplapprarray(n, x_i)

Finally Alice decodes...

maxiterations = 50 (success, iterations, finallappr) = decoder.decode(llr, synd, max_iterations)

print(success, iterations)

count post-error-correction errors

errorcount = 0 for i in range(K): # Only on the information bits if ((word[i]==0) ^ (finallappr[i]>0)): errorcount += 1 print(errorcount)

```

Simulation script

The project is shipped with a simulation script sims/sim_reconciliation.py which has different parameters. It can be invoked without adding the project root folder to Python's path just by calling it as a submodule bash python3 -m sims.sim_reconciliation -h The script accepts a few options to tweak the simulations: ``` $ python3 -m sims.sim_reconciliation -h usage: decode [-h] [--out OUT] [--maxiter MAXITER] [--ferr-count-min FERRCOUNTMIN] [--alpha ALPHA] [--simloops SIMLOOPS] [--snr SNR SNR] [--nsnr NSNR] [--bps BPS] [--hard] [--direct] [--configuration-base] edgefile

Evaluate BER for LDPC codes vs Raw BER

positional arguments: edgefile CSV with a 'vid' and a 'cid' columns representing an edge per line

options: -h, --help show this help message and exit --out OUT --maxiter MAXITER Maximum number of iterations for the decoder --ferr-count-min FERRCOUNTMIN Minimum number of frame errors for early exit --alpha ALPHA Extra multiplicative coefficient for the LLR --simloops SIMLOOPS Number of frames per SNR point --snr SNR SNR Initial and final SNR [dB] values of the range to evaluate the BER at --nsnr NSNR Number of equally spaced SNR [dB] points to evaluate the BER at --bps BPS Bit Per Symbol (=log_2(PAM Order)) --hard Simulate hard reverse reconciliation --direct Simulate the soft direct reconciliation, overrides '--hard' --configuration-base Instead of the Alternating configuration, use the Base configuration ```

This script outputs a CSV file with the following columns: 1. "EsN0dB" : SNR in dB 2. "ber" : Bit Error Rate 3. "fer" : Frame Error Rate 4. "iters" : average number of iterations to successfully decode a frame

License

Any source file without an explicit license is distributed under version 3 of the GNU General Public License. You may share and distribute such code with the same version of the license or, at your option, any later version.

A copy of the license is distributed in the COPYING file of the root project.

Owner

  • Name: Marco Origlia
  • Login: moriglia
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.1.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Origlia"
  given-names: "Marco"
  orcid: "https://orcid.org/0000-0003-4901-4350"
title: "Reverse Reconciliation Softening in Cython"
version: vSCC2025
doi: 10.5281/zenodo.13982982
date-released: 2024-10-23
url: "https://github.com/moriglia/qam-reconciliation/releases/tag/vSCC2025"

GitHub Events

Total
  • Release event: 1
  • Public event: 1
  • Push event: 3
Last Year
  • Release event: 1
  • Public event: 1
  • Push event: 3

Dependencies

setup.py pypi