[][src]Struct bs1770::Power

pub struct Power(pub f32);

The mean of the squares of the K-weighted samples in a window of time.

K-weighted power is equivalent to K-weighted loudness, the only difference is one of scale: power is quadratic in sample amplitudes, whereas loudness units are logarithmic. loudness_lkfs and from_lkfs convert between power, and K-weighted Loudness Units relative to nominal Full Scale (LKFS).

The term “LKFS” (Loudness Units, K-Weighted, relative to nominal Full Scale) is used in BS.1770-4 to emphasize K-weighting, but the term is otherwise interchangeable with the more widespread term “LUFS” (Loudness Units, relative to Full Scale). Loudness units are related to decibels in the following sense: boosting a signal that has a loudness of -LK LUFS by LK dB (by multiplying the amplitude by 10LK/20) will bring the loudness to 0 LUFS.

K-weighting refers to a high-shelf and high-pass filter that model the effect that humans perceive a certain amount of power in low frequencies to be less loud than the same amount of power in higher frequencies. In this library the Power type is used exclusively to refer to power after applying K-weighting.

The nominal “full scale” is the range [-1.0, 1.0]. Because the power is the mean square of the samples, if no input samples exceeded the full scale, the power will be in the range [0.0, 1.0]. However, the power delivered by multiple channels, which is a weighted sum over individual channel powers, can exceed this range, because the weighted sum is not normalized.

Implementations

impl Power[src]

pub fn from_lkfs(lkfs: f32) -> Power[src]

Convert Loudness Units relative to Full Scale into a squared sample amplitude.

This is the inverse of loudness_lkfs.

pub fn loudness_lkfs(&self) -> f32[src]

Return the loudness of this window in Loudness Units, K-weighted, relative to Full Scale.

This is the inverse of from_lkfs.

Trait Implementations

impl Clone for Power[src]

impl Copy for Power[src]

impl PartialEq<Power> for Power[src]

impl PartialOrd<Power> for Power[src]

impl StructuralPartialEq for Power[src]

Auto Trait Implementations

impl RefUnwindSafe for Power

impl Send for Power

impl Sync for Power

impl Unpin for Power

impl UnwindSafe for Power

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.