From c958eaf7ef1fa56536f718d7e8d1654d37a93955 Mon Sep 17 00:00:00 2001 From: David Protzman Date: Fri, 8 Apr 2022 17:50:57 -0400 Subject: [PATCH] Added warning for Octave users --- matlab/automatic_detector.m | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/matlab/automatic_detector.m b/matlab/automatic_detector.m index 6a538bb..307d477 100644 --- a/matlab/automatic_detector.m +++ b/matlab/automatic_detector.m @@ -233,8 +233,18 @@ for idx=0:3 % The constellations are setup with points at (1,1), (-1,1), (-1,-1), and (1,-1) which % for MATLAB is a pi/4 QPSK. % Using Gray coding as it's the most likely coding (but I don't know if that's true for LTE) + + % WARNING: This logic will explode in Octave. Octave outputs symbols, not bits. So a demapping is + % needed. Example: `demodulated_bits` will have something like [1, 0, 3, 2, 2,...] + % But in MATLAB it's all binary (gets unpacked automatically) + % I'll have to poke around to figure out a way to make MATLAB and Octave match here demodulated_bits = pskdemod(data_carriers, 4, pi/4, 'gray', ... 'OutputType', 'bit', 'PlotConstellation', false); + + if (exist('OCTAVE_VERSION', 'builtin')) + % TODO(8April2022): Find a way to demap in Octave that matches MATLAB + warning("The output you are about to see is packed symbols. The key add is going to be wrong!") + end % Try all 4 scrambler possibilities xor_out = [