dB to kPa conversion method in UAN module

32 views
Skip to first unread message

huiyong dong

unread,
Jul 23, 2024, 5:50:57 AM (4 days ago) Jul 23
to ns-3-users
Declaration:
    /**
     * Convert dB to kilopascals.
     *
     *   \f[{\rm{kPa}} = {10^{\frac{{{\rm{dB}}}}{{10}}}}\f]
     *
     * \param db Signal level in dB.
     * \return Sound pressure in kPa.
     */
    double DbToKp(double db);
Definition
double
UanPhyGen::DbToKp(double db)
{
    return std::pow(10, db / 10.0);
}

According to Sound pressure - Wikipedia, the implementation is wrong and the correct one should be std::pow(10, db / 20.0). The unit should be uPa.
Am I right?

Message has been deleted

Tommaso Pecorella

unread,
Jul 23, 2024, 8:42:57 PM (4 days ago) Jul 23
to ns-3-users
Dunno why the previous message was deleted.

Please open an issue in our tracker: https://gitlab.com/nsnam/ns-3-dev/-/issues
Reply all
Reply to author
Forward
0 new messages