Roadmap - Clipping Detecton & Reporting

Hi Remko,
Your question is very brief without any context. If you really want an answer you will need to elaborate more...
Are you talking about the Audio library? Or?
Your statement "a temporary workaround" implies that there is an issue that actually exists and is supposed to be solved by someone? Please let us know more details...

Paul
 
Hi Paul
Hope you can help
I will explain our situation / setup.
We use the teensy 4 in combination with the audioboard.
My question is about the audio library.
We have a setup with an audio mixer an amplifier and speakers
The mixer and amplifier are connected with a line signal.
We put the audioboard in between the mixer and amplifier to monitor the audio signal going to the amplifier.
We connected the line out of the mixer to the line in of the audioboard.
We connected the line out of the audioboard to the line in of the amplifier.
We like to detect a clipped audio signal coming from the mixer and so be able to prevent sending it to the amplifier.
If a clipped audio signal is send to the amplifier this will damage the speakers.
We now use the RMS module of the library to detect a high audio signal.
But this will not help detecting a clipped audio signal.
Greeting from Amsterdam / The Netherlands
Remko van Dokkum
 
How do you define a clipped audio signal, and how do you then play synth-music that contains sharp edges.

https://www.reddit.com/r/WeAreTheMu...could_we_dispel_the_myth_that_clipping_andor/

is could be done off course without any expensive "standard Limiter"

just analyze the signal in a custom Audio object, I think you can base it on the RMS module
by taking some samples and if most of them in a "row" have the same value then you have what I can define as clipping,
also it needs a setting how many samples "the width" of the signal that must be "clipping",
and then maybe round off/change the volume of those "clippings", I mean it could not be good for the speakers to just turn off then you will get some really nasty pops

Clipped Waves-01.jpg
 
I dont understand why a "clipped" Signal should damage speakers just by being "clipped", whatever clipped means.
 
I dont understand why a "clipped" Signal should damage speakers just by being "clipped", whatever clipped means.
"Because the clipped waveform has more area underneath it than the smaller unclipped waveform, the amplifier produces more power than its rated (sine wave) output when it is clipping. This extra power can damage the loudspeaker. It may cause damage to the amplifier's power supply or simply blow a fuse."
Source: Wikipedia

@Remko: thanks for the clarification.
I concur with manicksan's solution. Basically you want to detect DC.
Theoretically you could apply a steep high-pass filter set to e.g. 20Hz to filter out DC components but I'm not sure that will work satisfactorily. Perhaps there are other forum members that are more knowledgeable on this topic.

As a side note: I once tried to cleanup the Madonna song "Ray of Light" which clips on every CD version I found (so much for the Sony recording/mastering engineer ahum...). With a tool like Goldwave you can clearly see the clipping. Using Goldwave, I first applied 6dB attenuation and then applied a steep 20Hz high-pass filter. The result was no clippping anymore but the song still sounded not well...

Paul
 
I dont understand why a "clipped" Signal should damage speakers just by being "clipped", whatever clipped means.

This typically applies when the power amplifier itself is clipping - in this case the DC offset can be
substantial due to non-symmetric nature of the clipping (very much depends on the amp's internals),
and DC offsets don't see the inductance of the voice coil or impedance of the crossover inductors, so
can be surprizingly destructive to a speaker, especially if the AC component is already close to the
speaker's rating (since an amp only clips at max power!)

A clipped waveform in itself is just a signal, possibly very harsh sounding, but not dangerous in itself.
 
If a clipped audio signal is send to the amplifier this will damage the speakers.
I think that's supposed to be from the greater high-frequency content -- which entails greater power levels. It's only going to be a factor at levels already near the physical limits of the speaker to dissipate heat.

We now use the RMS module of the library to detect a high audio signal.
Use the Peak object... it's not averaging but returning the highest level in the processing block of samples.


btw- not an engineer! please defer to any real experts :)
 
> We like to detect a clipped audio signal coming from the mixer

Remko wants to detect clipping that occurred in the mixer or upstream of it. The signal level is likely to be fine once it gets to the teensy (or amplifier).

I suggest solving a different problem: how can one detect signals that will overload speakers (no matter how they were created)?
 
how can one detect signals that will overload speakers (no matter how they were created)?

I would imagine using the biquad filters to emulate the behavior of the "crossover" filters feeding the midrange and tweeters within the speakers. Then estimate the total signal power of each filter output, probably using the RMS analysis and taking the square of the value (or if you're really crafty, maybe edit the RMS code to skip the final square root step). You'd compute this power every 2.9ms as the library updates. Then you'd probably try to model the speaker's temperature. Maybe just multiply the power by some factor you believe to be the amount of heat and add it to the total temperature, and also subtract a constant for the amount of cooling over those 2.9ms. That simple linear model probably misses some minor effects, like the voice coil's copper wire resistance changing with temperature and maybe extra cooling if the woofers are physically moving air around inside a ported speaker, but it's probably good enough to get a reasonable real-time model of the approximate temperature inside the speaker.... of course with lucky guessworks for those coefficients for the amount of heat and rate of self cooling.

Then you'd just pick a threshold where the estimated temperature is too hot.
 
Sorry for the late reply.
Thanks for all input and suggestions.
I do not have the skills or in depth audio knowledge to build a complex solution to detect a clipped signal.

for now I use the RMS module.

What would be the higest frequency I could check the RMS value. as it tells the average is based on the time between checks.

I can just do a test and see if I could follow the sinus wave of a low frequency sinus shape tone.

greets

Remko
 
DC offsets damage speakers - both by overheating and by battering the coil former against the endstop (DC + AC as
in a clipped waveform does this - the DC holds it against the stop, the AC smashes it repeatedly against the endstop,
or rips the suspension spider/webs apart).

With a DC offset the coil itself isn't centred in the magnet poles, so its got less cooling from the metal poles'
proximity whilst this is happening. When a power amp clips you are already starting at the max power anyway,
which often is more than the speaker is designed to handle continuously, so thermal failure was already
on the cards. During a power amp clipping the feedback path is overwhelmed, often leading to other nasties
(such as bursts of ultrasonic oscillation), its basically bad news all round. Good power amps detect DC offset
and disconnect the speakers.

Also if the coil former is held near the endstop all the time, there is much less airflow cooling around the coil
which is normally there with unrestricted coil movement (well at least for bass signals).

With zero DC offset its only the power handling you have to worry about (with a multiway speaker the tweeters
are usually much more limited in power handling, but clipping per se doesn't grossly alter this, unless it creates
unwanted oscillations as described).

A decent power amp that's working and _not_ clipping prevents any DC getting to the speaker, so you can feed
it a "clipped" input signal without problem (many synthesized waveforms are deliberately "clipped", so long as
there's a DC blocking filter in the amplification chain this isn't a problem above and beyond the power handling
limits of the system).

The reason to detect clipping in a signal processing chain is because it creates massive distortion, not to save
speakers, I contend.
 
I've blown two speakers. In both cases, the tweeter, so DC offset had nothing to do with it.
 
Back
Top