amplify/exaggerate by zero at the start increasing to double at end

205 Views Asked by At

My values are as follows

-0.030880035897248945, -0.030881151955902714, -0.030882268014556485, -0.03088355292653248, -0.030884837838508476, -0.030885793201895988, -0.0308867485652835, -0.030887652675367302, -0.030888556785451105, -0.030889140054324762, -0.03088972332319842, -0.030889860009662123, -0.03088999669612583, -0.030889768823825856, -0.030889540951525882, -0.03088959824044708, -0.030889655529368277, -0.03088920341332621, -0.030888751297284144, -0.03088785284525199, -0.030886954393219836, -0.03088617483467533, -0.03088539527613083, -0.03088497433793229, -0.03088455339973375, -0.03088497433793229

I have a loop that runs through my data where i is the iteration

I am trying to amplify/exaggerate the values closer to the end as i starts at zero and ends at 26 (the number of values)

value = value * ( i / 1000000 )

I am getting way way to steep an increase.

Another attempt was this. I used 20000 to try to get the increase not so extreme

value = value + ( ( value / 20000 ) * i )

Is there any way to do this using the range (rather than using a number I have guessed) as I would like to see a doubling in the amplification toward the end. I think it is called and exponent.


UPDATE:

In the below images the red line at the right is the values (I am streaching them and trying to amplify them as shown in the blue line)

value * ( 1 + i / 25 ) produces this:

enter image description here

value * ( 1 + i / 25000 ) produces this:

enter image description here

1

There are 1 best solutions below

9
On

Just as clarification? I think the 'equations' you wrote down are programming instructions, where you modifie the 'value' variable and store it again in 'value'? If you want the 'amplification' as a factor, you could do it like this (pseudocode):

for i = 0 upto 25
    value[i] = value[i] * 2^(i/25)
end 

This way you multiply the first element by the factor $1 = 2^{0/25} = 2^0$ (changes nothing) and multiply the factor each time by 2^(1/25) so that you get the factor $2 = 2^{25/25} = 2^1$ for the last element. But you could also just do it linearly:

for i = 0 upto 25
    value[i] = value[i] * (1 + i/25)
end 

This way you add each time $1/25$ to the factor.