Normalizing

Sound synthesis techniques, DSP and related mathematics

Moderators: electrogear, exonerate

Normalizing

Postby theorize on Wed Jan 16, 2008 1:39 pm

i was just reading another thread about sample instancing and volume (sorta), and it made me think to ask if anyone could point me in the right direction of a good explanation of that process? sorry i haven't done a search and won't be able to until tonight which by then i'll probably be too damn tired, and I'm about to leave here. please don't search it up yourself because i'm just looking for a link if someone already knows of one, i'll do a thorough look myself when I get the time because i'm thinking of trying to do (at least something similar) this to resolving a filter issue that i don't like.
"no handbanana! no baddog! no! noooooo!!!!!!!"
theorize
essemer
 
Posts: 37
Joined: Fri Jul 06, 2007 4:36 am

Re: Normalizing

Postby stefan on Wed Jan 16, 2008 2:10 pm

theorize wrote:i was just reading another thread about sample instancing and volume (sorta), and it made me think to ask if anyone could point me in the right direction of a good explanation of that process? sorry i haven't done a search and won't be able to until tonight which by then i'll probably be too damn tired, and I'm about to leave here. please don't search it up yourself because i'm just looking for a link if someone already knows of one, i'll do a thorough look myself when I get the time because i'm thinking of trying to do (at least something similar) this to resolving a filter issue that i don't like.


Normalizing is basically compression but not just "if above" or "if below" threshold, but both. Calculate how much the input signal differs from the wanted level and apply the needed amount of gain.

Of course you can't do this all the way down to -inf dB, so some kind of threshold is needed there.
Stefan
User avatar
stefan
smunatic
 
Posts: 2384
Joined: Wed Dec 15, 2004 9:24 pm
Location: Gothenburg, Sweden

Postby theorize on Fri Jan 18, 2008 8:53 am

thank you stefan, i've never used normalizing (maybe back in FL2) before, so i never took the time to learn about it. i'm going to have to think about it some more and explore some more options, as i'm not sure that it would be appropriate yet.

yet it might be cool to have a little "N" button on the filter, because certain filter settings on my filter make it sound weak because of the way i'm mixing it, if i can't find a better way to route and mix it all i might just do it.
"no handbanana! no baddog! no! noooooo!!!!!!!"
theorize
essemer
 
Posts: 37
Joined: Fri Jul 06, 2007 4:36 am

Postby stefan on Fri Jan 18, 2008 9:36 am

theorize wrote:thank you stefan, i've never used normalizing (maybe back in FL2) before, so i never took the time to learn about it. i'm going to have to think about it some more and explore some more options, as i'm not sure that it would be appropriate yet.

yet it might be cool to have a little "N" button on the filter, because certain filter settings on my filter make it sound weak because of the way i'm mixing it, if i can't find a better way to route and mix it all i might just do it.


I think it would be easier to just use heavy compression or a volume-matching curve for that specific scenario.
Stefan
User avatar
stefan
smunatic
 
Posts: 2384
Joined: Wed Dec 15, 2004 9:24 pm
Location: Gothenburg, Sweden

Postby TomC on Fri Jan 18, 2008 10:05 am

theorize wrote:thank you stefan, i've never used normalizing (maybe back in FL2) before, so i never took the time to learn about it. i'm going to have to think about it some more and explore some more options, as i'm not sure that it would be appropriate yet.

yet it might be cool to have a little "N" button on the filter, because certain filter settings on my filter make it sound weak because of the way i'm mixing it, if i can't find a better way to route and mix it all i might just do it.


Normalization is applying a constant(!) gain to an audio waveform.
It's normally used to make a recording as loud as possible without
clipping, and it's very easy there because you only have to search for the
loudest peak, find the multiplier to get it to 0 db et voilà.

Now, we're looking at an audio stream(!). We can't know what'll be the
loudest signal to come, so we can't do normalization if we don't want to
risk clipping.

What you actually want is compression (or limiting which is a special form
if compression). Only you know the input's signal level and what you'd
like as output level, so my advice is a simple volume knob combined
with whatever compressor/limiter is in fashion today.

I don't think a general 'N' for nomalization would help.


Tom
.signature failure
User avatar
TomC
smanatic
 
Posts: 706
Joined: Tue Oct 02, 2007 9:34 pm
Location: 3rd rock from the sun

Postby b_ara_ki on Sat Jan 19, 2008 2:32 am

if you take s&h on the signal, & get the highest peak
you can divide the reasult with the out of the signal .
and you get........normalizing
b_ara_ki
essemer
 
Posts: 49
Joined: Sun May 13, 2007 10:18 am

Postby TomC on Sat Jan 19, 2008 10:28 am

b_ara_ki wrote:if you take s&h on the signal, & get the highest peak
you can divide the reasult with the out of the signal .
and you get........normalizing


No.

See posting above.


Tom
.signature failure
User avatar
TomC
smanatic
 
Posts: 706
Joined: Tue Oct 02, 2007 9:34 pm
Location: 3rd rock from the sun

Re: Normalizing

Postby Osseous on Wed May 21, 2008 12:45 am

I agree with TomC. If you use S+H, then the difference in time between one sample being taken and another could see lots of changes in your audio. You might be causing clipping using a method like that.

The best suggestion is limiting, as tom pointed out earlier. AFAIK it's just a severe or 'brickwall' compressor. You could check out the example in the Effects modules. If you put the ratio up full, then i believe that would be a brickwall compressor, or limiter.

You could also check out the Waves L1 and L2 Ultramaximizers to get an idea of how few controls you need on a limiter. I believe the Reaktor ensemble named 'Blue' also had a limiter in it somewhere.
User avatar
Osseous
essemist
 
Posts: 52
Joined: Sat Apr 12, 2008 5:16 pm

Re: Normalizing

Postby kirkagur on Thu May 22, 2008 11:24 pm

if you looking for a limiter, one that eats up the clip and dont harm (match) to the sound....

i made one and i want to shere so here is the osm
Attachments
Limiter.osm
very smooth
(1.31 MiB) Downloaded 181 times
User avatar
kirkagur
essemilian
 
Posts: 365
Joined: Mon Jul 10, 2006 3:14 pm

Re: Normalizing

Postby oddson on Fri May 23, 2008 4:13 am

I haven't completely figured out what your limit does but I've noticed you take the absolute value of the signal before running it through the envelope follower code. I don't think that's needed as the envelope follower already takes care of that in the first line of code:
Code: Select all
normIn = in * (1 - in < 0 & 2);
(The add part afterwards is part of a denormal remover which is compensated for in the final line of code.)
oddson
wiki guru
 
Posts: 3883
Joined: Sun Jul 03, 2005 6:44 pm

Re: Normalizing

Postby aliasant on Fri May 23, 2008 3:30 pm

kirkagur wrote:if you looking for a limiter, one that eats up the clip and dont harm (match) to the sound....

i made one and i want to shere so here is the osm


hey.

I asm fu'd the threshold code to this. It didnt save much but I think there is something wrong with Andrews Analyzer maybe? Im getting odd results. This Threshold thing used 5 cycles and my optimized version uses 3 cycles.
Isnt that to little?
Anyways. Here is the asm code:


Code: Select all
streamin In;streamout Out;float over=0;
float F0=0;
//Assignment> sLeft=In
movaps xmm0,In;
movaps over,xmm0;
//movaps xmm0,over;
cmpps xmm0,F0,5;
//movaps xmm1,xmm0;
andps xmm1,over;
//Assignment> sLeft=xmm1
movaps over,xmm1;
//Assignment> sLeft=over
movaps xmm0,over;
movaps Out,xmm0;

/ original code /streamin In;
streamout Out;
float over;
over = In;
over = over >= 0 & over;
Out = over;
It's never to late to be late.....
http://martinrodensjo.smugmug.com/
User avatar
aliasant
smunatic
 
