0

I am currently working on my Android-based application capstone project, where I have integrated two decoders: the SSTV (Slow-Scan Television) decoder and the AFSK (Audio Frequency-Shift Keying) decoder. The SSTV decoder processes images received via audio signals, while the AFSK decoder processes data transmitted using audio frequency shifts and decodes it into text.

My goal is to have both decoders function simultaneously within the application. However, during testing, only the SSTV decoder seems to work correctly, while the AFSK decoder does not produce the expected results. I have attempted to call the decoders asynchronously, but it did not resolve the issue.

Below is how I call the AFSK decoder function where I target and work it as the decoder for text side

private void startAFSKDecoder() {
    new Thread(() -> {
        // Initialize the AFSK_Decoder instance
        AFSK_Decoder afskDecoder = new AFSK_Decoder(this);

        // Call the method to start decoding with specific mark and space frequencies
        double markFrequency = 1200.0; // Frequency of the "1" bit in Hz
        double spaceFrequency = 2200.0; // Frequency of the "0" bit in Hz
        afskDecoder.startDecoding(markFrequency, spaceFrequency); // This is called out because the structure of the code is on another .java 
    }).start();
}

Below is the SSTV(Robot36 mode) method is called ( This method is working and actively decoding transmission of image)

protected void startDecoder() { // Decoder For SSTV
    if (decoder != null)
        return;
    if (!permissionsGranted())
        return;
    try {
        decoder = new Decoder(this,
                findViewById(R.id.spectrum),
                findViewById(R.id.spectrogram),
                findViewById(R.id.image),
                findViewById(R.id.meter)
        );
        image.setVisibility(View.VISIBLE);
        decoder.enable_analyzer(enableAnalyzer);
        
        showNotification();
        updateMenuButtons();

    } catch (Exception e) {
        showErrorMessage(getString(R.string.decoder_error), e.getMessage());
    }
}

However, the afsk decoder does not work.

I would appreciate any guidance or suggestions on how to make the two decoders work synchronously so that both the SSTV and AFSK decoding processes can function properly in my application. Thank you for your assistance.

0 Answers0