![]() ![]() I see, though, that, in this case, “log” must represent the natural logarithm, “log base e,” the same way that it does in C++, although my calculators represent this as “ln” and “log” is the common log (base 10). ![]() If “log” is short for “log base 10,” then the equation could be shortened to: I think that I’m going to check for 0 and return an incredibly low value, like -1000 dBfs or something. You can’t take any logarithm of 0, so you’ll have to come up with a solution for that. 0.5 and -0.5 would have the same dBfs value.ĮDIT: Also, I just found out that a problem in my program was being caused by my trying to convert 0 to dBfs using the equations above. The equations that work are:ĮDIT: Don’t forget that, when converting linear full-scale to decibel full-scale, you’re using the absolute value. In case anyone else has a similar need for equations in the future, I’ll post my findings here. Tldr the given db-to-linear function is incorrect, as far as I can tell. Thanks again for your generous help, Steve. If I was still in highschool taking Physics and Calculus, I probably would’ve had it in no time. Then, I had this calculator open and was trying to interpret the equations for deciBel conversions that I had handy so that the graph that it gave me came out with the same values as the Audacity sawtooth, haha. ![]() What I’d done was generate a sawtooth tone of 1 hz and then switched to the waveform (db) view to confirm that the sawtooth’s linear growth did appear as a logarithmic growth in that view. Thanks for your help, and now I can get back to my programming instead of dinking around with this graphing calculator. The equation that you’ve found is actually very close to where I was at based on my repeatedly going through Wikipedia’s DeciBel and DeciBel Full-Scale articles I was just having trouble finding the parallels between those two articles, and I was also getting lost when they delved into physics concepts like work, power, etc. Steve, the simplicity of your response is a godsend after I’d been stumped for two days trying to figure this out. Still, the exact equation used to get this dBfs value escapes me, and I’m not proficient enough with code-sifting to look up exactly how Audacity, for example, does it, so perhaps any one of you with the necessary experience could give me a hint? How do I take a sample’s value in full scale and convert it to a dBfs value? I see that Audacity measures decibels in “dBfs,” or “decibel full-scale,” where 0 dBfs represents the LOUDEST that a sample can be (the clipping point, or 1 and -1 in full scale), and the rest is represented by how many decibels QUIETER a sample is from that point, so that we only deal with negative decibel values. Since I’ve started writing signal processing extensions for PD, I’ve really had to brush up on my mathematics, refamiliarising myself with logarithms in particular, but, despite flicking through Wikipedia and other online sources, I’m still having some trouble understanding how to get a decibel value from a digital sample. I’m writing a simple dynamic range compressor as an extension to Pure Data as an exercise (I’m sure that many such extensions already exist), and, although my original plan was to have it work linearly with full-scale measurements, a quick glance at Audacity’s compressor opened my eyes so far that I should be using decibel measurements for this purpose instead. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |