Convert decibels to amplitude - Built-in function

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












Is there a built-in function to convert decibels to amplitude in Mathematica? I tried with:



UnitConvert[Quantity[40, "decibels"], "amplitude"]


but it does not work.



Online I found only a widget for Wolfram Alpha:



http://www.wolframalpha.com/widgets/view.jsp?id=21e1ea77bd91aaa0fc4d01a943a654e



enter image description here







share|improve this question






















  • 10^(amplitudeIndB/20.)
    – andre
    Aug 8 at 16:14










  • Hello @andre, I am looking for a built-in function that does the same thing.
    – Gennaro Arguzzi
    Aug 8 at 16:17






  • 1




    Why insist on built-in? I think answer will be no such built-in, although the external resources (databases, W|A) continue to evolve, I think. W|A does not seem currently to be able to recognize "amplitude ratio" or the ISO term "root-power quantity," which does not seem to be an ISO unit per se or have a unit name/symbol.
    – Michael E2
    Aug 8 at 17:27






  • 1




    @MichaelE2 The confusing part is, the document of Quantity claims that "Supported units include all those specified by NIST Special Publication 811. " And decibel is indeed mentioned there…
    – xzczd
    Aug 8 at 17:48






  • 1




    @xzczd Yes, I knew. I thought you would point out that UnitConvert cannot convert decibels to bels, though. It says they are incompatible (Quantity::compat), which seems an error to me. It seems an IndependentUnit is treated as having "no relationship to other units within a Quantity."
    – Michael E2
    Aug 8 at 18:38














up vote
2
down vote

favorite












Is there a built-in function to convert decibels to amplitude in Mathematica? I tried with:



UnitConvert[Quantity[40, "decibels"], "amplitude"]


but it does not work.



Online I found only a widget for Wolfram Alpha:



http://www.wolframalpha.com/widgets/view.jsp?id=21e1ea77bd91aaa0fc4d01a943a654e



enter image description here







share|improve this question






















  • 10^(amplitudeIndB/20.)
    – andre
    Aug 8 at 16:14










  • Hello @andre, I am looking for a built-in function that does the same thing.
    – Gennaro Arguzzi
    Aug 8 at 16:17






  • 1




    Why insist on built-in? I think answer will be no such built-in, although the external resources (databases, W|A) continue to evolve, I think. W|A does not seem currently to be able to recognize "amplitude ratio" or the ISO term "root-power quantity," which does not seem to be an ISO unit per se or have a unit name/symbol.
    – Michael E2
    Aug 8 at 17:27






  • 1




    @MichaelE2 The confusing part is, the document of Quantity claims that "Supported units include all those specified by NIST Special Publication 811. " And decibel is indeed mentioned there…
    – xzczd
    Aug 8 at 17:48






  • 1




    @xzczd Yes, I knew. I thought you would point out that UnitConvert cannot convert decibels to bels, though. It says they are incompatible (Quantity::compat), which seems an error to me. It seems an IndependentUnit is treated as having "no relationship to other units within a Quantity."
    – Michael E2
    Aug 8 at 18:38












up vote
2
down vote

favorite









up vote
2
down vote

favorite











Is there a built-in function to convert decibels to amplitude in Mathematica? I tried with:



UnitConvert[Quantity[40, "decibels"], "amplitude"]


but it does not work.



Online I found only a widget for Wolfram Alpha:



http://www.wolframalpha.com/widgets/view.jsp?id=21e1ea77bd91aaa0fc4d01a943a654e



enter image description here







share|improve this question














Is there a built-in function to convert decibels to amplitude in Mathematica? I tried with:



UnitConvert[Quantity[40, "decibels"], "amplitude"]


but it does not work.



Online I found only a widget for Wolfram Alpha:



http://www.wolframalpha.com/widgets/view.jsp?id=21e1ea77bd91aaa0fc4d01a943a654e



enter image description here









share|improve this question













share|improve this question




share|improve this question








edited Aug 8 at 16:26

























asked Aug 8 at 16:10









Gennaro Arguzzi

269210




