chmichael

asked on

# Nomalize and convert Float to Integer

Hello,

I have the following arrays:

with the following function i convert the float number to integers:

Comment: Since it's a wave i care only for the fractional part of the float not the integer.

Now, i want to normalize the array so the scale up every channel to be in the same range.

(Like normilizing a waveform, in this case 6 channels/waves)

Thank you

I have the following arrays:

```
const
cMaxSampleDuration = 420;
var
MyDoubleArray: array[0..5, 0..cMaxSampleDuration -1] of Double;
MyIntegerArray: array[0..5, 0..cMaxSampleDuration -1] of Integer;
```

with the following function i convert the float number to integers:

```
for Channel := 0 to 6 -1 do
for Samples := 0 to cMaxSampleDuration -1 do
MyIntegerArray[Channel, Samples] := Round(Frac(MyDoubleArray[Channel, Samples]) * 200000);
```

Comment: Since it's a wave i care only for the fractional part of the float not the integer.

Now, i want to normalize the array so the scale up every channel to be in the same range.

(Like normilizing a waveform, in this case 6 channels/waves)

Thank you

ASKER

It doesn't work with negative numbers! Can you take a look ?

Thank you

Thank you

ASKER CERTIFIED SOLUTION

membership

This solution is only available to members.

To access this solution, you must be a member of Experts Exchange.

Open in new window