Friday, February 23, 2024

Clipping - Gain too high

Good Morning,

I am trying to work out when my beeps are getting clipped due to gain too high.

This is in pure python (apologies if too OT here).

What I have come up with so far - which doesn't seem to work:

```python
def clipping(samples, rising_edge_idx, falling_edge_idx, beep_slice):
rising_edge_idx = rising_edge_idx*100
falling_edge_idx = falling_edge_idx*100
clipping = np.sqrt(np.mean(samples[rising_edge_idx:falling_edge_idx]))
clipping = np.sqrt(np.square(np.real(clipping))+np.square(np.imag(clipping)))
print(clipping)
return clipping
````
Rising Edge/Falling edge gives me the boundaries of a beep. I think
clipping occurs when magnitude is approaching 1.

The above equation is maximum at 0.5 no matter how high I ramp the gain up.

Any thoughts?

Thanks

Al



--
"Beat it punk!"
- Clint Eastwood

No comments:

Post a Comment