Wave Scaling

Started by Ingolf2,

Ingolf2

My question is fairly simple I guess: Does anyone know how the wave scaling is done in wave editing software like Sound Forge? I mean when it is showed on the display, like with a scale of 1:4096

First I picked out values when scaling to let's say 10% of the original giving me a scaled wave that looks nothing like the original or the sound forge scaled wave.

Next I tried to display the sum of values between the scaled waves, and then display it, but couldn't get it to work.

Anyone knows how to, or help to get me in the right direction?

wombat

You need to get the average of the part you're scaling. Just add them all up and divide by the number of samples you added up.

Ingolf2

I tried that already and I ended up with a small waveform (the more added together, the smaller the wave) while the sound is very loud. When opening the same sound in sound forge, it is displayed with a high amplitude.

I also thought that that would work, that it would fix my first try, but not how I have done it now. I must be doing something wrong, but the code is so simple, how can I?

But I am going to try...

Ingolf2

When you have a waveform like this (one sinusoid):

0.2  0.4  0.6  0.8  1  0.8  0.6  0.4  0.2  0  -0.2  -0.4 -0.6  -0.8  -1  -0.8  -0.6  -0.4  -0.2  0

And you will add them together:

positive values = 5
negative = -5

they cancel eachother out, giving a value of 0, while the highest amplitude is still 1. So, I guess I must scale the positive and negative values seperately.

When averaging this number, it will give me 0.5, which is not what I want to see, right? I would want to see the highest value, which is 1. So I think that I will also have to check for the highest value.

Is all this correct?