Posts: 2386
Joined: Sat Dec 30, 2006 5:49 pm
Location: Sweden

Re: Normalizing

Postby kirkagur on Fri May 23, 2008 3:52 pm

oops

i didn't notice...

and what will be better to change the envelope follower code ,or delete the assembler ?
User avatar
kirkagur
essemilian
 
Posts: 365
Joined: Mon Jul 10, 2006 3:14 pm

Re: Normalizing

Postby aliasant on Fri May 23, 2008 4:02 pm

Looking closer at it.

It actually sounds pretty good =) Impressed.

It uses a bit to much cpu though.

Its the dB converters. Is there a faster way to write similar code?

kirkagur, do you have the original code for those two ?

The envelope follower could also be faster. Simply make it asm and remove a few lines. But to be honest. I havent been able to gain enough speed to make it worth while.

I made some small changes to it. The Limiter that is.
I changed the fastest release time to 0.1 and I also changed the Threshold code so it now has to go over 2 to let stuff thru.
I also changed the Limiter to max 48 from max 24.

Good job kirkagur!
It's never to late to be late.....
http://martinrodensjo.smugmug.com/
User avatar
aliasant
smunatic
 
Posts: 2386
Joined: Sat Dec 30, 2006 5:49 pm
Location: Sweden

Re: Normalizing

Postby aliasant on Fri May 23, 2008 4:03 pm

kirkagur wrote:oops

i didn't notice...

and what will be better to change the envelope follower code ,or delete the assembler ?



Delete the assembler. At least that is what I did. Didnt even think about the other option. But that might have been a mistake =) Who knows.



UPDATE: I asm fu'd the envelope follower and gained another 20 cycles.

From 60 to 40 cycles.

Code:
Code: Select all
streamin in;streamout out;streamin release;float normIn=0;
float c=0;
float F1=1;
float F0=0;
float F2=2;
float F1eM008=1e-008;
movaps xmm0,in;
cmpps xmm0,F0,1;
//movaps xmm1,xmm0;
andps xmm0,F2;
movaps xmm1,F1;
subps xmm1,xmm0;
movaps xmm2,in;
mulps xmm2,xmm1;
//movaps xmm3,xmm2;
addps xmm2,F1eM008;
//Assignment> sLeft=xmm4
movaps normIn,xmm2;
movaps xmm0,normIn;
cmpps xmm0,out,5;
movaps xmm1,F0;
subps xmm1,release;
andps xmm0,xmm1;
movaps xmm1,release;
addps xmm1,xmm0;
//Assignment> sLeft=xmm1
//movaps c,xmm1;
movaps xmm0,out;
subps xmm0,normIn;
//movaps xmm1,c;
mulps xmm1,xmm0;
//movaps xmm2,xmm1;
addps xmm1,normIn;
//movaps xmm2,xmm1;
subps xmm1,F1eM008;
//Assignment> sLeft=xmm3
movaps out,xmm1;



/ original code /
streamin in;
streamout out;

streamin release;

float normIn;
float c;
normIn = in * (1 - in < 0 & 2) + 0.00000001;
c = release + normIn >= out & (0 - release);
out = c * (out - normIn) + normIn - 0.00000001;
It's never to late to be late.....
http://martinrodensjo.smugmug.com/
User avatar
aliasant
smunatic
 
Posts: 2386
Joined: Sat Dec 30, 2006 5:49 pm
Location: Sweden

Re: Normalizing

Postby kirkagur on Fri May 23, 2008 4:21 pm

i dont know match assembler to delete those lines in the env follower code...

this is the original code for the db convertor

Code: Select all
streamin lin;
streamout db;
db = log10(lin+0.0000000000001) * 20;




thank you for the comments ill be very happy if this limiter will be faster ,stronger, better


update: just post it and its happens !!! thank you :) :) :)
User avatar
kirkagur
essemilian
 
Posts: 365
Joined: Mon Jul 10, 2006 3:14 pm

Next

Return to Sound

Who is online

Users browsing this forum: No registered users and 1 guest