Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 15 of 15

Thread: Roadmap - Clipping Detecton & Reporting

  1. #1

    Roadmap - Clipping Detecton & Reporting

    Is there a temporary workaround to detect clipping?

  2. #2
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    438
    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

  3. #3
    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

  4. #4
    Member fdaniels's Avatar
    Join Date
    Oct 2020
    Location
    Ostwestfalen, Germany
    Posts
    73
    What about a standard Limiter like this:
    https://www.thomann.de/de/drawmer_sp_2120.htm
    It even has a KeyLock ;-)

  5. #5
    Senior Member manicksan's Avatar
    Join Date
    Jun 2020
    Location
    Sweden
    Posts
    166
    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/WeAreTheMus...lipping_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

    Name:  Clipped Waves-01.jpg
Views: 115
Size:  28.7 KB

  6. #6
    Member fdaniels's Avatar
    Join Date
    Oct 2020
    Location
    Ostwestfalen, Germany
    Posts
    73
    I dont understand why a "clipped" Signal should damage speakers just by being "clipped", whatever clipped means.

  7. #7
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    438
    Quote Originally Posted by fdaniels View Post
    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

  8. #8
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    838
    Clipped signals produce more high frequency energy - which blows tweeters.

    The histogram method here sounds promising. Or do a FFT and compare 3khz and above energy to energy below 3khz.

    https://dsp.stackexchange.com/questi...in-a-recording

  9. #9
    Senior Member
    Join Date
    Jul 2020
    Posts
    583
    Quote Originally Posted by fdaniels View Post
    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.

  10. #10
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,384
    Quote Originally Posted by remko@thesetcompany.nl View Post
    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.

    Quote Originally Posted by remko@thesetcompany.nl View Post
    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

  11. #11
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    838
    > 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)?

  12. #12
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,489
    Quote Originally Posted by jonr View Post
    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.

  13. #13
    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

  14. #14
    Senior Member
    Join Date
    Jul 2020
    Posts
    583
    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.

  15. #15
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    838
    I've blown two speakers. In both cases, the tweeter, so DC offset had nothing to do with it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •