Skip to main content

broadcast_loudness/
lib.rs

1#![cfg_attr(not(feature = "std"), no_std)]
2#![cfg_attr(docsrs, feature(doc_cfg))]
3#![warn(missing_docs)]
4#![doc = "\n## Runnable examples\n"]
5#![doc = "Run with `cargo run -p broadcast-loudness --example <name>`.\n"]
6#![doc = "\n### `measure_loudness`\n\n```rust,ignore"]
7#![doc = include_str!("../examples/measure_loudness.rs")]
8#![doc = "```\n\n### `measure_true_peak`\n\n```rust,ignore"]
9#![doc = include_str!("../examples/measure_true_peak.rs")]
10#![doc = "```"]
11
12extern crate alloc;
13
14mod channel_layout;
15mod error;
16mod filter;
17mod loudness_meter;
18mod true_peak;
19
20pub use channel_layout::ChannelLayout;
21pub use error::{Error, Result};
22pub use loudness_meter::LoudnessMeter;
23pub use true_peak::TruePeakMeter;
24
25pub mod kfilter {
26    //! K-weighting IIR filter coefficients + state (ITU-R BS.1770-5 §Annex 1).
27    //!
28    //! [`k_weighting_coeffs`] derives the two stage coefficients for any
29    //! sample rate via a bilinear transform; at 48 kHz they match the
30    //! BS.1770-5 Annex 1 tabulated coefficients. The [`crate::LoudnessMeter`]
31    //! applies them internally; re-exported here for consumers who need the
32    //! raw filter (e.g. visualising the frequency response).
33
34    pub use crate::filter::{BiquadCoeffs, BiquadState, apply_biquad, k_weighting_coeffs};
35}