Has anyone made a waveform clamping module?

For general discussion related FlowStone
Post Reply
User avatar
Spogg
Posts: 3368
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England
Contact:

Has anyone made a waveform clamping module?

Post 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 :D

Cheers

Spogg
adamszabo
Posts: 667
Joined: Sun Jul 11, 2010 7:21 am

Re: Has anyone made a waveform clamping module?

Post 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
User avatar
Spogg
Posts: 3368
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England
Contact:

Re: Has anyone made a waveform clamping module?

Post 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
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Re: Has anyone made a waveform clamping module?

Post 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. ;)
Attachments
nonNegativeClamping.fsm
(6.62 KiB) Downloaded 811 times
User avatar
Spogg
Posts: 3368
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England
Contact:

Re: Has anyone made a waveform clamping module?

Post by Spogg »

Martin, you never cease to amaze me! That is exactly what I wanted so I'm now very happy.

:D :D :D

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
Post Reply