# How to prevent clipping on LimeSDR Mini?

**URL:** <https://discourse.myriadrf.org/t/how-to-prevent-clipping-on-limesdr-mini/8351>\
**Category:** LimeSDR\
**Created:** [21 June 2024 19:32 UTC](https://discourse.myriadrf.org/t/how-to-prevent-clipping-on-limesdr-mini/8351 "2024-06-21T19:32:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Orange](https://avatars.discourse-cdn.com/v4/letter/o/65b543/32.png) [@Orange](https://discourse.myriadrf.org/u/Orange)\
**Post date:** [21 June 2024 19:32 UTC](https://discourse.myriadrf.org/t/how-to-prevent-clipping-on-limesdr-mini/8351/1 "2024-06-21T19:32:29Z")

</div>

I’m working with a 2020 LimeSDR Mini (a discontinued one) and am trying to implement QPSK. I’m having clipping issues due to both Tx/Rx gain and not knowing what amplitude my IQ signal should peak at.

Here is a screenshot where my QPSK signal (RRC shaped) peaks at amplitude 1 and both Tx and Rx have gain of 20dB:

 ![image](https://canada1.discourse-cdn.com/flex034/uploads/myriadrf/original/2X/a/ae9e76c00d33f6c77e44c397c1aed664cb85ceef.png)

The bottom graph shows the signal directly before transmitting, and the top graph shows it afterwards. Notice how the input always alternates between +1 and -1 in both real and complex, but the output will clip down to 0. In this case, the peaks are safe but the stuff between the peaks clips, so it seems there’s a minimum clip here?

If I raise gain to 30dB it looks like this:

 ![image](https://canada1.discourse-cdn.com/flex034/uploads/myriadrf/original/2X/d/d65f5d0b9f95e38105d12d0658d3cf3f05691613.png)

In this case, it’s clipping both on top and on bottom. Peaks get flattened out and it flatlines at 0.

I tried cutting input amplitude down to 25% and I get the same results as above, just scaled down accordingly:

 ![image](https://canada1.discourse-cdn.com/flex034/uploads/myriadrf/original/2X/6/66603f00a59d9a7cbf34fd85ecb4d7773810c408.png)

You can also see the clipping happen in the constellation diagram. When gain gets too high, the points in the constellation begin to confine themselves to a square shape:

 ![image](https://canada1.discourse-cdn.com/flex034/uploads/myriadrf/original/2X/d/d2ba6170a7bb16c63271def1db6e02a70c5835a3.png)

For reference, this is my flowgraph:

 ![image](https://canada1.discourse-cdn.com/flex034/uploads/myriadrf/original/2X/e/ed0cfd1021ac3261fad9b2c4d434410d580f1382.png)

---

<div class="post-metadata">

**Author:** ![Orange](https://avatars.discourse-cdn.com/v4/letter/o/65b543/32.png) [@Orange](https://discourse.myriadrf.org/u/Orange)\
**Post date:** [24 June 2024 17:50 UTC](https://discourse.myriadrf.org/t/how-to-prevent-clipping-on-limesdr-mini/8351/2 "2024-06-24T17:50:12Z")

</div>

Update: it’s not clipping, I’m just being dumb. The output goes to 0 because of an imbalance in phase between I and Q. Adding matched filter and costas loop makes the output look like the input.
