Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detection flag as the output of the decoder #8

Open
pejmanmemar opened this issue Mar 10, 2022 · 4 comments
Open

Detection flag as the output of the decoder #8

pejmanmemar opened this issue Mar 10, 2022 · 4 comments

Comments

@pejmanmemar
Copy link

Hi,

First, I wanted to thank you for this great work. I have a question regarding the possible outputs of the provided decoders. Is it possible to receive a flag that the detection has happened besides the decoded code word? In other words, a flag that shows the decoder could detect the error, and the syndrome was nonzero.

Regards

@rtajan
Copy link
Member

rtajan commented Mar 10, 2022

Hi,

Thank you very much for your interest in our job.

If I understand well your request, what you would like is a socket containing the syndrome after decoding.

I think that this is the purpose of the socket named CWD of decode_siho task for example.

My feeling comes after looking at the code of the decode_siho task for the Decoder_LDPC_BP_flooding decoder here.
CWD is filled with the complement of status and so it is the syndrome computed there.

Maybe @kouchy may have more information about the CWD socket.

Regards

@kouchy
Copy link
Member

kouchy commented Mar 11, 2022

Hi,

I confirm what @rtajan said.

I would advice to use the CWD socket more that the status. It is true that the information is also contained in the status however the CWD socket is more explicit.

Regards

@pejmanmemar
Copy link
Author

Hi

Thank you for your swift reply!
I tried the CWD socket in both decode_hiho and decode_siho. For Reed-Solomon Code, even in case of a corrupted code word, the CWD socket (also status socket) always returns 0. Is there any solution for that?

@Sciroccogti
Copy link

Sciroccogti commented Mar 8, 2024

If you are using custom module like the example below:

class py_modulator(Py_Module):

    # Step 2
    def bpsk(self, b, x): # Your original code (independently from aff3ct)
        x[:] = 1.0 - 2.0*b[:]
        return 0
    
    # Step 3
    def __init__(self, N):
        # __init__ (step 3.1)
        Py_Module.__init__(self) # Call the aff3ct Py_Module __init__
        self.name = "py_BPSK"   # Set your module's name

        # __init__ (step 3.2)
        t_mod = self.create_task("modulate") # create a task for your module
        
        # __init__ (step 3.3)
        sb = self.create_socket_in (t_mod, "b", N, np.int32  ) # create an input socket for the task t_mod
        sx = self.create_socket_out(t_mod, "x", N, np.float32) # create an output socket for the task t_mod
    
        # __init__ (step 3.4)
        self.create_codelet(t_mod, lambda slf, lsk, fid: slf.bpsk(lsk[sb], lsk[sx])) # create codelet

When you change x[:] = 1.0 - 2.0*b[:] into x = 1.0 - 2.0*b[:], x will stay 0 forever and 0 is always returned.

Not sure if this can answer your question, but me myself had stuck in this for hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants