-1
$\begingroup$

I am a beginner and I want to implement a demodulate function that takes in a signal (the received waveform), the number of bits per chunk k, and the length T in seconds of each signal (which is also the fundamental period), and returns the original bitstream.

def int_to_bitstring(n, k):
    n_binary = bin(n)
    n_binary = n_binary[2:]  # bin prepends a 0b, which we don't want
    return n_binary.zfill(k) # prepend with zeros to k bits

def demodulate(signal, k, T):
    """
    Returns the demodulated version of signal using an Orthogonal Signaling scheme
    with k bits per chunk and T second signals. The return value will be the recovered
    bitstring.

    Parameters:
    signal - The received signal.
    k      - The number of bits per chunk. You may assume len(bits) % k == 0, 
             if bits is the original message.
    T      - The duration, in seconds, of each individual modulated chunk.
    """

```
$\endgroup$
  • $\begingroup$ This question is very difficult to understand. Can you provide some explanations about "chunks", the number of bits in the bit string, and what the modulation is? $\endgroup$ – Dilip Sarwate Apr 21 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.