[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Clipping - Gain too high
From: |
Al Grant |
Subject: |
Clipping - Gain too high |
Date: |
Sat, 24 Feb 2024 07:58:55 +1300 |
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Clipping - Gain too high,
Al Grant <=