Search code examples
matlabsignal-processingfpgasimulinkxilinx

DBPSK Demodulation in Simulink using Xilinx blockset


I am trying to build a DBPSK demodulator using Simulink and Xilinx blockset. I calculate the Phase Difference of the Successive samples like this : enter image description here

So, now I need to map these Phase Difference to Symbol 0 or 1 depending on whether the Phase difference is 0 or pi.

% ----------------------------------------
% | Bit input   |   Phase change (+j*pi) |
% ----------------------------------------
% |     0       |       0                |
% ----------------------------------------
% |     1       |       pi               |
% ----------------------------------------

I am not sure how I can do Phase to Symbol mapping in Simulink(Xilinx). BTW, here is the Matlab version :

demod_symbol=abs(round(DBPSK_Signal/pi));
for i=1:length(demod_symbol)
        if(demod_symbol(i)==2)
            demod_symbol(i)=0;
        end
end

Please let me know, if my approach is correct and how to proceed further


Solution

  • Take the output of your subtractor and feed it to a "greater-than" compare block with the other input set to pi/2. The output of that will be the bit you need.

    Be aware, you'll be creating quite a lot of logic in those atan blocks - there's almost definitely a more efficient way of doing this, but it doesn't spring to mind right at this minute.