If you have a problem or need to report a bug please email :

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

How normalize works

Post any examples or modules that you want to share here

How normalize works

Postby tulamide » Sun May 23, 2021 9:52 pm

Since I have reason to believe that some of you might not understand fully what normalizing does, here an explanation.

In general normalizing means to take a set of values and re-scale them (keeping their relative relationship intact), so that they end in the range of 0 to 1. In DSP however, we most often work bipolar, so here normalizing means the same, but for the range -1 to 1.

What normalizing does not do, is stretching or otherwise destroy the relationship of the values. This means, that you will not end up with an array that fills the peaks necessarily. Example:

Code: Select all
our array: 3, 1.5
after normalizing: 1, 0.5
When normalizing, you scan through the array to get the highest positive and lowest negative values, let's call both just "peaks". Whatever peak is going beyond the range the most is the key value, from which a percentage of reduction is calculated. In our example that's 3, and it has to be reduced by 2/3rds to fit into the -1 to 1 range. Now all other values are also reduced by 2/3rds, thus 1.5 becomes 0.5. This way the relationship, that value two is half of value one, keeps intact.

It will not stretch 1.5 to become -1! That's important to understand. That would destroy the established relationship of the values! As a result, our example array would never reach -1.

Code: Select all
our array: 3, 1.5, -2.1
after normalizing: 1, 0.5, -0.7
In this array, we reach -0.7, because 2.1 is still closer to -1 than 3 is to 1, and so 3 is still our key value.

Code: Select all
our array: 3, 1.5, -4
after normalizing: 0.75, 0.375, -1
Now finally we reach -1, but at the same time +1 isn't reached anymore. That's because -4 is now our new key value, and it is to be reduced to a quarter to reach -1, not to a third as before.

If you had the thought, normalizing would somehow make sure the values stretch over the whole range, I hope I could give you enough information as to why that is not the case.

Keep on developing!
If you feel like gifting:
Posts: 2524
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: How normalize works

Postby Spogg » Mon May 24, 2021 7:01 am

Thank you!

This explanation is very welcome and, oddly, very pertinent for me right now ;)
User avatar
Posts: 2892
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: How normalize works

Postby kortezzzz » Mon May 24, 2021 12:12 pm

Thank you, tulamide, as always.
User avatar
Posts: 756
Joined: Tue Mar 19, 2013 4:21 pm

Re: How normalize works

Postby RJHollins » Mon May 24, 2021 5:14 pm

Well described ... helpful examples [code]

Thanks tulamide 8-)
Posts: 1495
Joined: Thu Mar 08, 2012 7:58 pm

Return to User Examples

Who is online

Users browsing this forum: No registered users and 11 guests