269210











  • 10^(amplitudeIndB/20.)
    – andre
    Aug 8 at 16:14










  • Hello @andre, I am looking for a built-in function that does the same thing.
    – Gennaro Arguzzi
    Aug 8 at 16:17






  • 1




    Why insist on built-in? I think answer will be no such built-in, although the external resources (databases, W|A) continue to evolve, I think. W|A does not seem currently to be able to recognize "amplitude ratio" or the ISO term "root-power quantity," which does not seem to be an ISO unit per se or have a unit name/symbol.
    – Michael E2
    Aug 8 at 17:27






  • 1




    @MichaelE2 The confusing part is, the document of Quantity claims that "Supported units include all those specified by NIST Special Publication 811. " And decibel is indeed mentioned there…
    – xzczd
    Aug 8 at 17:48






  • 1




    @xzczd Yes, I knew. I thought you would point out that UnitConvert cannot convert decibels to bels, though. It says they are incompatible (Quantity::compat), which seems an error to me. It seems an IndependentUnit is treated as having "no relationship to other units within a Quantity."
    – Michael E2
    Aug 8 at 18:38
















  • 10^(amplitudeIndB/20.)
    – andre
    Aug 8 at 16:14










  • Hello @andre, I am looking for a built-in function that does the same thing.
    – Gennaro Arguzzi
    Aug 8 at 16:17






  • 1




    Why insist on built-in? I think answer will be no such built-in, although the external resources (databases, W|A) continue to evolve, I think. W|A does not seem currently to be able to recognize "amplitude ratio" or the ISO term "root-power quantity," which does not seem to be an ISO unit per se or have a unit name/symbol.
    – Michael E2
    Aug 8 at 17:27






  • 1




    @MichaelE2 The confusing part is, the document of Quantity claims that "Supported units include all those specified by NIST Special Publication 811. " And decibel is indeed mentioned there…
    – xzczd
    Aug 8 at 17:48






  • 1




    @xzczd Yes, I knew. I thought you would point out that UnitConvert cannot convert decibels to bels, though. It says they are incompatible (Quantity::compat), which seems an error to me. It seems an IndependentUnit is treated as having "no relationship to other units within a Quantity."
    – Michael E2
    Aug 8 at 18:38















10^(amplitudeIndB/20.)
– andre
Aug 8 at 16:14




10^(amplitudeIndB/20.)
– andre
Aug 8 at 16:14












Hello @andre, I am looking for a built-in function that does the same thing.
– Gennaro Arguzzi
Aug 8 at 16:17




Hello @andre, I am looking for a built-in function that does the same thing.
– Gennaro Arguzzi
Aug 8 at 16:17




1




1




Why insist on built-in? I think answer will be no such built-in, although the external resources (databases, W|A) continue to evolve, I think. W|A does not seem currently to be able to recognize "amplitude ratio" or the ISO term "root-power quantity," which does not seem to be an ISO unit per se or have a unit name/symbol.
– Michael E2
Aug 8 at 17:27




Why insist on built-in? I think answer will be no such built-in, although the external resources (databases, W|A) continue to evolve, I think. W|A does not seem currently to be able to recognize "amplitude ratio" or the ISO term "root-power quantity," which does not seem to be an ISO unit per se or have a unit name/symbol.
– Michael E2
Aug 8 at 17:27




1




1




@MichaelE2 The confusing part is, the document of Quantity claims that "Supported units include all those specified by NIST Special Publication 811. " And decibel is indeed mentioned there…
– xzczd
Aug 8 at 17:48




@MichaelE2 The confusing part is, the document of Quantity claims that "Supported units include all those specified by NIST Special Publication 811. " And decibel is indeed mentioned there…
– xzczd
Aug 8 at 17:48




1




1




@xzczd Yes, I knew. I thought you would point out that UnitConvert cannot convert decibels to bels, though. It says they are incompatible (Quantity::compat), which seems an error to me. It seems an IndependentUnit is treated as having "no relationship to other units within a Quantity."
– Michael E2
Aug 8 at 18:38




@xzczd Yes, I knew. I thought you would point out that UnitConvert cannot convert decibels to bels, though. It says they are incompatible (Quantity::compat), which seems an error to me. It seems an IndependentUnit is treated as having "no relationship to other units within a Quantity."
– Michael E2
Aug 8 at 18:38










1 Answer
1






active

oldest

votes

















up vote
6
down vote



accepted










There is nothing in the documentation, and bellow you can see what you can find in the internal functions, of which nothing that seems to do the job. So the answer to your question is:



No, there is no built-in function to convert decibels to amplitude in Mathematica.




Speculation on "why"



We can only guess why the developers didn't implement this, a possible narrative may be similar to the case of the now deprecated Units Package. There the documentation said:




"The conversion of temperature units is different from most other unit
conversions because it is not multiplicative. This is simply because
the zeros of various systems are set at different values. For example,
zero degrees Centigrade is the same as 32 degrees Fahrenheit."




So you had to use ConvertTemperature instead of Convert. How is that similar? It's similar because both cases are somehow special. Wikipedia says




The decibel (symbol: dB) is a unit of measurement used to express the
ratio of one value of a physical property to another on a logarithmic
scale.




dB is NOT an amount of a physical quantity, but a the logarithm of a ratio of two quantities in the same units, therefore unitless and non-linear. Also depending if the you are talking about amplitudes or power (amplitude squared) the factors are 20 or 10.



Therefore, non-linear relationship of something that arguably may not be even a unit with a potentially ambiguous definition... better leave it to the users to define their own, rather simple, solutions.




A solution



dB2lin[x_] := N[Power[10, x/20]];
lin2dB[x_] := N[20 Log10[x]];



Internal functions



Some functions with matching names



Names["*`*Decibel*", IgnoreCase -> True]
(* "Signal`Utils`decibelQ", "Signal`Utils`decibelQ$",
"CalculateUnits`UnitCommonSymbols`DecibelsMuUnit",
"CalculateUnits`UnitCommonSymbols`CalculateUnits`UnitCommonSymbols`
DecibelsMuUnit", "CalculateUnits`UnitCommonSymbols`DecibelsRUnit",
"CalculateUnits`UnitCommonSymbols`DecibelsVUnit",
"CalculateUnits`UnitCommonSymbols`DecibelsZUnit" *)

Names["*`db*"]
(* "Image`ColorOperationsDump`db",
"Image`ColorOperationsDump`Image`ColorOperationsDump`db",
"Predictions`Private`db",
"Predictions`Private`Predictions`Private`db",
"Statistics`Library`Dump`dbag", "Statistics`Library`Dump`dbag$",
"PacletManager`LayoutDocsCollection`Private`dbFile",
"System`FourierTransformDump`dbgPrintFT",
"Charting`ChartLabelingDump`dbgstyle",
"Charting`ChartLabelingDump`dbgstyle$",
"Charting`ChartLabelingDump`dbox", "Charting`dbPrint",
"Image`ColorOperationsDump`dbPrint", "Image`HumanDump`dbPrint",
"Image`SpatialOperationsDump`dbPrint",
"Visualization`VectorFields`VectorFieldsDump`dbPrint",
"Wavelets`WaveletUtilities`dbPrint",
"PacletManager`LayoutDocsCollection`Private`dbStrm",
"PacletManager`LayoutDocsCollection`Private`dbStrm$",
"Charting`CommonDump`dbstyle",
"Charting`ChartLabelingDump`dbTimingReap",
"Charting`ChartLabelingDump`dbVpp", "Charting`ParserDump`dbVpp",
"System`ListPointPlot3DDump`dbVpp",
"System`ListPointPlot3DDump`System`ListPointPlot3DDump`dbVpp" *)





share|improve this answer






















  • Hello @rhermans, thank you for your extremely clear answer.
    – Gennaro Arguzzi
    Aug 8 at 17:06










  • "It's not an amount of a physical quantity, but a the logarithm of a ratio of two quantities in the same units, therefore unitless. " Hmm… but UnitConvert[Quantity[40, "AngularDegrees"], "Radians"] works.
    – xzczd
    Aug 8 at 17:12










  • @xzczd remember that with the Units package "The conversion of temperature units is different from most other unit conversions because it is not multiplicative. This is simply because the zeros of various systems are set at different values. For example, zero degrees Centigrade is the same as 32 degrees Fahrenheit." so you had to use ConvertTemperature instead of Convert. Is not that there are no ways around, but these are special cases. And radians is closer to the idea of a units, as they are amounts of $pi$
    – rhermans
    Aug 8 at 17:17











  • Well, "AngularDegrees" isn't a unit for temperature, it's a unit for angle, which is dimensionless. With this example I just want to illustrate that dimensionless or unitless doesn't seem to be a reason for the "failure" of Mathematica.
    – xzczd
    Aug 8 at 17:25







  • 1




    UnitConvert will call Internal`MWACompute["MWAToQuantity", name] to use WolframAlpha to assist with units when the unit name is not among the built-in ones. Now W|A can convert between decibels and bels, but UnitConvert cannot. So the call to W|A might only result in an IndependentUnit that cannot be converted.
    – Michael E2
    Aug 8 at 18:36











Your Answer




StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f179697%2fconvert-decibels-to-amplitude-built-in-function%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
6
down vote



accepted










There is nothing in the documentation, and bellow you can see what you can find in the internal functions, of which nothing that seems to do the job. So the answer to your question is:



No, there is no built-in function to convert decibels to amplitude in Mathematica.




Speculation on "why"



We can only guess why the developers didn't implement this, a possible narrative may be similar to the case of the now deprecated Units Package. There the documentation said:




"The conversion of temperature units is different from most other unit
conversions because it is not multiplicative. This is simply because
the zeros of various systems are set at different values. For example,
zero degrees Centigrade is the same as 32 degrees Fahrenheit."




So you had to use ConvertTemperature instead of Convert. How is that similar? It's similar because both cases are somehow special. Wikipedia says




The decibel (symbol: dB) is a unit of measurement used to express the
ratio of one value of a physical property to another on a logarithmic
scale.




dB is NOT an amount of a physical quantity, but a the logarithm of a ratio of two quantities in the same units, therefore unitless and non-linear. Also depending if the you are talking about amplitudes or power (amplitude squared) the factors are 20 or 10.



Therefore, non-linear relationship of something that arguably may not be even a unit with a potentially ambiguous definition... better leave it to the users to define their own, rather simple, solutions.




A solution



dB2lin[x_] := N[Power[10, x/20]];
lin2dB[x_] := N[20 Log10[x]];



Internal functions



Some functions with matching names



Names["*`*Decibel*", IgnoreCase -> True]
(* "Signal`Utils`decibelQ", "Signal`Utils`decibelQ$",
"CalculateUnits`UnitCommonSymbols`DecibelsMuUnit",
"CalculateUnits`UnitCommonSymbols`CalculateUnits`UnitCommonSymbols`
DecibelsMuUnit", "CalculateUnits`UnitCommonSymbols`DecibelsRUnit",
"CalculateUnits`UnitCommonSymbols`DecibelsVUnit",
"CalculateUnits`UnitCommonSymbols`DecibelsZUnit" *)

Names["*`db*"]
(* "Image`ColorOperationsDump`db",
"Image`ColorOperationsDump`Image`ColorOperationsDump`db",
"Predictions`Private`db",
"Predictions`Private`Predictions`Private`db",
"Statistics`Library`Dump`dbag", "Statistics`Library`Dump`dbag$",
"PacletManager`LayoutDocsCollection`Private`dbFile",
"System`FourierTransformDump`dbgPrintFT",
"Charting`ChartLabelingDump`dbgstyle",
"Charting`ChartLabelingDump`dbgstyle$",
"Charting`ChartLabelingDump`dbox", "Charting`dbPrint",
"Image`ColorOperationsDump`dbPrint", "Image`HumanDump`dbPrint",
"Image`SpatialOperationsDump`dbPrint",
"Visualization`VectorFields`VectorFieldsDump`dbPrint",
"Wavelets`WaveletUtilities`dbPrint",
"PacletManager`LayoutDocsCollection`Private`dbStrm",
"PacletManager`LayoutDocsCollection`Private`dbStrm$",
"Charting`CommonDump`dbstyle",
"Charting`ChartLabelingDump`dbTimingReap",
"Charting`ChartLabelingDump`dbVpp", "Charting`ParserDump`dbVpp",
"System`ListPointPlot3DDump`dbVpp",
"System`ListPointPlot3DDump`System`ListPointPlot3DDump`dbVpp" *)





share|improve this answer






















  • Hello @rhermans, thank you for your extremely clear answer.
    – Gennaro Arguzzi
    Aug 8 at 17:06










  • "It's not an amount of a physical quantity, but a the logarithm of a ratio of two quantities in the same units, therefore unitless. " Hmm… but UnitConvert[Quantity[40, "AngularDegrees"], "Radians"] works.
    – xzczd
    Aug 8 at 17:12










  • @xzczd remember that with the Units package "The conversion of temperature units is different from most other unit conversions because it is not multiplicative. This is simply because the zeros of various systems are set at different values. For example, zero degrees Centigrade is the same as 32 degrees Fahrenheit." so you had to use ConvertTemperature instead of Convert. Is not that there are no ways around, but these are special cases. And radians is closer to the idea of a units, as they are amounts of $pi$
    – rhermans
    Aug 8 at 17:17











  • Well, "AngularDegrees" isn't a unit for temperature, it's a unit for angle, which is dimensionless. With this example I just want to illustrate that dimensionless or unitless doesn't seem to be a reason for the "failure" of Mathematica.
    – xzczd
    Aug 8 at 17:25







  • 1




    UnitConvert will call Internal`MWACompute["MWAToQuantity", name] to use WolframAlpha to assist with units when the unit name is not among the built-in ones. Now W|A can convert between decibels and bels, but UnitConvert cannot. So the call to W|A might only result in an IndependentUnit that cannot be converted.
    – Michael E2
    Aug 8 at 18:36















up vote
6
down vote



accepted










There is nothing in the documentation, and bellow you can see what you can find in the internal functions, of which nothing that seems to do the job. So the answer to your question is:



No, there is no built-in function to convert decibels to amplitude in Mathematica.




Speculation on "why"



We can only guess why the developers didn't implement this, a possible narrative may be similar to the case of the now deprecated Units Package. There the documentation said:




"The conversion of temperature units is different from most other unit
conversions because it is not multiplicative. This is simply because
the zeros of various systems are set at different values. For example,
zero degrees Centigrade is the same as 32 degrees Fahrenheit."




So you had to use ConvertTemperature instead of Convert. How is that similar? It's similar because both cases are somehow special. Wikipedia says




The decibel (symbol: dB) is a unit of measurement used to express the
ratio of one value of a physical property to another on a logarithmic
scale.




dB is NOT an amount of a physical quantity, but a the logarithm of a ratio of two quantities in the same units, therefore unitless and non-linear. Also depending if the you are talking about amplitudes or power (amplitude squared) the factors are 20 or 10.



Therefore, non-linear relationship of something that arguably may not be even a unit with a potentially ambiguous definition... better leave it to the users to define their own, rather simple, solutions.




A solution



dB2lin[x_] := N[Power[10, x/20]];
lin2dB[x_] := N[20 Log10[x]];



Internal functions



Some functions with matching names



Names["*`*Decibel*", IgnoreCase -> True]
(* "Signal`Utils`decibelQ", "Signal`Utils`decibelQ$",
"CalculateUnits`UnitCommonSymbols`DecibelsMuUnit",
"CalculateUnits`UnitCommonSymbols`CalculateUnits`UnitCommonSymbols`
DecibelsMuUnit", "CalculateUnits`UnitCommonSymbols`DecibelsRUnit",
"CalculateUnits`UnitCommonSymbols`DecibelsVUnit",
"CalculateUnits`UnitCommonSymbols`DecibelsZUnit" *)

Names["*`db*"]
(* "Image`ColorOperationsDump`db",
"Image`ColorOperationsDump`Image`ColorOperationsDump`db",
"Predictions`Private`db",
"Predictions`Private`Predictions`Private`db",
"Statistics`Library`Dump`dbag", "Statistics`Library`Dump`dbag$",
"PacletManager`LayoutDocsCollection`Private`dbFile",
"System`FourierTransformDump`dbgPrintFT",
"Charting`ChartLabelingDump`dbgstyle",
"Charting`ChartLabelingDump`dbgstyle$",
"Charting`ChartLabelingDump`dbox", "Charting`dbPrint",
"Image`ColorOperationsDump`dbPrint", "Image`HumanDump`dbPrint",
"Image`SpatialOperationsDump`dbPrint",
"Visualization`VectorFields`VectorFieldsDump`dbPrint",
"Wavelets`WaveletUtilities`dbPrint",
"PacletManager`LayoutDocsCollection`Private`dbStrm",
"PacletManager`LayoutDocsCollection`Private`dbStrm$",
"Charting`CommonDump`dbstyle",
"Charting`ChartLabelingDump`dbTimingReap",
"Charting`ChartLabelingDump`dbVpp", "Charting`ParserDump`dbVpp",
"System`ListPointPlot3DDump`dbVpp",
"System`ListPointPlot3DDump`System`ListPointPlot3DDump`dbVpp" *)





