Normalizing function to 16-bit

  • Thread starter Choisai
  • Start date
  • Tags
    Function
In summary, the conversation discusses the normalization of a superlorentzian function for use in an algorithm that uses 16-bit numbers. The function includes parameters such as A, B, C, D, n, and x0, and has a maximum value of A/B. The goal is to normalize the function so that the output will use 16-bit numbers. The formula for normalization is given as x - OldMinimum * (NewMaximum - NewMinimum)/(OldMaximum - OldMinimum) + NewMinimum. However, the function does not have a minimum value and the value of the new minimum can only be found using a limit as it approaches zero but never reaches it. The suggested formula for normalization does not work in this case
  • #1
Choisai
26
1
Hey there!
I want to normalise my function. It's a superlorentzian function and looks like this:

A / ( B+ [ ( (x-C)/x0 )^n ] + D

A/B is maximal value of the function
C is the horizontal transliteration of the function
x0 refers to the width of the function (multiply this value by 8 and you have its width)
n is the order of the function
D is the vertical transliteration

I want to normalise this function to it can be used for my algorithm that uses 16-bit numbers. But how can I do this? I tried using normal normalisation (A - aminimal / amax - amin) but that didn't work out for me. How can I normalise this function so it's output will use 16 bit numbers?
 

Attachments

  • 2014-04-10 15.29.19.jpg
    2014-04-10 15.29.19.jpg
    37.1 KB · Views: 410
Technology news on Phys.org
  • #2
Choisai said:
Hey there!
I want to normalise my function. It's a superlorentzian function and looks like this:

A / ( B+ [ ( (x-C)/x0 )^n ] + D

A/B is maximal value of the function
C is the horizontal transliteration of the function
x0 refers to the width of the function (multiply this value by 8 and you have its width)
n is the order of the function
D is the vertical transliteration

I want to normalise this function to it can be used for my algorithm that uses 16-bit numbers. But how can I do this? I tried using normal normalisation (A - aminimal / amax - amin) but that didn't work out for me. How can I normalise this function so it's output will use 16 bit numbers?
C is the horizontal translation of the function. Transliteration occurs when you change the letters from one language to those in another language. For example, the abbreviation CCCP (in Russian) becomes USSR on transliteration into an English abbreviation.You didn't say whether your 16-bit output values are signed or unsigned, so I arbitrarily chose unsigned. An unsigned 16-bit integer has a range of 0 through 65,535.

Here's your inequality:

$$0 ≤ \frac{A}{B + (\frac{x}{x_0})^n} + D ≤ 65,535$$
Add -D to all three members:
$$-D ≤ \frac{A}{B + (\frac{x}{x_0})^n} ≤ 65,535 - D$$
Invert the fractions, which changes the direction of the inequalities:
$$\frac{-1}{D} ≥ \frac{B + (\frac{x}{x_0})^n}{A} ≥ \frac{1}{65,535 - D} $$
Multiply all three members by A, and continue a step at a time until you get x all by itself in the middle. That will tell you the interval for your x values so that the output is no larger than 65,535.

If the output can be negative, change the first line to
-32,768 ≤ <your expression> ≤ 32,767

What you wrote is slightly different from the image you attached. What you wrote has x - C. It's a simple matter to change the above to include it.
 
  • Like
Likes 1 person
  • #3
I included the C and isolated the x. But it isn't exactly in a formula form:

$$(\frac{-A}{D}-B)^(\frac{1}{n}){x_0}+C≤ x ≤ (\frac{A}{65,535-D})^(\frac{1}{n}){x_0}+C$$

How can I turn this into a formula? If I want to use it for my algorithm I need to be able to plug my x in and get a normalized function out. Or are these the values that I need to use as my 'New Minimum' and 'New Maximum'?

The problem with that however is that my function doesn't really have a minimum value. My superlorentzian function has a maximum of A/B and goes off nearing zero, but it doesn't actually become zero.
So this is the usual normalization formula:

$$x-OldMinimum\frac{NewMaximum - NewMinimum}{OldMaximum - OldMinimum}+NewMinimum$$

I know the new Maximum (65535) and the new minimum (0). I also know the old maximum (A/B) but the new minimum can only be found using a limit. It goes off to 0, but never becomes zero. Is this is a problem?

PS: I'm not that handy with Latex so I couldn't get the 1/n power to work
 
Last edited:
  • #4
Choisai said:
PS: I'm not that handy with Latex so I couldn't get the 1/n power to work
You need some curly braces: X^{\frac{1}{n}}[tex]X^{\frac{1}{n}}[/tex]
 
  • Like
Likes 1 person
  • #5
Choisai said:
I included the C and isolated the x. But it isn't exactly in a formula form:

$$(\frac{-A}{D}-B)^(\frac{1}{n}){x_0}+C≤ x ≤ (\frac{A}{65,535-D})^(\frac{1}{n}){x_0}+C$$
You have your inequality symbols going the wrong direction. Here's the corrected inequality (also with the exponents fixed).

Presumably the parameters of your function - A, B, C, D, n, and x0 are known. If you substitute for them, it will give you the range of x values for which f(x) is between 0 and 65, 535.
$$(\frac{-A}{D}-B)^{\frac{1}{n}}{x_0}+C ≥ x ≥ (\frac{A}{65,535 - D})^{\frac{1}{n}}{x_0}+C$$

Choisai said:
How can I turn this into a formula? If I want to use it for my algorithm I need to be able to plug my x in and get a normalized function out. Or are these the values that I need to use as my 'New Minimum' and 'New Maximum'?

The problem with that however is that my function doesn't really have a minimum value. My superlorentzian function has a maximum of A/B and goes off nearing zero, but it doesn't actually become zero.
So this is the usual normalization formula:

$$x-OldMinimum\frac{NewMaximum - NewMinimum}{OldMaximum - OldMinimum}+NewMinimum$$

I know the new Maximum (65535) and the new minimum (0). I also know the old maximum (A/B) but the new minimum can only be found using a limit. It goes off to 0, but never becomes zero. Is this is a problem?

PS: I'm not that handy with Latex so I couldn't get the 1/n power to work
 
Last edited:
  • Like
Likes 1 person
  • #6
Mark44 said:
You have your inequality symbols going the wrong direction. Here's the corrected inequality (also with the exponents fixed).

Presumably the parameters of your function - A, B, C, D, n, and x0 are known. If you substitute for them, it will give you the range of x values for which f(x) is between 0 and 65, 535.
$$(\frac{-A}{D}-B)^{\frac{1}{n}}{x_0}+C ≥ x ≥ (\frac{A}{65,535 - D})^{\frac{1}{n}}{x_0}+C$$
Thank you for your reply. The constants are indeed known. I have to find the actual values though, but for the sake of my algorithm I presume these to be known (they are actually laser beam parameters, so that is something I have yet to find out). But are these the minimum and respective maximum that I have to plug in the formula I mentioned?
You can find more about it on this Wikipedia page:
http://en.wikipedia.org/wiki/Normalization_(image_processing [Broken])

Are the 'new maximum' and 'new minimum' constants I can fill in in that formula? Or is it a bit more complicated?

EDIT: I am working this out in Labview and because it's a function, I guess I have to use a rounding function too? Or is that not neccesary?
By the way, I tried using it but alas it fails. In most cases the vertical translation of a Lorentzian, the D in the Lorentzian formula, is zero. This means that when finding the minimum you have to divide by zero, so that part is not working out.
 
Last edited by a moderator:
  • #7
Choisai said:
Thank you for your reply. The constants are indeed known. I have to find the actual values though, but for the sake of my algorithm I presume these to be known (they are actually laser beam parameters, so that is something I have yet to find out). But are these the minimum and respective maximum that I have to plug in the formula I mentioned?
You can find more about it on this Wikipedia page:
http://en.wikipedia.org/wiki/Normalization_(image_processing [Broken])
The link you provided is broken, because you omitted the final parenthesis. Here's the link again, corrected. http://en.wikipedia.org/wiki/Normalization_(image_processing)

Choisai said:
Are the 'new maximum' and 'new minimum' constants I can fill in in that formula? Or is it a bit more complicated?
At the moment I don't know. I won't have a chance to look at the wiki article until later today.
Choisai said:
EDIT: I am working this out in Labview and because it's a function, I guess I have to use a rounding function too? Or is that not neccesary?
By the way, I tried using it but alas it fails. In most cases the vertical translation of a Lorentzian, the D in the Lorentzian formula, is zero. This means that when finding the minimum you have to divide by zero, so that part is not working out.
The work that I did started with the formula you provided, which was this:

A / ( B+ [ ( (x-C)/x0 )^n ] + D

Since, as you say, the vertical translation turns out to be zero, retrace my steps using this formula:
A / ( B+ [ ( (x-C)/x0 )^n ]
 
Last edited by a moderator:

What is "normalizing function to 16-bit"?

"Normalizing function to 16-bit" refers to the process of converting a function or data set into a 16-bit format. This means that the values of the function or data set are scaled to fit within the range of 16-bit binary numbers, which typically range from -32,768 to 32,767.

Why is it important to normalize a function to 16-bit?

Normalizing a function to 16-bit is important because many computer systems and programs are designed to work with 16-bit data. By normalizing a function to this format, it becomes easier to process and analyze the data using these systems and programs.

How is a function normalized to 16-bit?

A function can be normalized to 16-bit using a variety of methods, depending on the specific needs and requirements of the data. One common method is to scale the function's values to fit within the range of 16-bit binary numbers, while preserving the relative proportions of the data. Another method is to round the function's values to the nearest 16-bit binary number.

What are the benefits of normalizing a function to 16-bit?

Normalizing a function to 16-bit has several benefits, including making the data easier to work with on computer systems and programs that are designed to handle 16-bit data. It can also improve the accuracy and precision of the data by reducing the effects of rounding errors and data loss.

Are there any drawbacks to normalizing a function to 16-bit?

One potential drawback of normalizing a function to 16-bit is that it may result in loss of precision or accuracy if the original data set contained values outside of the 16-bit range. Additionally, normalizing to 16-bit may not be necessary or beneficial for all types of data or applications.

Similar threads

  • Programming and Computer Science
Replies
7
Views
3K
  • Programming and Computer Science
Replies
30
Views
4K
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
2
Views
854
  • Programming and Computer Science
Replies
1
Views
885
  • Programming and Computer Science
Replies
2
Views
680
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
6
Views
2K
Replies
9
Views
939
  • Programming and Computer Science
Replies
20
Views
1K
Back
Top