Page 1 of 1
Has anyone made a waveform clamping module?
Posted: Mon Aug 31, 2015 10:35 am
by Spogg
Hi you super-clever guys out there.
I need a waveform clamp. This would be like the clamp found in old TV circuits. The idea is that the most negative going value (peak) of any waveform is fixed at a defined value, normally zero, and the whole wave floats above this level irrespective of amplitude and harmonic content/waveshape.
Of course one way to achieve this would be to add an offset, but if the wave's amplitude changes the offset is no longer correct. I just wondered if there was an elegant way to achieve this...? I need this to be in a Mono stream, not green or Poly.
I'm not asking anyone to do this for me but if you already have a solution I would appreciate an upload that I could steal
Cheers
Spogg
Re: Has anyone made a waveform clamping module?
Posted: Mon Aug 31, 2015 11:40 am
by adamszabo
Maybe add a min and max, so the peak doesnt go over a specified value? Im not sure if thats what you are after
Re: Has anyone made a waveform clamping module?
Posted: Mon Aug 31, 2015 12:09 pm
by Spogg
Hi Adam
Thank you for taking time to reply, always appreciated.
This is actually for a module I'm playing around with for my DEVILISH Lissajou console. Just experimenting at the moment.
What you describe I think would be a clipper or limiter. What I actually want is to take a dynamically changing waveform, for example a voice, and make it truly unipolar so it goes from 0 up to whatever the level is at any time. I do realise that such a system would have dynamic limitations so it would have to react quickly to update the offset because the actual negative peak value would vary rapidly. I could introduce a short delay to account for processing time if needs be.
What I visualised is some Ruby code which maybe takes a frame and finds the most negative (lowest) value, outputs that as a float and this value would then be added to the original, in a separate path, to provide the offset needed to make the signal truly unipolar.
I could convert the audio to an array, use a 'float array normalise' prim so the amplitude is constant, then apply an offset of 1 and halve it to get the result. But this uses green so the result would be crap I reckon.
Alternatively maybe someone has made a frame normalise module in Ruby which could be used to similar effect as the above green method...
This is SO easy to do in the analogue world. It just uses a diode and a capacitor, but, like negative feedback, the world of code execution is not so easy.
I hope this has clarified my rather vague request.
Cheers
Spogg
Re: Has anyone made a waveform clamping module?
Posted: Mon Aug 31, 2015 2:43 pm
by martinvicanek
Here is a schematic borrowed from the envelope follower. In this case, it does not follow the envelope but the minimum of the waveform. The concept is similar to the analog diode/resistor/capacitor thing.

Re: Has anyone made a waveform clamping module?
Posted: Tue Sep 01, 2015 9:16 am
by Spogg
Martin, you never cease to amaze me! That is
exactly what I wanted so I'm now
very happy.
I really do appreciate you doing this for me. I will try to get my old head around how the code does it's thang.
Cheers
Spogg