share|improve this answer






















  • Hello @rhermans, thank you for your extremely clear answer.
    – Gennaro Arguzzi
    Aug 8 at 17:06










  • "It's not an amount of a physical quantity, but a the logarithm of a ratio of two quantities in the same units, therefore unitless. " Hmm… but UnitConvert[Quantity[40, "AngularDegrees"], "Radians"] works.
    – xzczd
    Aug 8 at 17:12










  • @xzczd remember that with the Units package "The conversion of temperature units is different from most other unit conversions because it is not multiplicative. This is simply because the zeros of various systems are set at different values. For example, zero degrees Centigrade is the same as 32 degrees Fahrenheit." so you had to use ConvertTemperature instead of Convert. Is not that there are no ways around, but these are special cases. And radians is closer to the idea of a units, as they are amounts of $pi$
    – rhermans
    Aug 8 at 17:17











  • Well, "AngularDegrees" isn't a unit for temperature, it's a unit for angle, which is dimensionless. With this example I just want to illustrate that dimensionless or unitless doesn't seem to be a reason for the "failure" of Mathematica.
    – xzczd
    Aug 8 at 17:25







  • 1




    UnitConvert will call Internal`MWACompute["MWAToQuantity", name] to use WolframAlpha to assist with units when the unit name is not among the built-in ones. Now W|A can convert between decibels and bels, but UnitConvert cannot. So the call to W|A might only result in an IndependentUnit that cannot be converted.
    – Michael E2
    Aug 8 at 18:36













up vote
6
down vote



accepted







up vote
6
down vote



accepted






There is nothing in the documentation, and bellow you can see what you can find in the internal functions, of which nothing that seems to do the job. So the answer to your question is:



No, there is no built-in function to convert decibels to amplitude in Mathematica.




Speculation on "why"



We can only guess why the developers didn't implement this, a possible narrative may be similar to the case of the now deprecated Units Package. There the documentation said:




"The conversion of temperature units is different from most other unit
conversions because it is not multiplicative. This is simply because
the zeros of various systems are set at different values. For example,
zero degrees Centigrade is the same as 32 degrees Fahrenheit."




So you had to use ConvertTemperature instead of Convert. How is that similar? It's similar because both cases are somehow special. Wikipedia says




The decibel (symbol: dB) is a unit of measurement used to express the
ratio of one value of a physical property to another on a logarithmic
scale.




dB is NOT an amount of a physical quantity, but a the logarithm of a ratio of two quantities in the same units, therefore unitless and non-linear. Also depending if the you are talking about amplitudes or power (amplitude squared) the factors are 20 or 10.



Therefore, non-linear relationship of something that arguably may not be even a unit with a potentially ambiguous definition... better leave it to the users to define their own, rather simple, solutions.




A solution



dB2lin[x_] := N[Power[10, x/20]];
lin2dB[x_] := N[20 Log10[x]];



Internal functions



Some functions with matching names



Names["*`*Decibel*", IgnoreCase -> True]
(* "Signal`Utils`decibelQ", "Signal`Utils`decibelQ$",
"CalculateUnits`UnitCommonSymbols`DecibelsMuUnit",
"CalculateUnits`UnitCommonSymbols`CalculateUnits`UnitCommonSymbols`
DecibelsMuUnit", "CalculateUnits`UnitCommonSymbols`DecibelsRUnit",
"CalculateUnits`UnitCommonSymbols`DecibelsVUnit",
"CalculateUnits`UnitCommonSymbols`DecibelsZUnit" *)

Names["*`db*"]
(* "Image`ColorOperationsDump`db",
"Image`ColorOperationsDump`Image`ColorOperationsDump`db",
"Predictions`Private`db",
"Predictions`Private`Predictions`Private`db",
"Statistics`Library`Dump`dbag", "Statistics`Library`Dump`dbag$",
"PacletManager`LayoutDocsCollection`Private`dbFile",
"System`FourierTransformDump`dbgPrintFT",
"Charting`ChartLabelingDump`dbgstyle",
"Charting`ChartLabelingDump`dbgstyle$",
"Charting`ChartLabelingDump`dbox", "Charting`dbPrint",
"Image`ColorOperationsDump`dbPrint", "Image`HumanDump`dbPrint",
"Image`SpatialOperationsDump`dbPrint",
"Visualization`VectorFields`VectorFieldsDump`dbPrint",
"Wavelets`WaveletUtilities`dbPrint",
"PacletManager`LayoutDocsCollection`Private`dbStrm",
"PacletManager`LayoutDocsCollection`Private`dbStrm$",
"Charting`CommonDump`dbstyle",
"Charting`ChartLabelingDump`dbTimingReap",
"Charting`ChartLabelingDump`dbVpp", "Charting`ParserDump`dbVpp",
"System`ListPointPlot3DDump`dbVpp",
"System`ListPointPlot3DDump`System`ListPointPlot3DDump`dbVpp" *)





share|improve this answer














There is nothing in the documentation, and bellow you can see what you can find in the internal functions, of which nothing that seems to do the job. So the answer to your question is:



No, there is no built-in function to convert decibels to amplitude in Mathematica.




Speculation on "why"



We can only guess why the developers didn't implement this, a possible narrative may be similar to the case of the now deprecated Units Package. There the documentation said:




"The conversion of temperature units is different from most other unit
conversions because it is not multiplicative. This is simply because
the zeros of various systems are set at different values. For example,
zero degrees Centigrade is the same as 32 degrees Fahrenheit."




So you had to use ConvertTemperature instead of Convert. How is that similar? It's similar because both cases are somehow special. Wikipedia says




The decibel (symbol: dB) is a unit of measurement used to express the
ratio of one value of a physical property to another on a logarithmic
scale.




dB is NOT an amount of a physical quantity, but a the logarithm of a ratio of two quantities in the same units, therefore unitless and non-linear. Also depending if the you are talking about amplitudes or power (amplitude squared) the factors are 20 or 10.



Therefore, non-linear relationship of something that arguably may not be even a unit with a potentially ambiguous definition... better leave it to the users to define their own, rather simple, solutions.




A solution



dB2lin[x_] := N[Power[10, x/20]];
lin2dB[x_] := N[20 Log10[x]];



Internal functions



Some functions with matching names



Names["*`*Decibel*", IgnoreCase -> True]
(* "Signal`Utils`decibelQ", "Signal`Utils`decibelQ$",
"CalculateUnits`UnitCommonSymbols`DecibelsMuUnit",
"CalculateUnits`UnitCommonSymbols`CalculateUnits`UnitCommonSymbols`
DecibelsMuUnit", "CalculateUnits`UnitCommonSymbols`DecibelsRUnit",
"CalculateUnits`UnitCommonSymbols`DecibelsVUnit",
"CalculateUnits`UnitCommonSymbols`DecibelsZUnit" *)

Names["*`db*"]
(* "Image`ColorOperationsDump`db",
"Image`ColorOperationsDump`Image`ColorOperationsDump`db",
"Predictions`Private`db",
"Predictions`Private`Predictions`Private`db",
"Statistics`Library`Dump`dbag", "Statistics`Library`Dump`dbag$",
"PacletManager`LayoutDocsCollection`Private`dbFile",
"System`FourierTransformDump`dbgPrintFT",
"Charting`ChartLabelingDump`dbgstyle",
"Charting`ChartLabelingDump`dbgstyle$",
"Charting`ChartLabelingDump`dbox", "Charting`dbPrint",
"Image`ColorOperationsDump`dbPrint", "Image`HumanDump`dbPrint",
"Image`SpatialOperationsDump`dbPrint",
"Visualization`VectorFields`VectorFieldsDump`dbPrint",
"Wavelets`WaveletUtilities`dbPrint",
"PacletManager`LayoutDocsCollection`Private`dbStrm",
"PacletManager`LayoutDocsCollection`Private`dbStrm$",
"Charting`CommonDump`dbstyle",
"Charting`ChartLabelingDump`dbTimingReap",
"Charting`ChartLabelingDump`dbVpp", "Charting`ParserDump`dbVpp",
"System`ListPointPlot3DDump`dbVpp",
"System`ListPointPlot3DDump`System`ListPointPlot3DDump`dbVpp" *)






share|improve this answer














share|improve this answer



share|improve this answer








edited Aug 8 at 17:53

























answered Aug 8 at 17:01









rhermans

21.6k439103




21.6k439103











  • Hello @rhermans, thank you for your extremely clear answer.
    – Gennaro Arguzzi
    Aug 8 at 17:06










  • "It's not an amount of a physical quantity, but a the logarithm of a ratio of two quantities in the same units, therefore unitless. " Hmm… but UnitConvert[Quantity[40, "AngularDegrees"], "Radians"] works.
    – xzczd
    Aug 8 at 17:12










  • @xzczd remember that with the Units package "The conversion of temperature units is different from most other unit conversions because it is not multiplicative. This is simply because the zeros of various systems are set at different values. For example, zero degrees Centigrade is the same as 32 degrees Fahrenheit." so you had to use ConvertTemperature instead of Convert. Is not that there are no ways around, but these are special cases. And radians is closer to the idea of a units, as they are amounts of $pi$
    – rhermans
    Aug 8 at 17:17











  • Well, "AngularDegrees" isn't a unit for temperature, it's a unit for angle, which is dimensionless. With this example I just want to illustrate that dimensionless or unitless doesn't seem to be a reason for the "failure" of Mathematica.
    – xzczd
    Aug 8 at 17:25







  • 1




    UnitConvert will call Internal`MWACompute["MWAToQuantity", name] to use WolframAlpha to assist with units when the unit name is not among the built-in ones. Now W|A can convert between decibels and bels, but UnitConvert cannot. So the call to W|A might only result in an IndependentUnit that cannot be converted.
    – Michael E2
    Aug 8 at 18:36

















  • Hello @rhermans, thank you for your extremely clear answer.
    – Gennaro Arguzzi
    Aug 8 at 17:06










  • "It's not an amount of a physical quantity, but a the logarithm of a ratio of two quantities in the same units, therefore unitless. " Hmm… but UnitConvert[Quantity[40, "AngularDegrees"], "Radians"] works.
    – xzczd
    Aug 8 at 17:12










  • @xzczd remember that with the Units package "The conversion of temperature units is different from most other unit conversions because it is not multiplicative. This is simply because the zeros of various systems are set at different values. For example, zero degrees Centigrade is the same as 32 degrees Fahrenheit." so you had to use ConvertTemperature instead of Convert. Is not that there are no ways around, but these are special cases. And radians is closer to the idea of a units, as they are amounts of $pi$
    – rhermans
    Aug 8 at 17:17











  • Well, "AngularDegrees" isn't a unit for temperature, it's a unit for angle, which is dimensionless. With this example I just want to illustrate that dimensionless or unitless doesn't seem to be a reason for the "failure" of Mathematica.
    – xzczd
    Aug 8 at 17:25







  • 1




    UnitConvert will call Internal`MWACompute["MWAToQuantity", name] to use WolframAlpha to assist with units when the unit name is not among the built-in ones. Now W|A can convert between decibels and bels, but UnitConvert cannot. So the call to W|A might only result in an IndependentUnit that cannot be converted.
    – Michael E2
    Aug 8 at 18:36
















Hello @rhermans, thank you for your extremely clear answer.
– Gennaro Arguzzi
Aug 8 at 17:06




Hello @rhermans, thank you for your extremely clear answer.
– Gennaro Arguzzi
Aug 8 at 17:06












"It's not an amount of a physical quantity, but a the logarithm of a ratio of two quantities in the same units, therefore unitless. " Hmm… but UnitConvert[Quantity[40, "AngularDegrees"], "Radians"] works.
– xzczd
Aug 8 at 17:12




"It's not an amount of a physical quantity, but a the logarithm of a ratio of two quantities in the same units, therefore unitless. " Hmm… but UnitConvert[Quantity[40, "AngularDegrees"], "Radians"] works.
– xzczd
Aug 8 at 17:12












@xzczd remember that with the Units package "The conversion of temperature units is different from most other unit conversions because it is not multiplicative. This is simply because the zeros of various systems are set at different values. For example, zero degrees Centigrade is the same as 32 degrees Fahrenheit." so you had to use ConvertTemperature instead of Convert. Is not that there are no ways around, but these are special cases. And radians is closer to the idea of a units, as they are amounts of $pi$
– rhermans
Aug 8 at 17:17





@xzczd remember that with the Units package "The conversion of temperature units is different from most other unit conversions because it is not multiplicative. This is simply because the zeros of various systems are set at different values. For example, zero degrees Centigrade is the same as 32 degrees Fahrenheit." so you had to use ConvertTemperature instead of Convert. Is not that there are no ways around, but these are special cases. And radians is closer to the idea of a units, as they are amounts of $pi$
– rhermans
Aug 8 at 17:17













Well, "AngularDegrees" isn't a unit for temperature, it's a unit for angle, which is dimensionless. With this example I just want to illustrate that dimensionless or unitless doesn't seem to be a reason for the "failure" of Mathematica.
– xzczd
Aug 8 at 17:25





Well, "AngularDegrees" isn't a unit for temperature, it's a unit for angle, which is dimensionless. With this example I just want to illustrate that dimensionless or unitless doesn't seem to be a reason for the "failure" of Mathematica.
– xzczd
Aug 8 at 17:25





1




1




UnitConvert will call Internal`MWACompute["MWAToQuantity", name] to use WolframAlpha to assist with units when the unit name is not among the built-in ones. Now W|A can convert between decibels and bels, but UnitConvert cannot. So the call to W|A might only result in an IndependentUnit that cannot be converted.
– Michael E2
Aug 8 at 18:36





UnitConvert will call Internal`MWACompute["MWAToQuantity", name] to use WolframAlpha to assist with units when the unit name is not among the built-in ones. Now W|A can convert between decibels and bels, but UnitConvert cannot. So the call to W|A might only result in an IndependentUnit that cannot be converted.
– Michael E2
Aug 8 at 18:36


















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f179697%2fconvert-decibels-to-amplitude-built-in-function%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?