Stereo Limiter

DSP related issues, mathematics, processing and techniques
Perfect Human Interface
Posts: 643
Joined: Sun Mar 10, 2013 7:32 pm

Stereo Limiter

Post by Perfect Human Interface »

Hi all. I've grabbed this here Limiter module from the Developers Toolkit on the SM forums. It's simple and it does exactly what I need, with one exception. It has a single stream input/output, but I need it to process in stereo. Now I can run a mono4 through it just fine, but if I'm not mistaken, this will process the left and right signals independently (right?), which is not typical function for a limiter (it can throw off L/R balance). What I'm looking for is for gain reduction on both the left and right signals to be identical, while either the left or the right signal reaches the threshold.

So, logically, it could take two inputs, compare the two to find which is larger, and then base the gain reduction for both signals off of the larger value signal.

The problem is, I don't know the first thing about assembly code. It's completely foreign to me. So I guess this just amounts to a typical beg for help. :D Can anyone help out with stereoizing this baby?

Limiter.PNG
Limiter.PNG (2.68 KiB) Viewed 37132 times


Also, at what point should I feel bad for using everyone else's work in my work?
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Stereo Limiter

Post by KG_is_back »

I can't get my hands on the limiter you are talking about, but try this one. It has zero attack time and adjustable release time. It treats mono4 as two stereo pairs (0-1 and 2-3) so it should do what you are looking for. If you need adjustable Threshold then replace

Code: Select all

float TH=0.99;

with

Code: Select all

streamin TH;
Attachments
limiter.fsm
(831 Bytes) Downloaded 1510 times
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Re: Stereo Limiter

Post by martinvicanek »

KG_is_back wrote:It treats mono4 as two stereo pairs (0-1 and 2-3)
In that case, should the third parameter of the shufps instruction not be 177 rather than 17?
shufps.png
shufps.png (24.92 KiB) Viewed 37103 times
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Stereo Limiter

Post by KG_is_back »

martinvicanek wrote:
KG_is_back wrote:It treats mono4 as two stereo pairs (0-1 and 2-3)
In that case, should the third parameter of the shufps instruction not be 177 rather than 17?
shufps.png


Yes :oops: you are right. A stupid mistake I've made.
Perfect Human Interface
Posts: 643
Joined: Sun Mar 10, 2013 7:32 pm

Re: Stereo Limiter

Post by Perfect Human Interface »

Thank you very much, I'll give this a try.

Is assembler difficult to learn or is it pretty straightforward?
Perfect Human Interface
Posts: 643
Joined: Sun Mar 10, 2013 7:32 pm

Re: Stereo Limiter

Post by Perfect Human Interface »

Hey, so I've put it through the rounds and it does process both signals, though I notice the reduction isn't identical between left and right channels. For example I measure that the left channel is being reduced 12dB or more while the (lower) right channel is reduced by about 8dB. Is that correct functionality?

Also, the limiter I was using had a "Gain Reduction" output. Would it be possible to add that?

I'm uploading the original limiter module mentioned here; I think that will be okay.

(You're on the IOU list KG.)
Attachments
limiter 2.fsm
(2.99 KiB) Downloaded 1598 times
alex111
Posts: 1
Joined: Wed Jan 29, 2014 12:31 pm

Re: Stereo Limiter

Post by alex111 »

if we change the ports then what will be solution of this stereo limiter?????????????
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Stereo Limiter

Post by KG_is_back »

I have adjusted both so they work stereo and output the GR. they give the same result though.
Attachments
limiter 2.fsm
(5.67 KiB) Downloaded 1699 times
Perfect Human Interface
Posts: 643
Joined: Sun Mar 10, 2013 7:32 pm

Re: Stereo Limiter

Post by Perfect Human Interface »

Much thanks! I can see that the gain reduction readouts are identical. However I still measure a slight difference on my peak meters. For example a louder left channel is reduced around 10 dB while the right channel is reduced around 6. That's what my meters seem to show. I'm curious as to why this is, but this should be good enough for my purposes regardless.
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Stereo Limiter

Post by KG_is_back »

Perfect Human Interface wrote:Much thanks! I can see that the gain reduction readouts are identical. However I still measure a slight difference on my peak meters. For example a louder left channel is reduced around 10 dB while the right channel is reduced around 6. That's what my meters seem to show. I'm curious as to why this is, but this should be good enough for my purposes regardless.


Then there must be something wrong with your readout. Both inputs are multiplied by the same GR so they both should be reduced by the same dB. How do you actually measure the GR?
Post Reply