# Path: pyphysim/util/conversion.py
# def linear2dBm(valueInLinear: NumberOrArray) -> NumberOrArray:
#     """
#     Convert input from linear to dBm scale.
# 
#     Parameters
#     ----------
#     valueInLinear : float | np.ndarray
#         Value in Linear scale
# 
#     Returns
#     -------
#     valueIndBm : float | np.ndarray
#         Value in dBm.
# 
#     Examples
#     --------
#     >>> linear2dBm(1000)
#     60.0
#     """
#     return linear2dB(valueInLinear * 1000.)


from typing import cast
from ..util.conversion import linear2dBm
import scipy.constants
#!/usr/bin/env python

# pylint: disable=E1103




def calc_thermal_noise_power_dBm(T: float, delta_f: float) -> float:
    """
    Calculate the thermal noise power (in dBm) for the given room temperature
    `T` (in Cº) and bandwidth `delta_f` (in Hz).

    Parameters
    ----------
    T : float
        Room temperature in Cesium degrees.
    delta_f : float
        Bandwidth in Hz.

    Returns
    -------
    noise_var : float
        The noise power.
    """
    # Boltzmann constant
    B = cast(float, scipy.constants.Boltzmann)
    K = T + 273.0
    noise_power = B * K * delta_f

# Path: pyphysim/util/conversion.py
# def linear2dBm(valueInLinear: NumberOrArray) -> NumberOrArray:
#     """
#     Convert input from linear to dBm scale.
# 
#     Parameters
#     ----------
#     valueInLinear : float | np.ndarray
#         Value in Linear scale
# 
#     Returns
#     -------
#     valueIndBm : float | np.ndarray
#         Value in dBm.
# 
#     Examples
#     --------
#     >>> linear2dBm(1000)
#     60.0
#     """
#     return linear2dB(valueInLinear * 1000.)


# Path: pyphysim/channels/noise.py
from typing import cast
from ..util.conversion import linear2dBm
import scipy.constants

#!/usr/bin/env python

# pylint: disable=E1103




def calc_thermal_noise_power_dBm(T: float, delta_f: float) -> float:
    """
    Calculate the thermal noise power (in dBm) for the given room temperature
    `T` (in Cº) and bandwidth `delta_f` (in Hz).

    Parameters
    ----------
    T : float
        Room temperature in Cesium degrees.
    delta_f : float
        Bandwidth in Hz.

    Returns
    -------
    noise_var : float
        The noise power.
    """
    # Boltzmann constant
    B = cast(float, scipy.constants.Boltzmann)
    K = T + 273.0
    noise_power = B * K * delta_f

    noise_power_dBm = linear2dBm(noise_power)