https://www.mathworks.com/help/comm/ref/dpskdemod.html
dpskdemod - Differential phase shift keying demodulation - MATLAB
This MATLAB function demodulates the complex envelope, y, of a DPSK-modulated signal having modulation order M.
phase shift keyingdifferentialdemodulationmatlab