DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
Loading...
Searching...
No Matches
dspark::Hysteresis< T > Class Template Reference

Per-channel Jiles-Atherton hysteresis processor (field in, M out). More...

#include <Hysteresis.h>

Public Member Functions

void prepare (double sampleRate)
 Prepares the integrator for the given sample rate.
 
void reset () noexcept
 Clears magnetization and integrator state. RT-safe.
 
void setParameters (double ms, double a, double alpha, double k, double c) noexcept
 Sets the Jiles-Atherton parameters.
 
double getSaturation () const noexcept
 Saturation magnetization Ms (A/m).
 
double getSmallSignalSusceptibility () const noexcept
 Small-signal susceptibility dM/dH around the demagnetized state.
 
processSample (T fieldH) noexcept
 Processes one sample of applied field H, returns magnetization M.
 

Detailed Description

template<FloatType T>
class dspark::Hysteresis< T >

Per-channel Jiles-Atherton hysteresis processor (field in, M out).

Template Parameters
TSample type of the audio interface (internal math is double).

Definition at line 57 of file Hysteresis.h.

Member Function Documentation

◆ getSaturation()

template<FloatType T>
double dspark::Hysteresis< T >::getSaturation ( ) const
inlinenoexcept

Saturation magnetization Ms (A/m).

Definition at line 100 of file Hysteresis.h.

◆ getSmallSignalSusceptibility()

template<FloatType T>
double dspark::Hysteresis< T >::getSmallSignalSusceptibility ( ) const
inlinenoexcept

Small-signal susceptibility dM/dH around the demagnetized state.

The reversible-branch slope c*chi_an/(1 - c*alpha*chi_an), chi_an = Ms/(3a). Used by consumers (TapeMachine) for exact small-signal gain makeup.

Definition at line 108 of file Hysteresis.h.

◆ prepare()

template<FloatType T>
void dspark::Hysteresis< T >::prepare ( double  sampleRate)
inline

Prepares the integrator for the given sample rate.

Definition at line 61 of file Hysteresis.h.

◆ processSample()

template<FloatType T>
T dspark::Hysteresis< T >::processSample ( fieldH)
inlinenoexcept

Processes one sample of applied field H, returns magnetization M.

Parameters
fieldHApplied magnetic field (A/m scale of the JA parameters).

Definition at line 118 of file Hysteresis.h.

◆ reset()

template<FloatType T>
void dspark::Hysteresis< T >::reset ( )
inlinenoexcept

Clears magnetization and integrator state. RT-safe.

Definition at line 70 of file Hysteresis.h.

◆ setParameters()

template<FloatType T>
void dspark::Hysteresis< T >::setParameters ( double  ms,
double  a,
double  alpha,
double  k,
double  c 
)
inlinenoexcept

Sets the Jiles-Atherton parameters.

Defaults follow the audio-tape calibration from the DAFx literature.

Parameters
msSaturation magnetization (A/m). [3.5e5]
aAnhysteretic shape parameter (A/m). [2.2e4]
alphaInter-domain coupling. [1.6e-3]
kCoercivity / loop-loss parameter (A/m). [2.7e4]
cReversible magnetization fraction [0, 1). [1.7e-1]

Definition at line 89 of file Hysteresis.h.


The documentation for this class was generated from the following file: