It is not typical to transmit rectangular pulses as it results in a much wider spectrum than is necessary, resulting in poor spectrum efficiency and more susceptibility to group delay distortion across the bandwidth.

Assuming that is not an issue (and I don't actually see that the OP's resulting waveform is distorted to the point where a simple demodulation can't be performed) then squaring the signal for carrier recovery would be doable for the OP's case. The resulting squared signal does have a lot of amplitude variation, but notably will have a much stronger and well defined second harmonic (that would be very clear by evaluating the FFT of the squared output). The job to complete carrier recovery is to filter 2nd harmonic output and then divide the resulting signal by two. A common approach for filtering with such "squaring loops" is to phase lock a clean 2nd harmonic oscillator. This is effectively what becomes a very narrow auto-tuning bandpass filter (where-as a fixed filter would fail if the carrier offset exceeded the fixed bandwidth).  

Another approach that is ultimately more compact (and more common) is a "Costas Loop" as shown in the diagram below. This can be implemented in the analog domain with a Voltage Controlled Oscillator (VCO) as shown, or as a direct digital loop using an Numerically Controlled Oscillator (NCO). 

[![BPSK Costas Loop][1]][1]

I detail the NCO operation in [DSP.SE #37803][2]. Observe how we can extend the Costas Loop to QPSK (and QAM if we change the decision blocks from two-level as shown below for QPSK, to instead be multi-level as needed for QAM): 

[![enter image description here][3]][3]

A complete digital implementation for BPSK, QPSK and QAM showing the loop filter as a "PI Loop Filter", and the NCO as a counter with a sine and cosine lookup table (which in a simulation the counter output is scaled be phase as $2\pi n/N$ with $n=0,1, \ldots N-1$, and the lookup tables are a computation of the I and Q outputs as $I+jQ = e^{j\phi}$.)

[![QAM demodulator][4]][4]

*Like what you see? These details are part of my online course "DSP for Software Radio" course where I bring practical DSP together with intuition for a deeper and more creative understanding of signal processing concepts. You can find the latest course listings at https://dsprelated.com/courses and https://ieeeboston.org/courses/ .  Other DSP courses are starting this month (April 18 and April 25 2024)!*


  [1]: https://i.sstatic.net/QpL5r.png
  [2]: https://dsp.stackexchange.com/questions/37803/numerically-controlled-oscillator-nco-for-phasor-implementation/37804#37804
  [3]: https://i.sstatic.net/ZmHyQ.png
  [4]: https://i.sstatic.net/6KBD5.png