Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
tape_loss.hpp File Reference
#include <pulp/signal/character_delay/primitives.hpp>
#include <pulp/signal/character_delay/tables.hpp>
#include <pulp/signal/fft.hpp>
#include <pulp/signal/windowed_sinc_design.hpp>
#include <algorithm>
#include <array>
#include <cmath>
#include <complex>
#include <cstddef>
#include <numeric>
#include <vector>

Go to the source code of this file.

Classes

struct  pulp::signal::chardelay::TapeLossGeometry
 Head/tape geometry for the Wallace loss model. All lengths in metres. More...
struct  pulp::signal::chardelay::LossShape< Poles, Shelves >
 One fitted cascade in dimensionless frequency: corners are in units of the shape's own normalized variable and become hertz when multiplied by that term's scale factor. More...
struct  pulp::signal::chardelay::TapeLossIirParams
 The realized cascade's parameters in hertz, poles and shelves from both shapes concatenated. More...
struct  pulp::signal::chardelay::TapeLossShapes
 Fit both dimensionless shapes. More...
class  pulp::signal::chardelay::TapeLossIir
 The realized IIR cascade for one channel. More...
class  pulp::signal::chardelay::TapeLossDesign
 Everything designed for one tape speed: the gap FIR (speed-only) and the scaled IIR parameters, which are a pure function of geometry once the dimensionless shapes are fitted. More...
class  pulp::signal::chardelay::TapeLossStage
 One complete, independently-stateful loss filter: the gap FIR followed by the fitted IIR tilt. More...

Namespaces

namespace  pulp
namespace  pulp::signal
namespace  pulp::signal::chardelay
namespace  pulp::signal::chardelay::detail

Typedefs

using pulp::signal::chardelay::SpacingShape = LossShape<kSpacingPoleSections, kSpacingShelfSections>
using pulp::signal::chardelay::ThicknessShape = LossShape<kThicknessPoleSections, kThicknessShelfSections>
using pulp::signal::chardelay::detail::LossSearchVector = std::array<double, kLossSearchDimension>

Functions

double pulp::signal::chardelay::tape_wavenumber (double frequency_hz, double speed_ips) noexcept
double pulp::signal::chardelay::tape_loss_smooth_magnitude (double frequency_hz, const TapeLossGeometry &geometry) noexcept
 The smooth tilt: spacing × thickness. Carried by the IIR cascade.
double pulp::signal::chardelay::tape_loss_gap_magnitude (double frequency_hz, const TapeLossGeometry &geometry) noexcept
 The gap null. Carried by the minimum-phase FIR.
double pulp::signal::chardelay::tape_loss_magnitude (double frequency_hz, const TapeLossGeometry &geometry) noexcept
 The complete modeled response.
double pulp::signal::chardelay::tape_loss_magnitude_floored (double frequency_hz, const TapeLossGeometry &geometry) noexcept
 The response the realization actually targets, floor included.
double pulp::signal::chardelay::tape_loss_iir_magnitude_db (const TapeLossIirParams &parameters, double frequency_hz) noexcept
 Magnitude of the cascade, in dB. Used by the fitter and by tests.
double pulp::signal::chardelay::spacing_shape_db (double x) noexcept
 The two dimensionless targets, in dB, as functions of their own normalized frequency.
double pulp::signal::chardelay::thickness_shape_db (double x) noexcept
template<std::size_t Poles, std::size_t Shelves, typename Target>
LossShape< Poles, Shelves > pulp::signal::chardelay::detail::fit_loss_shape (Target &&target)
 Generic fit of Poles one-poles and Shelves first-order shelves to a dimensionless target, minimizing the WORST error in dB over log-spaced points.
const TapeLossShapes & pulp::signal::chardelay::tape_loss_shapes ()
 The process-wide fitted shapes.
TapeLossShapes pulp::signal::chardelay::fit_tape_loss_shapes ()
 The offline derivation.
std::size_t pulp::signal::chardelay::tape_gap_fir_taps (double fs)
 FIR length at a given sample rate: the specified order at 48 kHz, scaled with the rate so the filter spans the same amount of TIME on every host.
std::vector< double > pulp::signal::chardelay::design_tape_gap_fir (double fs, std::size_t taps, const TapeLossGeometry &geometry)
 Design a minimum-phase FIR realizing the GAP term only.

Variables

constexpr double pulp::signal::chardelay::kTapeLossFloorDb = -60.0
 Floor applied to a modeled loss magnitude before anything is fitted to it.