There are 9 messages in this thread.
You are currently looking at messages 1 to .
Is this discussion worth a thumbs up?
Hello All, I am attempting to normalize an audio file to a specific RMS decibel value (A-Weighted). I currently calculate calculate the A-Weighted RMS of an audio file. I calculate a scale factor by scaleFactor = pow( 10.0,( newDecibelRMS - currDecibelRMS) / 20.0 )); I then multiply the samples by the scaleFactor, which should bring the file to the desired RMS decibel value. The goal is to always have the file normalized to newDecibelRMS. I realized this works under certain cirmcumstances such as with white noise, pink noise and single frequency files. Any ideas on how to fix it so that the file is always set to the corrected A-Weighted RMS value. Thank you, Waverly______________________________
On Oct 15, 7:19 pm, "WaverlyE" <w...@n_o_s_p_a_m.genesys.com> wrote: > > I am attempting to normalize an audio file to a specific RMS decibel value > (A-Weighted). > I currently calculate calculate the A-Weighted RMS of an audio file. > I calculate a scale factor by > > scaleFactor = pow( 10.0,( newDecibelRMS - currDecibelRMS) / 20.0 )); > > I then multiply the samples by the scaleFactor, which should bring the file > to the desired RMS decibel value. The goal is to always have the file > normalized to newDecibelRMS. > > I realized this works under certain cirmcumstances such as with white > noise, pink noise and single frequency files. > > Any ideas on how to fix it so that the file is always set to the corrected > A-Weighted RMS value? dunno what the meaning of the request is exactly. are you wondering how to compute the A-weighted RMS of a (likely windowed) segment of sound? do you know how to A-weight filter it? and how to compute RMS? there are other "meter ballistics" issues to settle. then are you normalizing so that the maximum A-weighted RMS loudness of the whole file is set to some specified level and the same scaleFactor is applied to the whole sound file? or are you trying to do some level compression (varying scaleFactor)? fwiw, r b-j______________________________
>then are you normalizing so that the maximum A-weighted RMS loudness >of the whole file is set to some specified level and the same >scaleFactor is applied to the whole sound file? or are you trying to >do some level compression (varying scaleFactor)? > Yes, the end goal is normalizing so that the maximum A-weighted RMS loudness of the whole file is set to a specified level. I computed the A-weighted RMS but have not been able to determine how to compute a scale factor that satisfies the requirements. I find that if I compute the unweighted RMS, 99% of the time I can convert the file to the target RMS (unweighted). The same is not true if my target is A-weighted. I am at a loss for how I would normalize so that the maximum A-weighted RMS loudness of the whole file is set to a specified level. Thank you, Waverly______________________________
On Oct 16, 8:13 am, "WaverlyE" <w...@n_o_s_p_a_m.genesys.com> wrote: > >then are you normalizing so that the maximum A-weighted RMS loudness > >of the whole file is set to some specified level and the same > >scaleFactor is applied to the whole sound file? or are you trying to > >do some level compression (varying scaleFactor)? > > Yes, the end goal is normalizing so that the maximum A-weighted RMS > loudness of the whole file is set to a specified level. > > I computed the A-weighted RMS but have not been able to determine how to > compute a scale factor that satisfies the requirements. I find that if I > compute the unweighted RMS, 99% of the time I can convert the file to the > target RMS (unweighted). The same is not true if my target is A-weighted. > I am at a loss for how I would normalize so that the maximum A-weighted RMS > loudness of the whole file is set to a specified level. > my understanding of what you're trying to do is come up with a single scale factor that you apply to the whole sound file so that at the point where the sound has the maximum RMS A-weighted loudness (however that gets defined), that loudness is scaled to a predetermined value. is that correct? and my understanding is that you already know how to compute the maximum RMS A-weighted loudness. is that correct? if both are correct, and given your formula first posted, then i do not understand what the problem is. it seems as though you've solved all the pieces of the problem and you know how the pieces go together. r b-j______________________________
>if both are correct, and given your formula first posted, then i do
>not understand what the problem is. it seems as though you've solved
>all the pieces of the problem and you know how the pieces go together.
Unfortunately, it does not appear to work if I want to normalize to a
specific A-weighted RMS value.
The same process to normalize to a specific RMS for a unweighted audio only
works for some A-weighted.
scaleFactor = pow( 10.0,( newDecibelRMS - currDecibelRMS) / 20.0 ));
for ( indx = 0; indx < numOfSamples; indx++)
sample( indx )Â = sample( indx ) * scaleFactor;
When complete the RMS of the file is newDecibelRMS
Applying the above works 99% of the time for unweighted samples. Since
this does not consistently work for A-weighted files, my concern is that
because the weighting is not linear, then I dont have a way of determining
how to get the RMS to the desired level. I've thought hard but havent come
up with anything, which is why I am asking for insights and help in any
way.
Thank you,
Waverly
______________________________robert bristow-johnson wrote: > On Oct 16, 8:13 am, "WaverlyE" > <w...@n_o_s_p_a_m.genesys.com> wrote: > >>>then are you normalizing so that the maximum A-weighted RMS loudness >>>of the whole file is set to some specified level and the same >>>scaleFactor is applied to the whole sound file? or are you trying to >>>do some level compression (varying scaleFactor)? >> >>Yes, the end goal is normalizing so that the maximum A-weighted RMS >>loudness of the whole file is set to a specified level. >> >>I computed the A-weighted RMS but have not been able to determine how to >>compute a scale factor that satisfies the requirements. I find that if I >>compute the unweighted RMS, 99% of the time I can convert the file to the >>target RMS (unweighted). The same is not true if my target is A-weighted. >>I am at a loss for how I would normalize so that the maximum A-weighted RMS >>loudness of the whole file is set to a specified level. >> > > > my understanding of what you're trying to do is come up with a single > scale factor that you apply to the whole sound file so that at the > point where the sound has the maximum RMS A-weighted loudness (however > that gets defined), that loudness is scaled to a predetermined value. > is that correct? > > and my understanding is that you already know how to compute the > maximum RMS A-weighted loudness. is that correct? > > if both are correct, and given your formula first posted, then i do > not understand what the problem is. The problem is the scaled peaks are getting clipped; so here we go. > it seems as though you've solved > all the pieces of the problem and you know how the pieces go together. He is imbecile. Why bother? VLV______________________________
>The problem is the scaled peaks are getting clipped; so here we go. > You are correct. After I read this I went back and tested all my samples and the ones that did not scale to the correct RMS were being clipped. >He is imbecile. Why bother? > I could have done without the portion of being called an imbecile. It was an oversight that threw off my results and I drew the wrong conclusion from those results. I have since put in a safeguard to warn me if clipping would occur during normalization. I thank you kindly for pointing out the error in my thinking Waverly______________________________
On Oct 17, 12:10 am, "WaverlyE" <w...@n_o_s_p_a_m.genesys.com> wrote: > > I could have done without the portion of being called an imbecile. It was > an oversight that threw off my results and I drew the wrong conclusion from > those results. I have since put in a safeguard to warn me if clipping > would occur during normalization. > > I thank you kindly for pointing out the error in my thinking not that it's written in the comp.dsp constitution or anything, but a de facto price one pays for getting help here is that Vlad will be highlighting one's inadequacies. at least those he believes he sees. i might suggest toughening up one's skin and just come back for more. i have gotten into a few nasty fights here, but it's usually when a self-assessed know-it-all takes issue with something that is very conservative that i or someone else has written. i don't have any problem with noobs or anyone else with real questions. r b-j______________________________
>... i don't have any problem with noobs or anyone else with real questions. You were correct that I had all the pieces to the puzzle. I just wasnt seeing the error I was generating. Thank you very much for your help. Waverly______________________________