Converting the sample stream back will not restore the negative half of your signal. Now if you put a sample stream consisting of positive and negative values into a db conversion function, all the negative values will result into complete nonsense values. But, as both level measurements and linear gain factors are always positive numbers, the dB conversions are designed to convert positive linear gain values into the db domain and the other way round. This is where dB comes into play as it maps the loudness changes expressed by linear factors onto a logarithmic scale that approximates the perceived change in loudness a lot better. Now if levels are measured or gain is applied and we do that using the numerical domain of normalised 0 to 1 values we quickly notice that these factors do not necessarily match with the perceived change in loudness. If we want to change the level of a signal, all of its sample values are multiplied by a certain factor to scale the wave form. the integral of the area under the waveform which is somewhat approximated by the RMS value.the absolute max value of positive and negative peaks in the waveform – called the peak level.The perceived level of an audio signal like that is determined by In our environments, these values are usually in the normalised -1.0 to 1.0 range. A stream of samples is a series of numerical values that approximate the shape of the actual sound wave. It’s exactly like that, decibels are not meant to represent sample values. I’m wondering if there’s something wrong with this approach, maybe each sample can’t be converted that way for some reason? I have a convertBlockDataToDecibels function: void Compressor::convertBlockDataToDecibels (AudioBlock& block)įor (auto i = 0 i < block.getNumChannels() ++i)įor (auto j = 0 j < block.getNumSamples() ++j)ĭata = Decibels::decibelsToGain(data) Īnd when I limit the processing to just these two functions back to back I get issues with the sound. I am working on building a compressor plugin from the ground up as an exercise and was debugging an issue in my level detection when i noticed that simply converting the data in the main audio buffer to decibels and then converting back creates a strange distorted sound in the signal without any additional processing.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |