diff --git a/playback/src/config.rs b/playback/src/config.rs index 85449eb48..e2fafda29 100644 --- a/playback/src/config.rs +++ b/playback/src/config.rs @@ -4,9 +4,7 @@ pub use crate::dither::{mk_ditherer, DithererBuilder, TriangularDitherer}; use crate::{ convert::i24, - filter_coefficients::{ - HZ48000_HIGH, HZ48000_LOW, HZ88200_HIGH, HZ88200_LOW, HZ96000_HIGH, HZ96000_LOW, - }, + filter_coefficients::{HZ48000_COEFFICIENTS, HZ88200_COEFFICIENTS, HZ96000_COEFFICIENTS}, RESAMPLER_INPUT_SIZE, SAMPLE_RATE, }; @@ -33,69 +31,6 @@ const HZ88200_INTERPOLATION_OUTPUT_SIZE: usize = const HZ96000_INTERPOLATION_OUTPUT_SIZE: usize = (RESAMPLER_INPUT_SIZE as f64 * (1.0 / HZ96000_RESAMPLE_FACTOR_RECIPROCAL)) as usize; -#[derive(Clone, Copy, Debug, Default)] -pub enum InterpolationQuality { - Low, - #[default] - High, -} - -impl FromStr for InterpolationQuality { - type Err = (); - - fn from_str(s: &str) -> Result { - use InterpolationQuality::*; - - match s.to_lowercase().as_ref() { - "low" => Ok(Low), - "high" => Ok(High), - _ => Err(()), - } - } -} - -impl std::fmt::Display for InterpolationQuality { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - use InterpolationQuality::*; - - match self { - Low => write!(f, "Low"), - High => write!(f, "High"), - } - } -} - -impl InterpolationQuality { - pub fn get_interpolation_coefficients( - &self, - mut coefficients: Vec, - resample_factor_reciprocal: f64, - ) -> Vec { - let mut coefficient_sum = 0.0; - - for (index, coefficient) in coefficients.iter_mut().enumerate() { - *coefficient *= Self::sinc((index as f64 * resample_factor_reciprocal).fract()); - - coefficient_sum += *coefficient; - } - - coefficients - .iter_mut() - .for_each(|coefficient| *coefficient /= coefficient_sum); - - coefficients - } - - fn sinc(x: f64) -> f64 { - if x.abs() < f64::EPSILON { - 1.0 - } else { - let pi_x = std::f64::consts::PI * x; - pi_x.sin() / pi_x - } - } -} - #[derive(Clone, Copy, Debug, Default)] pub enum SampleRate { #[default] @@ -152,14 +87,6 @@ impl std::fmt::Display for SampleRate { } } -#[derive(Debug, Default)] -pub struct ResampleSpec { - pub resample_factor_reciprocal: f64, - pub interpolation_output_size: usize, - pub high_coefficients: Vec, - pub low_coefficients: Vec, -} - impl SampleRate { pub fn as_u32(&self) -> u32 { use SampleRate::*; @@ -207,41 +134,73 @@ impl SampleRate { } } - pub fn get_resample_spec(&self) -> ResampleSpec { + pub fn get_resample_factor_reciprocal(&self) -> Option { + use SampleRate::*; + + match self { + Hz44100 => None, + Hz48000 => Some(HZ48000_RESAMPLE_FACTOR_RECIPROCAL), + Hz88200 => Some(HZ88200_RESAMPLE_FACTOR_RECIPROCAL), + Hz96000 => Some(HZ96000_RESAMPLE_FACTOR_RECIPROCAL), + } + } + + pub fn get_interpolation_output_size(&self) -> Option { use SampleRate::*; match self { - // Dummy values to satisfy - // the match statement. - // 44.1kHz will be bypassed. - Hz44100 => { - warn!("Resampling 44.1kHz to 44.1kHz is just a really CPU intensive no-op, you should not be doing it"); - - ResampleSpec { - resample_factor_reciprocal: 1.0, - interpolation_output_size: RESAMPLER_INPUT_SIZE, - high_coefficients: vec![], - low_coefficients: vec![], - } - } - Hz48000 => ResampleSpec { - resample_factor_reciprocal: HZ48000_RESAMPLE_FACTOR_RECIPROCAL, - interpolation_output_size: HZ48000_INTERPOLATION_OUTPUT_SIZE, - high_coefficients: HZ48000_HIGH.to_vec(), - low_coefficients: HZ48000_LOW.to_vec(), - }, - Hz88200 => ResampleSpec { - resample_factor_reciprocal: HZ88200_RESAMPLE_FACTOR_RECIPROCAL, - interpolation_output_size: HZ88200_INTERPOLATION_OUTPUT_SIZE, - high_coefficients: HZ88200_HIGH.to_vec(), - low_coefficients: HZ88200_LOW.to_vec(), - }, - Hz96000 => ResampleSpec { - resample_factor_reciprocal: HZ96000_RESAMPLE_FACTOR_RECIPROCAL, - interpolation_output_size: HZ96000_INTERPOLATION_OUTPUT_SIZE, - high_coefficients: HZ96000_HIGH.to_vec(), - low_coefficients: HZ96000_LOW.to_vec(), - }, + Hz44100 => None, + Hz48000 => Some(HZ48000_INTERPOLATION_OUTPUT_SIZE), + Hz88200 => Some(HZ88200_INTERPOLATION_OUTPUT_SIZE), + Hz96000 => Some(HZ96000_INTERPOLATION_OUTPUT_SIZE), + } + } + + pub fn get_interpolation_coefficients(&self) -> Option> { + use SampleRate::*; + + match self { + Hz44100 => None, + Hz48000 => Some(Self::calculate_interpolation_coefficients( + HZ48000_COEFFICIENTS.to_vec(), + HZ48000_RESAMPLE_FACTOR_RECIPROCAL, + )), + Hz88200 => Some(Self::calculate_interpolation_coefficients( + HZ88200_COEFFICIENTS.to_vec(), + HZ88200_RESAMPLE_FACTOR_RECIPROCAL, + )), + Hz96000 => Some(Self::calculate_interpolation_coefficients( + HZ96000_COEFFICIENTS.to_vec(), + HZ96000_RESAMPLE_FACTOR_RECIPROCAL, + )), + } + } + + fn calculate_interpolation_coefficients( + mut coefficients: Vec, + resample_factor_reciprocal: f64, + ) -> Vec { + let mut coefficient_sum = 0.0; + + for (index, coefficient) in coefficients.iter_mut().enumerate() { + *coefficient *= Self::sinc((index as f64 * resample_factor_reciprocal).fract()); + + coefficient_sum += *coefficient; + } + + coefficients + .iter_mut() + .for_each(|coefficient| *coefficient /= coefficient_sum); + + coefficients + } + + fn sinc(x: f64) -> f64 { + if x.abs() < f64::EPSILON { + 1.0 + } else { + let pi_x = std::f64::consts::PI * x; + pi_x.sin() / pi_x } } } @@ -361,7 +320,6 @@ pub struct PlayerConfig { pub gapless: bool, pub passthrough: bool, - pub interpolation_quality: InterpolationQuality, pub sample_rate: SampleRate, pub normalisation: bool, @@ -384,7 +342,6 @@ impl Default for PlayerConfig { bitrate: Bitrate::default(), gapless: true, normalisation: false, - interpolation_quality: InterpolationQuality::default(), sample_rate: SampleRate::default(), normalisation_type: NormalisationType::default(), normalisation_method: NormalisationMethod::default(), diff --git a/playback/src/filter_coefficients.rs b/playback/src/filter_coefficients.rs index 96a2c42b7..dee8a64bf 100644 --- a/playback/src/filter_coefficients.rs +++ b/playback/src/filter_coefficients.rs @@ -1,1187 +1,1344 @@ // All Windows calculated with pyfda (Python Filter Design Analysis Tool) // https://github.com/chipmuenk/pyfda // Window = Kaiser -// beta = 8.6 (Similar to a Blackman Window) -// fc = 22.5kHz -// -86dB by 23kHz +// beta = 15 +// fc = 22.8kHz +// -140dB well before 24kHz +// The assumption is that the input +// is anti-aliased properly, +// We just want to make sure interpolation +// doesn't add any artifacts. #[allow(clippy::excessive_precision)] -pub const HZ48000_HIGH: [f64; 257] = [ - -1.4287799853519804e-19, - -8.529928242661527e-07, - 2.1395999264221267e-06, - -3.880458963785995e-06, - 6.05893601403254e-06, - -8.613527303281799e-06, - 1.1432294466108613e-05, - -1.4350136921309217e-05, - 1.7149627991629572e-05, - -1.956600058898423e-05, - 2.1296664705444228e-05, - -2.201537812656286e-05, - 2.1390883855947267e-05, - -1.9109487313809015e-05, - 1.490069206906713e-05, - -8.564666558168402e-06, - -2.4187562985455694e-19, - 1.0770051522629687e-05, - -2.357480377576126e-05, - 3.80789154370508e-05, - -5.37726902353467e-05, - 6.997172608513909e-05, - -8.582740473543781e-05, - 0.0001003492559243388, - -0.00011243964464523357, - 0.00012094053924787859, - -0.0001246913509069703, - 0.00012259602869291528, - -0.00011369679289372431, - 9.725114087319391e-05, - -7.280811540502643e-05, - 4.027933539700687e-05, - -8.761722338284784e-19, - -4.7224970562679786e-05, - 0.0001000942700094669, - -0.00015680711547266284, - 0.00021508702286534775, - -0.00027223465216542913, - 0.00032521058924288055, - -0.00037074739096535606, - 0.00040548854166410335, - -0.00042615022958145474, - 0.0004297001408507999, - -0.00041354588242148774, - 0.00037572428338265103, - -0.0003150817831073127, - 0.00023143548325566652, - -0.00012570429408715404, - 8.736848542712518e-18, - 0.00014233096258373752, - -0.00029672267470682895, - 0.00045746741021428363, - -0.0006178587763843014, - 0.0007704002699025563, - -0.0009070758950716863, - 0.0010196760363510072, - -0.001100168333253743, - 0.0011411000481453986, - -0.0011360155279515375, - 0.0010798700171927062, - -0.0009694194473815131, - 0.0008035650497546995, - -0.0005836318265664195, - 0.0003135611435773604, - -3.649849800074037e-17, - -0.0003477271314898191, - 0.0007177736996011124, - -0.0010960583702874734, - 0.0014666830951029159, - -0.0018124745987316703, - 0.0021156355406508768, - -0.0023584853377038536, - 0.002524264795160409, - -0.0025979735902941564, - 0.0025672055778467244, - -0.002422944105830126, - 0.0021602782649567656, - -0.0017790014114850766, - 0.001284055499878637, - -0.0006857887606066072, - 7.209995999923543e-18, - 0.000752249860282943, - -0.0015450696726810457, - 0.0023484142653889145, - -0.003128995352023552, - 0.00385140677724417, - -0.004479433137231434, - 0.004977500880593015, - -0.005312222191564676, - 0.005453974732678532, - -0.005378455081534177, - 0.005068140772503758, - -0.004513595500789128, - 0.003714554414731469, - -0.0026807315526779464, - 0.0014322992948101853, - -8.297338214945322e-17, - -0.001575137531433456, - 0.003242489907858635, - -0.004942936992960944, - 0.006610347331237228, - -0.008173416627546943, - 0.009557809308226558, - -0.010688539065884867, - 0.011492512118343826, - -0.011901147266026046, - 0.01185298019699458, - -0.011296156240663045, - 0.01019071615665419, - -0.00851058366772981, - 0.006245171256720193, - -0.0034005320447053696, - 1.0063905996254467e-16, - 0.003915722194550309, - -0.008289049174613953, - 0.013046573943979376, - -0.01810068406300195, - 0.023351692368405477, - -0.02869042197225499, - 0.03400116752010972, - -0.03916493952679325, - 0.044062886688337265, - -0.04857978290438118, - 0.052607461706064784, - -0.056048081078209105, - 0.058817106327538726, - -0.06084590754218613, - 0.06208388100251895, - 0.9375003025680546, - 0.06208388100251895, - -0.06084590754218613, - 0.058817106327538726, - -0.056048081078209105, - 0.052607461706064784, - -0.04857978290438118, - 0.044062886688337265, - -0.03916493952679325, - 0.03400116752010972, - -0.02869042197225499, - 0.023351692368405477, - -0.01810068406300195, - 0.013046573943979376, - -0.008289049174613953, - 0.003915722194550309, - 1.0063905996254467e-16, - -0.0034005320447053696, - 0.006245171256720193, - -0.00851058366772981, - 0.01019071615665419, - -0.011296156240663045, - 0.01185298019699458, - -0.011901147266026046, - 0.011492512118343826, - -0.010688539065884867, - 0.009557809308226558, - -0.008173416627546943, - 0.006610347331237228, - -0.004942936992960944, - 0.003242489907858635, - -0.001575137531433456, - -8.297338214945322e-17, - 0.0014322992948101853, - -0.0026807315526779464, - 0.003714554414731469, - -0.004513595500789128, - 0.005068140772503758, - -0.005378455081534177, - 0.005453974732678532, - -0.005312222191564676, - 0.004977500880593015, - -0.004479433137231434, - 0.00385140677724417, - -0.003128995352023552, - 0.0023484142653889145, - -0.0015450696726810457, - 0.000752249860282943, - 7.209995999923543e-18, - -0.0006857887606066072, - 0.001284055499878637, - -0.0017790014114850766, - 0.0021602782649567656, - -0.002422944105830126, - 0.0025672055778467244, - -0.0025979735902941564, - 0.002524264795160409, - -0.0023584853377038536, - 0.0021156355406508768, - -0.0018124745987316703, - 0.0014666830951029159, - -0.0010960583702874734, - 0.0007177736996011124, - -0.0003477271314898191, - -3.649849800074037e-17, - 0.0003135611435773604, - -0.0005836318265664195, - 0.0008035650497546995, - -0.0009694194473815131, - 0.0010798700171927062, - -0.0011360155279515375, - 0.0011411000481453986, - -0.001100168333253743, - 0.0010196760363510072, - -0.0009070758950716863, - 0.0007704002699025563, - -0.0006178587763843014, - 0.00045746741021428363, - -0.00029672267470682895, - 0.00014233096258373752, - 8.736848542712518e-18, - -0.00012570429408715404, - 0.00023143548325566652, - -0.0003150817831073127, - 0.00037572428338265103, - -0.00041354588242148774, - 0.0004297001408507999, - -0.00042615022958145474, - 0.00040548854166410335, - -0.00037074739096535606, - 0.00032521058924288055, - -0.00027223465216542913, - 0.00021508702286534775, - -0.00015680711547266284, - 0.0001000942700094669, - -4.7224970562679786e-05, - -8.761722338284784e-19, - 4.027933539700687e-05, - -7.280811540502643e-05, - 9.725114087319391e-05, - -0.00011369679289372431, - 0.00012259602869291528, - -0.0001246913509069703, - 0.00012094053924787859, - -0.00011243964464523357, - 0.0001003492559243388, - -8.582740473543781e-05, - 6.997172608513909e-05, - -5.37726902353467e-05, - 3.80789154370508e-05, - -2.357480377576126e-05, - 1.0770051522629687e-05, - -2.4187562985455694e-19, - -8.564666558168402e-06, - 1.490069206906713e-05, - -1.9109487313809015e-05, - 2.1390883855947267e-05, - -2.201537812656286e-05, - 2.1296664705444228e-05, - -1.956600058898423e-05, - 1.7149627991629572e-05, - -1.4350136921309217e-05, - 1.1432294466108613e-05, - -8.613527303281799e-06, - 6.05893601403254e-06, - -3.880458963785995e-06, - 2.1395999264221267e-06, - -8.529928242661527e-07, - -1.4287799853519804e-19, +pub const HZ48000_COEFFICIENTS: [f64; 441] = [ + -8.771146084517915e-23, + 1.0570942208391173e-09, + -3.0666660745656922e-09, + 6.298083919549404e-09, + -1.1009494492149948e-08, + 1.7421987235394415e-08, + -2.5689109092988082e-08, + 3.5862674329115807e-08, + -4.7856266645529607e-08, + 6.140828902806317e-08, + -7.604685422793451e-08, + 9.105919616127095e-08, + -1.0546858823253603e-07, + 1.1802194634247329e-07, + -1.271913407105633e-07, + 1.3119251294318607e-07, + -1.280231690229821e-07, + 1.1552327779416195e-07, + -9.145883941617693e-08, + 5.362960091161619e-08, + -7.7217226107300735e-22, + -7.114875946245203e-08, + 1.6104911667095417e-07, + -2.7026527132156615e-07, + 3.985058614410556e-07, + -5.444396250307578e-07, + 7.055238955116609e-07, + -8.778569687571143e-07, + 1.0560662317828128e-06, + -1.2332443646663861e-06, + 1.4009458289943576e-06, + -1.5492551604686838e-06, + 1.6669372292816672e-06, + -1.7416775803496403e-06, + 1.760418204028636e-06, + -1.7097906350117925e-06, + 1.5766441855366919e-06, + -1.3486624782617763e-06, + 1.015056381074019e-06, + -5.673161244592637e-07, + 9.792562157691215e-20, + 6.884681756425475e-07, + -1.4950254408593126e-06, + 2.4112566283065856e-06, + -3.4227817199744546e-06, + 4.5087853828418386e-06, + -5.641730870612593e-06, + 6.787299186897442e-06, + -7.904591223857538e-06, + 8.946625393428547e-06, + -9.861155999917786e-06, + 1.059182828621353e-05, + -1.1079674832069601e-05, + 1.126494499675449e-05, + -1.1089244681251284e-05, + 1.0497948234446287e-05, + -9.442828331471874e-06, + 7.884833680573385e-06, + -5.796929105544363e-06, + 3.1668985925331214e-06, + -1.0267057094301908e-18, + -3.678648971030143e-06, + 7.82207956681534e-06, + -1.2360003045077198e-05, + 1.719798834414252e-05, + -2.221740239139365e-05, + 2.727621538905652e-05, + -3.221075420642931e-05, + 3.6838462372847274e-05, + -4.096169540744633e-05, + 4.4372545871397646e-05, + -4.6858654348383316e-05, + 4.8209921539750954e-05, + -4.8225994005681544e-05, + 4.6724353186234967e-05, + -4.354879574733261e-05, + 3.857805468230202e-05, + -3.1734276690489895e-05, + 2.2991043887561944e-05, + -1.2380608558550801e-05, + 1.0714892504045419e-18, + 1.3984336126251783e-05, + -2.933369198803881e-05, + 4.5736344959148374e-05, + -6.280915808675244e-05, + 8.010174059784683e-05, + -9.710330972590319e-05, + 0.00011325231780323752, + -0.00012794882111289484, + 0.00014056947148065392, + -0.00015048491054933942, + 0.00015707924308034133, + -0.0001597711628045901, + 0.00015803620591136328, + -0.0001514295170121378, + 0.00013960843420358319, + -0.0001223541374673828, + 9.95915616676161e-05, + -7.140675507600406e-05, + 3.806086941676025e-05, + 5.522292755457904e-18, + -4.213984402529341e-05, + 8.753326840947647e-05, + -0.00013517203082831053, + 0.0001838779481747696, + -0.00023232236376993098, + 0.00027905217036022, + -0.00032252217407439016, + 0.0003611333624045614, + -0.0003932764120704118, + 0.00041737954732315945, + -0.0004319596433444126, + 0.00043567527068183264, + -0.00042738020297625895, + 0.00040617576920780796, + -0.00037146033048375895, + 0.00032297410642885815, + -0.0002608375729289383, + 0.00018558170547350593, + -9.816845330568487e-05, + 6.397895727529846e-19, + 0.00010708440490237048, + -0.00022082497375172826, + 0.00033857186283733177, + -0.00045732982316766367, + 0.0005738168187053221, + -0.000684535969656674, + 0.0007858597238898489, + -0.0008741247047765545, + 0.000945735242783811, + -0.0009972731855902538, + 0.0010256112120681994, + -0.0010280265635201971, + 0.0010023118646185563, + -0.000946879548805299, + 0.0008608563389349595, + -0.0007441642719534753, + 0.0005975849020744005, + -0.00042280357297843214, + 0.00022243101557540356, + -3.474391490098325e-17, + -0.00024006465851531805, + 0.0004925037811490474, + -0.0007513095024493709, + 0.0010098384606174067, + -0.0012609511916318978, + 0.001497175575304658, + -0.0017108913477184788, + 0.00189453189460518, + -0.002040798799462615, + 0.0021428839636620438, + -0.002194693567447552, + 0.002191067722720476, + -0.0021279894003546954, + 0.0020027761127039494, + -0.001814247908162659, + 0.0015628654968098813, + -0.0012508327770007735, + 0.0008821586696520896, + -0.00046267398178344456, + -3.3039584853563575e-17, + 0.0004965333609844947, + -0.0010160207840665381, + 0.0015461657408802655, + -0.0020735138415665724, + 0.002583732114598345, + -0.0030619295805850155, + 0.0034930131304211584, + -0.0038620714583133555, + 0.004154778673084419, + -0.004357808253637993, + 0.004459247260332142, + -0.004449000192806269, + 0.004319171620808093, + -0.004064416725949453, + 0.003682249190367868, + -0.00317329645683304, + 0.0025414932599423837, + -0.0017942054777252078, + 0.0009422777573359167, + -7.350185540376589e-17, + -0.0010150103856962798, + 0.002082011577823492, + -0.0031774248180713193, + 0.00427520317347509, + -0.005347276351155804, + 0.006364064256720479, + -0.0072950500213230345, + 0.008109401423325797, + -0.008776628049842111, + 0.00926726022866957, + -0.009553534753966662, + 0.009610071764202605, + -0.009414526835002754, + 0.008948202440030514, + -0.008196603417779811, + 0.007149921958698993, + -0.005803438882712496, + 0.00415782958901113, + -0.0022193649952320592, + 8.812638424710787e-17, + 0.00248265554875482, + -0.005205485774200194, + 0.008140137239069204, + -0.011253403840824383, + 0.014507722254727249, + -0.017861769381184747, + 0.02127115074947851, + -0.024689166551051196, + 0.02806763998183295, + -0.031357790917889976, + 0.03451113667723182, + -0.0374804007687864, + 0.04022041012286698, + -0.04268896135026697, + 0.04484763709216705, + -0.04666255449128448, + 0.048105029215477144, + -0.04915214026651778, + 0.049787182966797176, + 0.9499999996921324, + 0.049787182966797176, + -0.04915214026651778, + 0.048105029215477144, + -0.04666255449128448, + 0.04484763709216705, + -0.04268896135026697, + 0.04022041012286698, + -0.0374804007687864, + 0.03451113667723182, + -0.031357790917889976, + 0.02806763998183295, + -0.024689166551051196, + 0.02127115074947851, + -0.017861769381184747, + 0.014507722254727249, + -0.011253403840824383, + 0.008140137239069204, + -0.005205485774200194, + 0.00248265554875482, + 8.812638424710787e-17, + -0.0022193649952320592, + 0.00415782958901113, + -0.005803438882712496, + 0.007149921958698993, + -0.008196603417779811, + 0.008948202440030514, + -0.009414526835002754, + 0.009610071764202605, + -0.009553534753966662, + 0.00926726022866957, + -0.008776628049842111, + 0.008109401423325797, + -0.0072950500213230345, + 0.006364064256720479, + -0.005347276351155804, + 0.00427520317347509, + -0.0031774248180713193, + 0.002082011577823492, + -0.0010150103856962798, + -7.350185540376589e-17, + 0.0009422777573359167, + -0.0017942054777252078, + 0.0025414932599423837, + -0.00317329645683304, + 0.003682249190367868, + -0.004064416725949453, + 0.004319171620808093, + -0.004449000192806269, + 0.004459247260332142, + -0.004357808253637993, + 0.004154778673084419, + -0.0038620714583133555, + 0.0034930131304211584, + -0.0030619295805850155, + 0.002583732114598345, + -0.0020735138415665724, + 0.0015461657408802655, + -0.0010160207840665381, + 0.0004965333609844947, + -3.3039584853563575e-17, + -0.00046267398178344456, + 0.0008821586696520896, + -0.0012508327770007735, + 0.0015628654968098813, + -0.001814247908162659, + 0.0020027761127039494, + -0.0021279894003546954, + 0.002191067722720476, + -0.002194693567447552, + 0.0021428839636620438, + -0.002040798799462615, + 0.00189453189460518, + -0.0017108913477184788, + 0.001497175575304658, + -0.0012609511916318978, + 0.0010098384606174067, + -0.0007513095024493709, + 0.0004925037811490474, + -0.00024006465851531805, + -3.474391490098325e-17, + 0.00022243101557540356, + -0.00042280357297843214, + 0.0005975849020744005, + -0.0007441642719534753, + 0.0008608563389349595, + -0.000946879548805299, + 0.0010023118646185563, + -0.0010280265635201971, + 0.0010256112120681994, + -0.0009972731855902538, + 0.000945735242783811, + -0.0008741247047765545, + 0.0007858597238898489, + -0.000684535969656674, + 0.0005738168187053221, + -0.00045732982316766367, + 0.00033857186283733177, + -0.00022082497375172826, + 0.00010708440490237048, + 6.397895727529846e-19, + -9.816845330568487e-05, + 0.00018558170547350593, + -0.0002608375729289383, + 0.00032297410642885815, + -0.00037146033048375895, + 0.00040617576920780796, + -0.00042738020297625895, + 0.00043567527068183264, + -0.0004319596433444126, + 0.00041737954732315945, + -0.0003932764120704118, + 0.0003611333624045614, + -0.00032252217407439016, + 0.00027905217036022, + -0.00023232236376993098, + 0.0001838779481747696, + -0.00013517203082831053, + 8.753326840947647e-05, + -4.213984402529341e-05, + 5.522292755457904e-18, + 3.806086941676025e-05, + -7.140675507600406e-05, + 9.95915616676161e-05, + -0.0001223541374673828, + 0.00013960843420358319, + -0.0001514295170121378, + 0.00015803620591136328, + -0.0001597711628045901, + 0.00015707924308034133, + -0.00015048491054933942, + 0.00014056947148065392, + -0.00012794882111289484, + 0.00011325231780323752, + -9.710330972590319e-05, + 8.010174059784683e-05, + -6.280915808675244e-05, + 4.5736344959148374e-05, + -2.933369198803881e-05, + 1.3984336126251783e-05, + 1.0714892504045419e-18, + -1.2380608558550801e-05, + 2.2991043887561944e-05, + -3.1734276690489895e-05, + 3.857805468230202e-05, + -4.354879574733261e-05, + 4.6724353186234967e-05, + -4.8225994005681544e-05, + 4.8209921539750954e-05, + -4.6858654348383316e-05, + 4.4372545871397646e-05, + -4.096169540744633e-05, + 3.6838462372847274e-05, + -3.221075420642931e-05, + 2.727621538905652e-05, + -2.221740239139365e-05, + 1.719798834414252e-05, + -1.2360003045077198e-05, + 7.82207956681534e-06, + -3.678648971030143e-06, + -1.0267057094301908e-18, + 3.1668985925331214e-06, + -5.796929105544363e-06, + 7.884833680573385e-06, + -9.442828331471874e-06, + 1.0497948234446287e-05, + -1.1089244681251284e-05, + 1.126494499675449e-05, + -1.1079674832069601e-05, + 1.059182828621353e-05, + -9.861155999917786e-06, + 8.946625393428547e-06, + -7.904591223857538e-06, + 6.787299186897442e-06, + -5.641730870612593e-06, + 4.5087853828418386e-06, + -3.4227817199744546e-06, + 2.4112566283065856e-06, + -1.4950254408593126e-06, + 6.884681756425475e-07, + 9.792562157691215e-20, + -5.673161244592637e-07, + 1.015056381074019e-06, + -1.3486624782617763e-06, + 1.5766441855366919e-06, + -1.7097906350117925e-06, + 1.760418204028636e-06, + -1.7416775803496403e-06, + 1.6669372292816672e-06, + -1.5492551604686838e-06, + 1.4009458289943576e-06, + -1.2332443646663861e-06, + 1.0560662317828128e-06, + -8.778569687571143e-07, + 7.055238955116609e-07, + -5.444396250307578e-07, + 3.985058614410556e-07, + -2.7026527132156615e-07, + 1.6104911667095417e-07, + -7.114875946245203e-08, + -7.7217226107300735e-22, + 5.362960091161619e-08, + -9.145883941617693e-08, + 1.1552327779416195e-07, + -1.280231690229821e-07, + 1.3119251294318607e-07, + -1.271913407105633e-07, + 1.1802194634247329e-07, + -1.0546858823253603e-07, + 9.105919616127095e-08, + -7.604685422793451e-08, + 6.140828902806317e-08, + -4.7856266645529607e-08, + 3.5862674329115807e-08, + -2.5689109092988082e-08, + 1.7421987235394415e-08, + -1.1009494492149948e-08, + 6.298083919549404e-09, + -3.0666660745656922e-09, + 1.0570942208391173e-09, + -8.771146084517915e-23, ]; #[allow(clippy::excessive_precision)] -pub const HZ88200_HIGH: [f64; 257] = [ - -2.7177973650537016e-06, - 2.615116391456718e-06, - 4.371253470079787e-06, - -4.527642205236769e-06, - -6.343166732321034e-06, - 7.206853357278462e-06, - 8.608531809529578e-06, - -1.0831207319855358e-05, - -1.11168738348255e-05, - 1.5597004565971875e-05, - 1.3787248972132889e-05, - -2.1716246512168148e-05, - -1.6503125021559895e-05, - 2.9413629227200937e-05, - 1.9107254724178818e-05, - -3.8922617925675015e-05, - -2.139666772922098e-05, - 5.04805630067818e-05, - 2.3117918532840763e-05, - -6.432283649476294e-05, - -2.396273660981686e-05, - 8.067598787603222e-05, - 2.3564231002785538e-05, - -9.974994011030785e-05, - -2.149380441843341e-05, - 0.00012172926954179013, - 1.7258931076241913e-05, - -0.00014676363699943706, - -1.030194790401862e-05, - 0.0001749574609349626, - 1.8686890713852827e-19, - -0.0002063589463295164, - 1.4333731499066454e-05, - 0.00024094860458611302, - -3.344740787382722e-05, - -0.0002786274189628284, - 5.814642716712084e-05, - 0.00031920482651865724, - -8.928776855240112e-05, - -0.0003623867002575848, - 0.0001277727488249831, - 0.0004077635233859557, - -0.00017453818403045162, - -0.00045479895057210033, - 0.0002305459825657413, - 0.000502818948057389, - -0.00029677123118056025, - -0.000551001694669649, - 0.00037418887145730905, - 0.0005983684084941591, - -0.00046375910077735565, - -0.0006437752384124257, - 0.0005664116676635973, - 0.0006859063251323009, - -0.0006830292658687915, - -0.0007232680918226466, - 0.0008144302637888361, - 0.000754184768991671, - -0.0009613510348663591, - -0.0007767950905092509, - 0.0011244281797910076, - 0.0007890500159662434, - -0.0013041809517326277, - -0.000788711236573936, - 0.0015009942108703117, - 0.00077335010432126, - -0.00171510224350985, - -0.0007403464826028671, - 0.0019465737836333772, - 0.0006868868445776879, - -0.002195298570445892, - -0.0006099607339225542, - 0.002460975764167073, - 0.0005063544381987515, - -0.002743104523907686, - -0.00037264038864942025, - 0.003040977026074337, - 0.00020516036410315268, - -0.0033536741696310896, - -1.7263210195899785e-18, - 0.0036800641761425457, - -0.0002470486740043912, - -0.004018804248416292, - 0.0005405410133353366, - 0.004368345402486541, - -0.000885455697808869, - -0.004726940534504569, - 0.0012873008119620815, - 0.005092655727810584, - -0.001752261157027223, - -0.005463384747140825, - 0.0022874024955170562, - 0.005836866607731414, - -0.002900955402436162, - -0.006210706048228085, - 0.0036027121698355103, - 0.006582396679029297, - -0.0044045872407267005, - -0.006949346523208571, - 0.005321419255211435, - 0.007308905616676035, - -0.00637213881767667, - -0.007658395288879785, - 0.007581505281049055, - 0.00799513870616462, - -0.008982757034954967, - -0.008316492227824646, - 0.010621782037025395, - 0.00861987710070591, - -0.012563926080135948, - -0.008902811002566763, - 0.01490560790319659, - 0.0091629389377553, - -0.017795223882502632, - -0.009398062991380806, - 0.021473342249052296, - 0.009606170460125666, - -0.026356732255292163, - -0.009785459899039199, - 0.033234410282523816, - 0.009934364653757865, - -0.04379972993086113, - -0.010051573486085123, - 0.06245943058441552, - 0.01013604794705137, - -0.1053787714300839, - -0.010187036204577683, - 0.31806791600342954, - 0.5102041545837825, - 0.31806791600342954, - -0.010187036204577683, - -0.1053787714300839, - 0.01013604794705137, - 0.06245943058441552, - -0.010051573486085123, - -0.04379972993086113, - 0.009934364653757865, - 0.033234410282523816, - -0.009785459899039199, - -0.026356732255292163, - 0.009606170460125666, - 0.021473342249052296, - -0.009398062991380806, - -0.017795223882502632, - 0.0091629389377553, - 0.01490560790319659, - -0.008902811002566763, - -0.012563926080135948, - 0.00861987710070591, - 0.010621782037025395, - -0.008316492227824646, - -0.008982757034954967, - 0.00799513870616462, - 0.007581505281049055, - -0.007658395288879785, - -0.00637213881767667, - 0.007308905616676035, - 0.005321419255211435, - -0.006949346523208571, - -0.0044045872407267005, - 0.006582396679029297, - 0.0036027121698355103, - -0.006210706048228085, - -0.002900955402436162, - 0.005836866607731414, - 0.0022874024955170562, - -0.005463384747140825, - -0.001752261157027223, - 0.005092655727810584, - 0.0012873008119620815, - -0.004726940534504569, - -0.000885455697808869, - 0.004368345402486541, - 0.0005405410133353366, - -0.004018804248416292, - -0.0002470486740043912, - 0.0036800641761425457, - -1.7263210195899785e-18, - -0.0033536741696310896, - 0.00020516036410315268, - 0.003040977026074337, - -0.00037264038864942025, - -0.002743104523907686, - 0.0005063544381987515, - 0.002460975764167073, - -0.0006099607339225542, - -0.002195298570445892, - 0.0006868868445776879, - 0.0019465737836333772, - -0.0007403464826028671, - -0.00171510224350985, - 0.00077335010432126, - 0.0015009942108703117, - -0.000788711236573936, - -0.0013041809517326277, - 0.0007890500159662434, - 0.0011244281797910076, - -0.0007767950905092509, - -0.0009613510348663591, - 0.000754184768991671, - 0.0008144302637888361, - -0.0007232680918226466, - -0.0006830292658687915, - 0.0006859063251323009, - 0.0005664116676635973, - -0.0006437752384124257, - -0.00046375910077735565, - 0.0005983684084941591, - 0.00037418887145730905, - -0.000551001694669649, - -0.00029677123118056025, - 0.000502818948057389, - 0.0002305459825657413, - -0.00045479895057210033, - -0.00017453818403045162, - 0.0004077635233859557, - 0.0001277727488249831, - -0.0003623867002575848, - -8.928776855240112e-05, - 0.00031920482651865724, - 5.814642716712084e-05, - -0.0002786274189628284, - -3.344740787382722e-05, - 0.00024094860458611302, - 1.4333731499066454e-05, - -0.0002063589463295164, - 1.8686890713852827e-19, - 0.0001749574609349626, - -1.030194790401862e-05, - -0.00014676363699943706, - 1.7258931076241913e-05, - 0.00012172926954179013, - -2.149380441843341e-05, - -9.974994011030785e-05, - 2.3564231002785538e-05, - 8.067598787603222e-05, - -2.396273660981686e-05, - -6.432283649476294e-05, - 2.3117918532840763e-05, - 5.04805630067818e-05, - -2.139666772922098e-05, - -3.8922617925675015e-05, - 1.9107254724178818e-05, - 2.9413629227200937e-05, - -1.6503125021559895e-05, - -2.1716246512168148e-05, - 1.3787248972132889e-05, - 1.5597004565971875e-05, - -1.11168738348255e-05, - -1.0831207319855358e-05, - 8.608531809529578e-06, - 7.206853357278462e-06, - -6.343166732321034e-06, - -4.527642205236769e-06, - 4.371253470079787e-06, - 2.615116391456718e-06, - -2.7177973650537016e-06, +pub const HZ88200_COEFFICIENTS: [f64; 441] = [ + -3.0915687919410175e-09, + -4.380355015683147e-09, + 7.889301672202866e-09, + 7.814782506112341e-09, + -1.601722660647997e-08, + -1.162897576000204e-08, + 2.875448571604994e-08, + 1.510435454511938e-08, + -4.758343509079679e-08, + -1.7052240013897604e-08, + 7.414020115596361e-08, + 1.5685867044913693e-08, + -1.1013103295646797e-07, + -8.486685443549004e-09, + 1.5720816822680103e-07, + -7.927830161980731e-09, + -2.1679956837762108e-07, + 3.792557598966923e-08, + 2.898880068451338e-07, + -8.695906085997518e-08, + -3.767366685630587e-07, + 1.6162916242945288e-07, + 4.765606699845109e-07, + -2.6969832218324916e-07, + -5.871467509278004e-07, + 4.200367275533767e-07, + 7.044268061921138e-07, + -6.224841713408436e-07, + -8.220148697645299e-07, + 8.876100914738924e-07, + 9.307215563684733e-07, + -1.2263549285013004e-06, + -1.0180646862659517e-06, + 1.6495375341784678e-06, + 1.0677997143447814e-06, + -2.1672160434902636e-06, + -1.0594984616938665e-06, + 2.7878934786218487e-06, + 9.682092811742628e-07, + -3.5175644448463682e-06, + -7.642359224979942e-07, + 4.3586056187007376e-06, + 4.130757186506121e-07, + -5.3085202796190045e-06, + 1.2443999883255955e-07, + 6.358555800084345e-06, + -8.917594302752569e-07, + -7.492222625290795e-06, + 1.9359346976965215e-06, + 8.683753613501706e-06, + -3.3066166723901634e-06, + -9.896553377686571e-06, + 5.054684641484621e-06, + 1.1081698107413262e-05, + -7.230482378766363e-06, + -1.2176556837151924e-05, + 9.881641808207685e-06, + 1.310361479118067e-05, + -1.3050487570176674e-05, + -1.3769587763932494e-05, + 1.6771030367931327e-05, + 1.4064922949971825e-05, + -2.1065573831506833e-05, + -1.386378567354253e-05, + 2.5940978523130324e-05, + 1.3024632549176766e-05, + -3.138464724410613e-05, + -1.1391469231232117e-05, + 3.7360317493302477e-05, + 8.795884637183773e-06, + -4.380376916620311e-05, + -5.059942993990692e-06, + 5.061857766137688e-05, + -1.2729279960739985e-18, + -5.767206367871742e-05, + 6.568510314697647e-06, + 6.479161027901487e-05, + -1.482529579321305e-05, + -7.176153430630762e-05, + 2.493843998881951e-05, + 7.832071210975769e-05, + -3.705668910231432e-05, + -8.416116770617441e-05, + 5.1300867944157375e-05, + 8.892783420621756e-05, + -6.77545401257115e-05, + -9.221969567445976e-05, + 8.645406887217791e-05, + 9.359250590922007e-05, + -0.00010737827686101525, + -9.256326236908447e-05, + 0.0001304379450839715, + 8.861658728324014e-05, + -0.0001554654305418504, + -8.121313372668574e-05, + 0.0001822047191488953, + 6.980009223001803e-05, + -0.00021030226203261508, + -5.382382370758039e-05, + 0.00023929896894150197, + 3.274458779064277e-05, + -0.00026862375023307836, + -6.0532729964936305e-06, + 0.00029758900751817864, + -2.671003221043526e-05, + -0.000325388471242336, + 6.593585899246278e-05, + 0.0003510977702523597, + -0.00011192387190357726, + -0.0003736780929427704, + 0.0001648604519001771, + 0.000391983261423784, + -0.00022479579247089605, + -0.00040477048916979987, + 0.00029162101662982327, + 0.000410715029047172, + -0.00036504587911318116, + -0.00040842884314578015, + 0.0004445776651260253, + 0.0003964833395366939, + -0.0005295019321669618, + -0.00037343612546606575, + 0.0006188657627433, + 0.00033786162350484585, + -0.0007114642013347918, + -0.0002883852891386307, + 0.0008058305372427186, + 0.00022372105788811238, + -0.0009002310648224352, + -0.0001427115403024383, + 0.0009926649033332297, + 4.437037731172248e-05, + -0.0010808693900394488, + 7.207393010339128e-05, + 0.0011623314725868622, + -0.00020713349063999724, + -0.0012343054209503327, + 0.0003610166387724715, + 0.0012938370568711898, + -0.0005335845995545083, + -0.0013377945617159535, + 0.0007243101385594058, + 0.0013629057746815654, + -0.0009322391431135004, + -0.0013658017353411673, + 0.0011559560634399873, + 0.001343066061215347, + -0.0013935540949750406, + -0.0012912895862815387, + 0.0016426109036876274, + 0.0012071295242966488, + -0.001900170582736454, + -0.0010873722658800765, + 0.0021627323794196534, + 0.0009289987749149286, + -0.0024262465443003586, + -0.0007292514223482997, + 0.002686117427541705, + 0.00048570098808220843, + -0.0029372136780933438, + -0.0001963124782057012, + 0.0031738850853730077, + -0.0001404916512597725, + -0.003389985234223304, + 0.0005257722987911238, + 0.003578898712425241, + -0.0009600199781197914, + -0.003733571100688918, + 0.001443107923088798, + 0.0038465393642386826, + -0.001974253349587081, + -0.003909959516535164, + 0.0025519880785917614, + 0.003915627483496994, + -0.003174139582456504, + -0.003854987874872023, + 0.0038378233438448386, + 0.0037191237352354268, + -0.0045394472161245205, + -0.003498718093020069, + 0.0052747282494331775, + 0.0031839749242818863, + -0.006038722202602122, + -0.0027644824727652566, + 0.006825865702928783, + 0.0022289948598659135, + -0.007630030749218701, + -0.0015650971422069776, + 0.008444590984764183, + 0.0007587019748704784, + -0.009262498902418221, + 0.00020670150584601254, + 0.010076372890169986, + -0.0013511718972066557, + -0.010878592789031707, + 0.002700017220606699, + 0.0116614024217388, + -0.004286419502573899, + -0.01241701736642861, + 0.0061555897334271996, + 0.013137736099170549, + -0.008371571243092978, + -0.013816052517290636, + 0.01102886093018991, + 0.014444767785294677, + -0.014273331179705539, + -0.015017099419278979, + 0.01834245227603654, + 0.015526785545393338, + -0.023649360357418405, + -0.01596818233340632, + 0.030978952287937712, + 0.016336352716813843, + -0.04202003363176658, + -0.016627144664162638, + 0.061174433061502255, + 0.01683725745918051, + -0.10460220813936734, + -0.01696429467574168, + 0.3178080921167005, + 0.5170068048932956, + 0.3178080921167005, + -0.01696429467574168, + -0.10460220813936734, + 0.01683725745918051, + 0.061174433061502255, + -0.016627144664162638, + -0.04202003363176658, + 0.016336352716813843, + 0.030978952287937712, + -0.01596818233340632, + -0.023649360357418405, + 0.015526785545393338, + 0.01834245227603654, + -0.015017099419278979, + -0.014273331179705539, + 0.014444767785294677, + 0.01102886093018991, + -0.013816052517290636, + -0.008371571243092978, + 0.013137736099170549, + 0.0061555897334271996, + -0.01241701736642861, + -0.004286419502573899, + 0.0116614024217388, + 0.002700017220606699, + -0.010878592789031707, + -0.0013511718972066557, + 0.010076372890169986, + 0.00020670150584601254, + -0.009262498902418221, + 0.0007587019748704784, + 0.008444590984764183, + -0.0015650971422069776, + -0.007630030749218701, + 0.0022289948598659135, + 0.006825865702928783, + -0.0027644824727652566, + -0.006038722202602122, + 0.0031839749242818863, + 0.0052747282494331775, + -0.003498718093020069, + -0.0045394472161245205, + 0.0037191237352354268, + 0.0038378233438448386, + -0.003854987874872023, + -0.003174139582456504, + 0.003915627483496994, + 0.0025519880785917614, + -0.003909959516535164, + -0.001974253349587081, + 0.0038465393642386826, + 0.001443107923088798, + -0.003733571100688918, + -0.0009600199781197914, + 0.003578898712425241, + 0.0005257722987911238, + -0.003389985234223304, + -0.0001404916512597725, + 0.0031738850853730077, + -0.0001963124782057012, + -0.0029372136780933438, + 0.00048570098808220843, + 0.002686117427541705, + -0.0007292514223482997, + -0.0024262465443003586, + 0.0009289987749149286, + 0.0021627323794196534, + -0.0010873722658800765, + -0.001900170582736454, + 0.0012071295242966488, + 0.0016426109036876274, + -0.0012912895862815387, + -0.0013935540949750406, + 0.001343066061215347, + 0.0011559560634399873, + -0.0013658017353411673, + -0.0009322391431135004, + 0.0013629057746815654, + 0.0007243101385594058, + -0.0013377945617159535, + -0.0005335845995545083, + 0.0012938370568711898, + 0.0003610166387724715, + -0.0012343054209503327, + -0.00020713349063999724, + 0.0011623314725868622, + 7.207393010339128e-05, + -0.0010808693900394488, + 4.437037731172248e-05, + 0.0009926649033332297, + -0.0001427115403024383, + -0.0009002310648224352, + 0.00022372105788811238, + 0.0008058305372427186, + -0.0002883852891386307, + -0.0007114642013347918, + 0.00033786162350484585, + 0.0006188657627433, + -0.00037343612546606575, + -0.0005295019321669618, + 0.0003964833395366939, + 0.0004445776651260253, + -0.00040842884314578015, + -0.00036504587911318116, + 0.000410715029047172, + 0.00029162101662982327, + -0.00040477048916979987, + -0.00022479579247089605, + 0.000391983261423784, + 0.0001648604519001771, + -0.0003736780929427704, + -0.00011192387190357726, + 0.0003510977702523597, + 6.593585899246278e-05, + -0.000325388471242336, + -2.671003221043526e-05, + 0.00029758900751817864, + -6.0532729964936305e-06, + -0.00026862375023307836, + 3.274458779064277e-05, + 0.00023929896894150197, + -5.382382370758039e-05, + -0.00021030226203261508, + 6.980009223001803e-05, + 0.0001822047191488953, + -8.121313372668574e-05, + -0.0001554654305418504, + 8.861658728324014e-05, + 0.0001304379450839715, + -9.256326236908447e-05, + -0.00010737827686101525, + 9.359250590922007e-05, + 8.645406887217791e-05, + -9.221969567445976e-05, + -6.77545401257115e-05, + 8.892783420621756e-05, + 5.1300867944157375e-05, + -8.416116770617441e-05, + -3.705668910231432e-05, + 7.832071210975769e-05, + 2.493843998881951e-05, + -7.176153430630762e-05, + -1.482529579321305e-05, + 6.479161027901487e-05, + 6.568510314697647e-06, + -5.767206367871742e-05, + -1.2729279960739985e-18, + 5.061857766137688e-05, + -5.059942993990692e-06, + -4.380376916620311e-05, + 8.795884637183773e-06, + 3.7360317493302477e-05, + -1.1391469231232117e-05, + -3.138464724410613e-05, + 1.3024632549176766e-05, + 2.5940978523130324e-05, + -1.386378567354253e-05, + -2.1065573831506833e-05, + 1.4064922949971825e-05, + 1.6771030367931327e-05, + -1.3769587763932494e-05, + -1.3050487570176674e-05, + 1.310361479118067e-05, + 9.881641808207685e-06, + -1.2176556837151924e-05, + -7.230482378766363e-06, + 1.1081698107413262e-05, + 5.054684641484621e-06, + -9.896553377686571e-06, + -3.3066166723901634e-06, + 8.683753613501706e-06, + 1.9359346976965215e-06, + -7.492222625290795e-06, + -8.917594302752569e-07, + 6.358555800084345e-06, + 1.2443999883255955e-07, + -5.3085202796190045e-06, + 4.130757186506121e-07, + 4.3586056187007376e-06, + -7.642359224979942e-07, + -3.5175644448463682e-06, + 9.682092811742628e-07, + 2.7878934786218487e-06, + -1.0594984616938665e-06, + -2.1672160434902636e-06, + 1.0677997143447814e-06, + 1.6495375341784678e-06, + -1.0180646862659517e-06, + -1.2263549285013004e-06, + 9.307215563684733e-07, + 8.876100914738924e-07, + -8.220148697645299e-07, + -6.224841713408436e-07, + 7.044268061921138e-07, + 4.200367275533767e-07, + -5.871467509278004e-07, + -2.6969832218324916e-07, + 4.765606699845109e-07, + 1.6162916242945288e-07, + -3.767366685630587e-07, + -8.695906085997518e-08, + 2.898880068451338e-07, + 3.792557598966923e-08, + -2.1679956837762108e-07, + -7.927830161980731e-09, + 1.5720816822680103e-07, + -8.486685443549004e-09, + -1.1013103295646797e-07, + 1.5685867044913693e-08, + 7.414020115596361e-08, + -1.7052240013897604e-08, + -4.758343509079679e-08, + 1.510435454511938e-08, + 2.875448571604994e-08, + -1.162897576000204e-08, + -1.601722660647997e-08, + 7.814782506112341e-09, + 7.889301672202866e-09, + -4.380355015683147e-09, + -3.0915687919410175e-09, ]; #[allow(clippy::excessive_precision)] -pub const HZ96000_HIGH: [f64; 257] = [ - -7.143923102926616e-20, - -4.351257283515671e-06, - -1.0907621221693655e-06, - 6.683906965798109e-06, - 3.2790831797631692e-06, - -9.13620584774856e-06, - -6.874774126129371e-06, - 1.1310163453885296e-05, - 1.2126657588758059e-05, - -1.265575645173113e-05, - -1.9166554046744026e-05, - 1.248152779539428e-05, - 2.794862730250771e-05, - -9.984713045871162e-06, - -3.8189337778906546e-05, - 4.303067618516991e-06, - 4.931445698739215e-05, - 5.411099152784563e-06, - -6.042042478905683e-05, - -1.989624512124905e-05, - 7.025763351163002e-05, - 3.967018140695091e-05, - -7.72428741451272e-05, - -6.490829524996992e-05, - 7.9507093138109e-05, - 9.532015440656505e-05, - -7.498274957040692e-05, - -0.00013003529388340405, - 6.153246053554203e-05, - 0.0001675104888314477, - -3.711737577180626e-05, - -0.00020547154270862667, - 4.380875381487169e-19, - 0.0002409023748839593, - 5.102778188775271e-05, - -0.0002700928372585857, - -0.00011640463560427953, - 0.00028875415767545045, - 0.00019556435946416691, - -0.0002922072182944144, - -0.0002867246276901985, - 0.0002756441457161496, - 0.0003867211644368446, - -0.0002344581317859229, - -0.0004909090262693411, - 0.00016463032935658855, - 0.0005931514994811955, - -6.315646659694906e-05, - -0.0006859142317553148, - -7.151005261521953e-05, - 0.0007604775938269121, - 0.0002390268636629881, - -0.0008072740136891249, - -0.00043677525441936056, - 0.0008163493865283938, - 0.0006595508119830226, - -0.0007779390126639911, - -0.0008993661964713373, - 0.0006831393454389286, - 0.00114539774688185, - -0.0005246477263799965, - -0.00138410277847316, - 0.00029753389026130304, - 0.0015995271835870914, - -1.8249308204396214e-17, - -0.001773813531049159, - -0.0003659190459608399, - 0.0018879086841156133, - 0.0007937657463383715, - -0.0019224576000959562, - -0.0012722307423329708, - 0.0018588571537189837, - 0.0017849305448029394, - -0.0016804313624166863, - -0.002310431475418928, - 0.0013736781639519724, - 0.0028225487316737353, - -0.0009295287890346657, - -0.0032909363527835883, - 0.0003445546173767534, - 0.003681968512252244, - 0.0003779460639632543, - -0.00395989577856263, - -0.0012270471817312566, - 0.004088242707216325, - 0.0021835391818022633, - -0.004031396395209965, - -0.003219566441111553, - 0.0037563205210019465, - 0.004298589347141008, - -0.003234316955594173, - -0.005375681266525964, - 0.0024427482073774184, - 0.00639814422962896, - -0.0013666295279113297, - -0.007306395272526002, - 4.1486825665423373e-17, - 0.008035036709816487, - 0.0016530123829845687, - -0.008513975101161425, - -0.0035775058023473096, - 0.008669388760192265, - 0.005747558403911614, - -0.008424248812489233, - -0.008126459615440715, - 0.007697946272157984, - 0.01066743495767241, - -0.006404309173724075, - -0.013314855511628901, - 0.004446782604876781, - 0.016005897813639956, - -0.00170849842523587, - -0.018672595414079837, - -0.001967340732302961, - 0.021244201096702293, - 0.006816838930484501, - -0.02364976015970634, - -0.013239145641295004, - 0.02582078137402188, - 0.021992767160156825, - -0.027693884168079493, - -0.03472848053143565, - 0.02921329883114049, - 0.05579974177257601, - -0.03033310130622086, - -0.10130968278740993, - 0.03101907530302571, - 0.3167001312508388, - 0.46875167199845, - 0.3167001312508388, - 0.03101907530302571, - -0.10130968278740993, - -0.03033310130622086, - 0.05579974177257601, - 0.02921329883114049, - -0.03472848053143565, - -0.027693884168079493, - 0.021992767160156825, - 0.02582078137402188, - -0.013239145641295004, - -0.02364976015970634, - 0.006816838930484501, - 0.021244201096702293, - -0.001967340732302961, - -0.018672595414079837, - -0.00170849842523587, - 0.016005897813639956, - 0.004446782604876781, - -0.013314855511628901, - -0.006404309173724075, - 0.01066743495767241, - 0.007697946272157984, - -0.008126459615440715, - -0.008424248812489233, - 0.005747558403911614, - 0.008669388760192265, - -0.0035775058023473096, - -0.008513975101161425, - 0.0016530123829845687, - 0.008035036709816487, - 4.1486825665423373e-17, - -0.007306395272526002, - -0.0013666295279113297, - 0.00639814422962896, - 0.0024427482073774184, - -0.005375681266525964, - -0.003234316955594173, - 0.004298589347141008, - 0.0037563205210019465, - -0.003219566441111553, - -0.004031396395209965, - 0.0021835391818022633, - 0.004088242707216325, - -0.0012270471817312566, - -0.00395989577856263, - 0.0003779460639632543, - 0.003681968512252244, - 0.0003445546173767534, - -0.0032909363527835883, - -0.0009295287890346657, - 0.0028225487316737353, - 0.0013736781639519724, - -0.002310431475418928, - -0.0016804313624166863, - 0.0017849305448029394, - 0.0018588571537189837, - -0.0012722307423329708, - -0.0019224576000959562, - 0.0007937657463383715, - 0.0018879086841156133, - -0.0003659190459608399, - -0.001773813531049159, - -1.8249308204396214e-17, - 0.0015995271835870914, - 0.00029753389026130304, - -0.00138410277847316, - -0.0005246477263799965, - 0.00114539774688185, - 0.0006831393454389286, - -0.0008993661964713373, - -0.0007779390126639911, - 0.0006595508119830226, - 0.0008163493865283938, - -0.00043677525441936056, - -0.0008072740136891249, - 0.0002390268636629881, - 0.0007604775938269121, - -7.151005261521953e-05, - -0.0006859142317553148, - -6.315646659694906e-05, - 0.0005931514994811955, - 0.00016463032935658855, - -0.0004909090262693411, - -0.0002344581317859229, - 0.0003867211644368446, - 0.0002756441457161496, - -0.0002867246276901985, - -0.0002922072182944144, - 0.00019556435946416691, - 0.00028875415767545045, - -0.00011640463560427953, - -0.0002700928372585857, - 5.102778188775271e-05, - 0.0002409023748839593, - 4.380875381487169e-19, - -0.00020547154270862667, - -3.711737577180626e-05, - 0.0001675104888314477, - 6.153246053554203e-05, - -0.00013003529388340405, - -7.498274957040692e-05, - 9.532015440656505e-05, - 7.9507093138109e-05, - -6.490829524996992e-05, - -7.72428741451272e-05, - 3.967018140695091e-05, - 7.025763351163002e-05, - -1.989624512124905e-05, - -6.042042478905683e-05, - 5.411099152784563e-06, - 4.931445698739215e-05, - 4.303067618516991e-06, - -3.8189337778906546e-05, - -9.984713045871162e-06, - 2.794862730250771e-05, - 1.248152779539428e-05, - -1.9166554046744026e-05, - -1.265575645173113e-05, - 1.2126657588758059e-05, - 1.1310163453885296e-05, - -6.874774126129371e-06, - -9.13620584774856e-06, - 3.2790831797631692e-06, - 6.683906965798109e-06, - -1.0907621221693655e-06, - -4.351257283515671e-06, - -7.143923102926616e-20, -]; - -#[allow(clippy::excessive_precision)] -pub const HZ48000_LOW: [f64; 129] = [ - -1.4287804154623814e-19, - -2.181517823792544e-06, - 6.5581470578797384e-06, - -1.3749507785319245e-05, - 2.4253243796448185e-05, - -3.8332995273522084e-05, - 5.589709009118714e-05, - -7.637845076415545e-05, - 9.862862369540776e-05, - -0.00012084049392574903, - 0.00014051485346619586, - -0.0001544852936160124, - 0.00015901371827411808, - -0.0001499650577703289, - 0.00012306455887295043, - -7.423453305983806e-05, - 8.761724975855263e-19, - 0.00010205526341099535, - -0.0002328085860166881, - 0.00039112756777908054, - -0.0005734475676350329, - 0.0007734400525193427, - -0.000981815162903983, - 0.001186299507498468, - -0.0013718244260180216, - 0.0015209507112593692, - -0.0016145432755263242, - 0.0016326939677845523, - -0.0015558734461504878, - 0.001366274669719045, - -0.0010492923645293963, - 0.000595066029150748, - -3.649850898800486e-17, - -0.0007318359380147118, - 0.0015875268203384464, - -0.0025444539959421624, - 0.0035698505829804923, - -0.004620849350959662, - 0.005645080848996707, - -0.006581853334149319, - 0.007363915351356501, - -0.007919768248015761, - 0.008176461349835438, - -0.008062769060436804, - 0.007512618931198147, - -0.006468614873048888, - 0.004885482036021499, - -0.002733251011439905, - 8.297340712720699e-17, - 0.0033060150358527928, - -0.007154990546444822, - 0.011495082976006515, - -0.016252871396153546, - 0.021334807123689837, - -0.026629632648107943, - 0.032011701411864754, - -0.03734508091577928, - 0.042488277143797916, - -0.047299381109978895, - 0.051641410759341526, - -0.05538760532182361, - 0.05842642570422467, - -0.06066602406289918, - 0.06203796801866447, - 0.9375005847868952, - 0.06203796801866447, - -0.06066602406289918, - 0.05842642570422467, - -0.05538760532182361, - 0.051641410759341526, - -0.047299381109978895, - 0.042488277143797916, - -0.03734508091577928, - 0.032011701411864754, - -0.026629632648107943, - 0.021334807123689837, - -0.016252871396153546, - 0.011495082976006515, - -0.007154990546444822, - 0.0033060150358527928, - 8.297340712720699e-17, - -0.002733251011439905, - 0.004885482036021499, - -0.006468614873048888, - 0.007512618931198147, - -0.008062769060436804, - 0.008176461349835438, - -0.007919768248015761, - 0.007363915351356501, - -0.006581853334149319, - 0.005645080848996707, - -0.004620849350959662, - 0.0035698505829804923, - -0.0025444539959421624, - 0.0015875268203384464, - -0.0007318359380147118, - -3.649850898800486e-17, - 0.000595066029150748, - -0.0010492923645293963, - 0.001366274669719045, - -0.0015558734461504878, - 0.0016326939677845523, - -0.0016145432755263242, - 0.0015209507112593692, - -0.0013718244260180216, - 0.001186299507498468, - -0.000981815162903983, - 0.0007734400525193427, - -0.0005734475676350329, - 0.00039112756777908054, - -0.0002328085860166881, - 0.00010205526341099535, - 8.761724975855263e-19, - -7.423453305983806e-05, - 0.00012306455887295043, - -0.0001499650577703289, - 0.00015901371827411808, - -0.0001544852936160124, - 0.00014051485346619586, - -0.00012084049392574903, - 9.862862369540776e-05, - -7.637845076415545e-05, - 5.589709009118714e-05, - -3.8332995273522084e-05, - 2.4253243796448185e-05, - -1.3749507785319245e-05, - 6.5581470578797384e-06, - -2.181517823792544e-06, - -1.4287804154623814e-19, -]; - -#[allow(clippy::excessive_precision)] -pub const HZ88200_LOW: [f64; 129] = [ - 5.875800344814529e-06, - 4.851699044013074e-06, - -1.5670438235895964e-05, - -9.287225758882044e-06, - 3.2188588517572685e-05, - 1.452725442412174e-05, - -5.80015310113526e-05, - -1.975318175268538e-05, - 9.615523116437566e-05, - 2.3552114164532385e-05, - -0.00015014174552603567, - -2.375916580017386e-05, - 0.00022383889492568076, - 1.729437074025395e-05, - -0.00032141607023776947, - -1.8686789504441635e-19, - 0.00044720587729591056, - -3.351608912018519e-05, - -0.0006055434276587542, - 9.002640046744051e-05, - 0.0008005773235174634, - -0.00017781632159122524, - -0.0010360586296973909, - 0.00030680368023040425, - 0.0013151162221446207, - -0.0004886505249968164, - -0.0016400286962743556, - 0.0007368790790811487, - 0.0020120043638640903, - -0.0010670133701345262, - -0.0024309816366330315, - 0.0014967816965620656, - 0.002895462190517508, - -0.002046435147324143, - -0.0034023886674580135, - 0.002739267989293373, - 0.003947077286631264, - -0.003602474524851333, - -0.0045232136384107564, - 0.0046685585578356776, - 0.005122917204805467, - -0.005977654559924746, - -0.005736876918489128, - 0.007581382917565772, - 0.006354556507022021, - -0.009549372598113655, - -0.006964464667634032, - 0.011980635507338782, - 0.007554481497059819, - -0.015024288868017965, - -0.008112229280669358, - 0.018919636740583255, - 0.008625472935527727, - -0.024080164100849143, - -0.009082533288527662, - 0.031289629556764974, - 0.009472695101363785, - -0.042234282967316725, - -0.009786591428611496, - 0.06131211363458383, - 0.01001654655736988, - -0.10467821599139523, - -0.010156861410646928, - 0.31783087768940993, - 0.5102013912850153, - 0.31783087768940993, - -0.010156861410646928, - -0.10467821599139523, - 0.01001654655736988, - 0.06131211363458383, - -0.009786591428611496, - -0.042234282967316725, - 0.009472695101363785, - 0.031289629556764974, - -0.009082533288527662, - -0.024080164100849143, - 0.008625472935527727, - 0.018919636740583255, - -0.008112229280669358, - -0.015024288868017965, - 0.007554481497059819, - 0.011980635507338782, - -0.006964464667634032, - -0.009549372598113655, - 0.006354556507022021, - 0.007581382917565772, - -0.005736876918489128, - -0.005977654559924746, - 0.005122917204805467, - 0.0046685585578356776, - -0.0045232136384107564, - -0.003602474524851333, - 0.003947077286631264, - 0.002739267989293373, - -0.0034023886674580135, - -0.002046435147324143, - 0.002895462190517508, - 0.0014967816965620656, - -0.0024309816366330315, - -0.0010670133701345262, - 0.0020120043638640903, - 0.0007368790790811487, - -0.0016400286962743556, - -0.0004886505249968164, - 0.0013151162221446207, - 0.00030680368023040425, - -0.0010360586296973909, - -0.00017781632159122524, - 0.0008005773235174634, - 9.002640046744051e-05, - -0.0006055434276587542, - -3.351608912018519e-05, - 0.00044720587729591056, - -1.8686789504441635e-19, - -0.00032141607023776947, - 1.729437074025395e-05, - 0.00022383889492568076, - -2.375916580017386e-05, - -0.00015014174552603567, - 2.3552114164532385e-05, - 9.615523116437566e-05, - -1.975318175268538e-05, - -5.80015310113526e-05, - 1.452725442412174e-05, - 3.2188588517572685e-05, - -9.287225758882044e-06, - -1.5670438235895964e-05, - 4.851699044013074e-06, - 5.875800344814529e-06, -]; - -#[allow(clippy::excessive_precision)] -pub const HZ96000_LOW: [f64; 129] = [ - -7.143944801213435e-20, - -1.1128313185646072e-05, - -3.3433343718178e-06, - 2.368294142133405e-05, - 1.3125839456769717e-05, - -4.065919588349948e-05, - -3.361363034503314e-05, - 6.0198389114399714e-05, - 6.974138571798226e-05, - -7.816273123033217e-05, - -0.000126460783407638, - 8.758503947913682e-05, - 0.0002077626777155509, - -7.835700358335798e-05, - -0.0003154059452699033, - 3.729708416324331e-05, - 0.0004474410769117699, - 5.1274839240568415e-05, - -0.0005966722898292008, - -0.00020436483462002328, - 0.0007492498350107482, - 0.0004384998464839666, - -0.0008836155865344651, - -0.0007673289520005847, - 0.000970032155449486, - 0.0011987515041766601, - -0.0009709031498968383, - -0.0017317724164334631, - 0.0008420376771297366, - 0.0023533499143115976, - -0.0005349278077261196, - -0.00303553840647302, - 1.824936363314565e-17, - 0.003733226210629766, - 0.0008093189947979181, - -0.004382713612447862, - -0.0019320007678197645, - 0.004901261108562161, - 0.0033946608064293073, - -0.00518754915999129, - -0.005207105621787521, - 0.0051227092580119855, - 0.007358664812266444, - -0.004571166160481191, - -0.009815768367302802, - 0.003379862524796346, - 0.012521152261727227, - -0.0013732462347513066, - -0.015394948058705999, - -0.0016610156480375167, - 0.018337745467632928, - 0.006006200853277362, - -0.021235526836812676, - -0.012095713970371423, - 0.02396617954234677, - 0.020705989626446524, - -0.02640711788557473, - -0.03348753234339166, - 0.028443411089665006, - 0.05477521964516673, - -0.029975735264560804, - -0.10063702926794785, - 0.030927455828749166, - 0.3164667874739216, - 0.4687530957411302, - 0.3164667874739216, - 0.030927455828749166, - -0.10063702926794785, - -0.029975735264560804, - 0.05477521964516673, - 0.028443411089665006, - -0.03348753234339166, - -0.02640711788557473, - 0.020705989626446524, - 0.02396617954234677, - -0.012095713970371423, - -0.021235526836812676, - 0.006006200853277362, - 0.018337745467632928, - -0.0016610156480375167, - -0.015394948058705999, - -0.0013732462347513066, - 0.012521152261727227, - 0.003379862524796346, - -0.009815768367302802, - -0.004571166160481191, - 0.007358664812266444, - 0.0051227092580119855, - -0.005207105621787521, - -0.00518754915999129, - 0.0033946608064293073, - 0.004901261108562161, - -0.0019320007678197645, - -0.004382713612447862, - 0.0008093189947979181, - 0.003733226210629766, - 1.824936363314565e-17, - -0.00303553840647302, - -0.0005349278077261196, - 0.0023533499143115976, - 0.0008420376771297366, - -0.0017317724164334631, - -0.0009709031498968383, - 0.0011987515041766601, - 0.000970032155449486, - -0.0007673289520005847, - -0.0008836155865344651, - 0.0004384998464839666, - 0.0007492498350107482, - -0.00020436483462002328, - -0.0005966722898292008, - 5.1274839240568415e-05, - 0.0004474410769117699, - 3.729708416324331e-05, - -0.0003154059452699033, - -7.835700358335798e-05, - 0.0002077626777155509, - 8.758503947913682e-05, - -0.000126460783407638, - -7.816273123033217e-05, - 6.974138571798226e-05, - 6.0198389114399714e-05, - -3.361363034503314e-05, - -4.065919588349948e-05, - 1.3125839456769717e-05, - 2.368294142133405e-05, - -3.3433343718178e-06, - -1.1128313185646072e-05, - -7.143944801213435e-20, +pub const HZ96000_COEFFICIENTS: [f64; 441] = [ + 5.560249704317343e-10, + 6.7457053197573024e-09, + 1.2990035898564e-10, + -1.3822536813261148e-08, + -2.9300911640564656e-09, + 2.399478082083703e-08, + 9.41622844952465e-09, + -3.7481047434174274e-08, + -2.1662912144899056e-08, + 5.404635607782416e-08, + 4.224936834873014e-08, + -7.277372749908042e-08, + -7.420406557781993e-08, + 9.180574659487064e-08, + 1.2087511596227733e-07, + -1.0806955116527926e-07, + -1.8571016370140034e-07, + 1.170047184434655e-07, + 2.7193189671565557e-07, + -1.1231972250589951e-07, + -3.820995948332229e-07, + 8.580858719281314e-08, + 5.175534033235693e-07, + -2.7264542219779906e-08, + -6.777463371709023e-07, + -7.546867930879655e-08, + 8.594792841000288e-07, + 2.362654075465788e-07, + -1.0560662274062185e-06, + -4.702647143542115e-07, + 1.2564701211818615e-06, + 7.931573753480084e-07, + -1.444463705583346e-06, + -1.2201828893460145e-06, + 1.5978832544551455e-06, + 1.7648179657738676e-06, + -1.6880558459176943e-06, + -2.4371537290850187e-06, + 1.6794911507065441e-06, + 3.241978858347619e-06, + -1.5299357680554498e-06, + -4.176609629091859e-06, + 1.1908906002040628e-06, + 5.228534691612452e-06, + -6.086884800383554e-07, + -6.372971415214212e-06, + -2.7378079220115605e-07, + 7.570460432970104e-06, + 1.5146285260962556e-06, + -8.764654009459012e-06, + -3.1697646987478756e-06, + 9.880480130834774e-06, + 5.288925533796424e-06, + -1.0822885686373e-05, + -7.91096385725646e-06, + 1.147637656202352e-05, + 1.1058484433166778e-05, + -1.1705577680692975e-05, + -1.4731961794014652e-05, + 1.1357029900154213e-05, + 1.8903537311698937e-05, + -1.02624213729694e-05, + -2.3510752894245287e-05, + 8.243417040440697e-06, + 2.845053771367662e-05, + -5.118200477547931e-06, + -3.357381830826675e-05, + 7.097771141127904e-07, + 3.868116747816418e-05, + 5.1439924827157876e-06, + -4.3519939664326893e-05, + -1.2578754584543908e-05, + 4.778335604530135e-05, + 2.1690650088703207e-05, + -5.1111997713789026e-05, + -3.25222717208439e-05, + 5.3098136771621236e-05, + 4.504805078593748e-05, + -5.329328046531237e-05, + -5.9159648408755305e-05, + 5.1219220953428783e-05, + 7.465203338939947e-05, + -4.638277246361614e-05, + -9.121102194406923e-05, + 3.829423929087409e-05, + 0.00010840312702721423, + -2.6489494595043767e-05, + -0.00012566860999063735, + 1.0555365102241566e-05, + 0.0001423186387411039, + 9.84218401105256e-06, + -0.00015753742873676115, + -3.492777968059588e-05, + 0.00017039017161439265, + 6.478521332693489e-05, + -0.0001798374378895852, + -9.932598355762823e-05, + 0.00018475657369415775, + 0.00013825912105014366, + -0.00018397039760952743, + -0.00018106376125474611, + 0.0001762832452577541, + 0.00022696604405721683, + -0.00016052411172711115, + -0.0002749219824710103, + 0.0001355963128374769, + 0.0003236079454914325, + -0.0001005327357148728, + -0.0003714203356632149, + 5.4555389294439867e-05, + 0.00041648590394768506, + 2.8623898269992334e-06, + -0.00045668392990309446, + -7.193305595729272e-05, + 0.0004896812037153272, + 0.00015249357603317176, + -0.0005129803811882822, + -0.00024394827954764191, + 0.0005239818498263345, + 0.0003452185393899377, + -0.0005200587535404849, + -0.0004547020805523807, + 0.0004986442886477423, + 0.0005702447116739937, + -0.00045732982127237766, + -0.000689127166061252, + 0.00039397180535415474, + 0.0008080695174294933, + -0.0003068049228110276, + -0.0009232552984091209, + 0.00019455834610855686, + 0.0010303769985912112, + -5.657156236266569e-05, + -0.0011247040600814201, + -0.00010709417927966556, + 0.0012011738336718703, + 0.00029555300653979545, + -0.001254505224223492, + -0.0005070045038801027, + 0.0012793339607298146, + 0.0007386610901853346, + -0.001270367600067128, + -0.0009866968976081866, + 0.0012225575424289717, + 0.0012462220382388606, + -0.0011312845324039525, + -0.0015112856634668026, + 0.000992553375801394, + 0.001774910578349497, + -0.0008031919524797967, + -0.002029161380794138, + 0.0005610490828306219, + 0.0022652471702039635, + -0.00026518544171678135, + -0.0024736588359997344, + -8.394846280610072e-05, + 0.0026443398223918325, + 0.0004843531929226606, + -0.0027668881061983677, + -0.0009323458453637817, + 0.0028307859575470943, + 0.0014224552392333313, + -0.0028256529198113544, + -0.001947351215488067, + 0.002741516387210494, + 0.002497811396668082, + -0.002569093217952415, + -0.003062727446644023, + 0.002300075037489875, + 0.003629151287117882, + -0.0019274092967394656, + -0.0041823798600841, + 0.0014455677851960128, + 0.004706074850303062, + -0.0008507941834454292, + -0.005182411251550035, + 0.00014132239052928864, + 0.0055922456849282496, + 0.0006824422129566309, + -0.00591529179532096, + -0.0016177857065913586, + 0.006130285582602136, + 0.0026595989567600935, + -0.006215117688556044, + -0.0038003463068190125, + 0.006146901643802061, + 0.005030093197407957, + -0.0059019354869432146, + -0.006336594699928613, + 0.00545549657976398, + 0.00770544523750543, + -0.004781381564722846, + -0.00912028798641521, + 0.003851057421363559, + 0.010563080653771224, + -0.0026322107431178856, + -0.012014412573237022, + 0.001086341830368365, + 0.013453866409008227, + 0.0008352110916833665, + -0.014860416266574179, + -0.0031979417347285668, + 0.01621285273010614, + 0.006095714026154995, + -0.017490224327851422, + -0.009671655092655702, + 0.01867228420781883, + 0.014158404619215172, + -0.019739930415957174, + -0.0199622658168629, + 0.020675628126808922, + 0.027859437853963814, + -0.021463802489478597, + -0.03952835273006745, + 0.022091191414822978, + 0.05935902511250348, + -0.02254714862612816, + -0.10349853375753784, + 0.022823888596670217, + 0.31743777574504695, + 0.47708333120157576, + 0.31743777574504695, + 0.022823888596670217, + -0.10349853375753784, + -0.02254714862612816, + 0.05935902511250348, + 0.022091191414822978, + -0.03952835273006745, + -0.021463802489478597, + 0.027859437853963814, + 0.020675628126808922, + -0.0199622658168629, + -0.019739930415957174, + 0.014158404619215172, + 0.01867228420781883, + -0.009671655092655702, + -0.017490224327851422, + 0.006095714026154995, + 0.01621285273010614, + -0.0031979417347285668, + -0.014860416266574179, + 0.0008352110916833665, + 0.013453866409008227, + 0.001086341830368365, + -0.012014412573237022, + -0.0026322107431178856, + 0.010563080653771224, + 0.003851057421363559, + -0.00912028798641521, + -0.004781381564722846, + 0.00770544523750543, + 0.00545549657976398, + -0.006336594699928613, + -0.0059019354869432146, + 0.005030093197407957, + 0.006146901643802061, + -0.0038003463068190125, + -0.006215117688556044, + 0.0026595989567600935, + 0.006130285582602136, + -0.0016177857065913586, + -0.00591529179532096, + 0.0006824422129566309, + 0.0055922456849282496, + 0.00014132239052928864, + -0.005182411251550035, + -0.0008507941834454292, + 0.004706074850303062, + 0.0014455677851960128, + -0.0041823798600841, + -0.0019274092967394656, + 0.003629151287117882, + 0.002300075037489875, + -0.003062727446644023, + -0.002569093217952415, + 0.002497811396668082, + 0.002741516387210494, + -0.001947351215488067, + -0.0028256529198113544, + 0.0014224552392333313, + 0.0028307859575470943, + -0.0009323458453637817, + -0.0027668881061983677, + 0.0004843531929226606, + 0.0026443398223918325, + -8.394846280610072e-05, + -0.0024736588359997344, + -0.00026518544171678135, + 0.0022652471702039635, + 0.0005610490828306219, + -0.002029161380794138, + -0.0008031919524797967, + 0.001774910578349497, + 0.000992553375801394, + -0.0015112856634668026, + -0.0011312845324039525, + 0.0012462220382388606, + 0.0012225575424289717, + -0.0009866968976081866, + -0.001270367600067128, + 0.0007386610901853346, + 0.0012793339607298146, + -0.0005070045038801027, + -0.001254505224223492, + 0.00029555300653979545, + 0.0012011738336718703, + -0.00010709417927966556, + -0.0011247040600814201, + -5.657156236266569e-05, + 0.0010303769985912112, + 0.00019455834610855686, + -0.0009232552984091209, + -0.0003068049228110276, + 0.0008080695174294933, + 0.00039397180535415474, + -0.000689127166061252, + -0.00045732982127237766, + 0.0005702447116739937, + 0.0004986442886477423, + -0.0004547020805523807, + -0.0005200587535404849, + 0.0003452185393899377, + 0.0005239818498263345, + -0.00024394827954764191, + -0.0005129803811882822, + 0.00015249357603317176, + 0.0004896812037153272, + -7.193305595729272e-05, + -0.00045668392990309446, + 2.8623898269992334e-06, + 0.00041648590394768506, + 5.4555389294439867e-05, + -0.0003714203356632149, + -0.0001005327357148728, + 0.0003236079454914325, + 0.0001355963128374769, + -0.0002749219824710103, + -0.00016052411172711115, + 0.00022696604405721683, + 0.0001762832452577541, + -0.00018106376125474611, + -0.00018397039760952743, + 0.00013825912105014366, + 0.00018475657369415775, + -9.932598355762823e-05, + -0.0001798374378895852, + 6.478521332693489e-05, + 0.00017039017161439265, + -3.492777968059588e-05, + -0.00015753742873676115, + 9.84218401105256e-06, + 0.0001423186387411039, + 1.0555365102241566e-05, + -0.00012566860999063735, + -2.6489494595043767e-05, + 0.00010840312702721423, + 3.829423929087409e-05, + -9.121102194406923e-05, + -4.638277246361614e-05, + 7.465203338939947e-05, + 5.1219220953428783e-05, + -5.9159648408755305e-05, + -5.329328046531237e-05, + 4.504805078593748e-05, + 5.3098136771621236e-05, + -3.25222717208439e-05, + -5.1111997713789026e-05, + 2.1690650088703207e-05, + 4.778335604530135e-05, + -1.2578754584543908e-05, + -4.3519939664326893e-05, + 5.1439924827157876e-06, + 3.868116747816418e-05, + 7.097771141127904e-07, + -3.357381830826675e-05, + -5.118200477547931e-06, + 2.845053771367662e-05, + 8.243417040440697e-06, + -2.3510752894245287e-05, + -1.02624213729694e-05, + 1.8903537311698937e-05, + 1.1357029900154213e-05, + -1.4731961794014652e-05, + -1.1705577680692975e-05, + 1.1058484433166778e-05, + 1.147637656202352e-05, + -7.91096385725646e-06, + -1.0822885686373e-05, + 5.288925533796424e-06, + 9.880480130834774e-06, + -3.1697646987478756e-06, + -8.764654009459012e-06, + 1.5146285260962556e-06, + 7.570460432970104e-06, + -2.7378079220115605e-07, + -6.372971415214212e-06, + -6.086884800383554e-07, + 5.228534691612452e-06, + 1.1908906002040628e-06, + -4.176609629091859e-06, + -1.5299357680554498e-06, + 3.241978858347619e-06, + 1.6794911507065441e-06, + -2.4371537290850187e-06, + -1.6880558459176943e-06, + 1.7648179657738676e-06, + 1.5978832544551455e-06, + -1.2201828893460145e-06, + -1.444463705583346e-06, + 7.931573753480084e-07, + 1.2564701211818615e-06, + -4.702647143542115e-07, + -1.0560662274062185e-06, + 2.362654075465788e-07, + 8.594792841000288e-07, + -7.546867930879655e-08, + -6.777463371709023e-07, + -2.7264542219779906e-08, + 5.175534033235693e-07, + 8.580858719281314e-08, + -3.820995948332229e-07, + -1.1231972250589951e-07, + 2.7193189671565557e-07, + 1.170047184434655e-07, + -1.8571016370140034e-07, + -1.0806955116527926e-07, + 1.2087511596227733e-07, + 9.180574659487064e-08, + -7.420406557781993e-08, + -7.277372749908042e-08, + 4.224936834873014e-08, + 5.404635607782416e-08, + -2.1662912144899056e-08, + -3.7481047434174274e-08, + 9.41622844952465e-09, + 2.399478082083703e-08, + -2.9300911640564656e-09, + -1.3822536813261148e-08, + 1.2990035898564e-10, + 6.7457053197573024e-09, + 5.560249704317343e-10, ]; diff --git a/playback/src/resampler.rs b/playback/src/resampler.rs index 25c3a749a..fe82d4845 100644 --- a/playback/src/resampler.rs +++ b/playback/src/resampler.rs @@ -7,9 +7,8 @@ use std::{ }; use crate::{ - config::{InterpolationQuality, SampleRate}, - player::PLAYER_COUNTER, - RESAMPLER_INPUT_SIZE, SAMPLE_RATE as SOURCE_SAMPLE_RATE, + config::SampleRate, player::PLAYER_COUNTER, RESAMPLER_INPUT_SIZE, + SAMPLE_RATE as SOURCE_SAMPLE_RATE, }; struct DelayLine { @@ -88,27 +87,27 @@ struct MonoSincResampler { } impl MonoSincResampler { - fn new(sample_rate: SampleRate, interpolation_quality: InterpolationQuality) -> Self { - let spec = sample_rate.get_resample_spec(); + fn new(sample_rate: SampleRate) -> Self { + let coefficients = sample_rate + .get_interpolation_coefficients() + .unwrap_or_default(); - let coefficients = match interpolation_quality { - InterpolationQuality::Low => spec.low_coefficients, - InterpolationQuality::High => spec.high_coefficients, - }; + let resample_factor_reciprocal = sample_rate + .get_resample_factor_reciprocal() + .unwrap_or_default(); - let delay_line_latency = - (coefficients.len() as f64 * spec.resample_factor_reciprocal) as u64; + let interpolation_output_size = sample_rate + .get_interpolation_output_size() + .unwrap_or_default(); - Self { - interpolator: ConvolutionFilter::new( - interpolation_quality - .get_interpolation_coefficients(coefficients, spec.resample_factor_reciprocal), - ), + let delay_line_latency = (coefficients.len() as f64 * resample_factor_reciprocal) as u64; + Self { + interpolator: ConvolutionFilter::new(coefficients), input_buffer: Vec::with_capacity(SOURCE_SAMPLE_RATE as usize), - resample_factor_reciprocal: spec.resample_factor_reciprocal, + resample_factor_reciprocal, delay_line_latency, - interpolation_output_size: spec.interpolation_output_size, + interpolation_output_size, } } @@ -281,7 +280,7 @@ pub struct StereoInterleavedResampler { } impl StereoInterleavedResampler { - pub fn new(sample_rate: SampleRate, interpolation_quality: InterpolationQuality) -> Self { + pub fn new(sample_rate: SampleRate) -> Self { debug!("Sample Rate: {sample_rate}"); let resampler = match sample_rate { @@ -292,7 +291,7 @@ impl StereoInterleavedResampler { Resampler::Bypass } _ => { - debug!("Interpolation Quality: {interpolation_quality}"); + debug!("Interpolation Type: Windowed Sinc"); // The player increments the player id when it gets it... let player_id = PLAYER_COUNTER.load(Ordering::SeqCst).saturating_sub(1); @@ -300,12 +299,15 @@ impl StereoInterleavedResampler { let left_thread_name = format!("resampler:{player_id}:left"); let right_thread_name = format!("resampler:{player_id}:right"); - let left = MonoSincResampler::new(sample_rate, interpolation_quality); - let right = MonoSincResampler::new(sample_rate, interpolation_quality); - Resampler::Worker { - left_resampler: ResampleWorker::new(left, left_thread_name), - right_resampler: ResampleWorker::new(right, right_thread_name), + left_resampler: ResampleWorker::new( + MonoSincResampler::new(sample_rate), + left_thread_name, + ), + right_resampler: ResampleWorker::new( + MonoSincResampler::new(sample_rate), + right_thread_name, + ), } } }; diff --git a/playback/src/sample_pipeline.rs b/playback/src/sample_pipeline.rs index bae88279d..53bbc29f3 100644 --- a/playback/src/sample_pipeline.rs +++ b/playback/src/sample_pipeline.rs @@ -23,8 +23,7 @@ impl SamplePipeline { sink: Box, volume_getter: Box, ) -> Self { - let resampler = - StereoInterleavedResampler::new(config.sample_rate, config.interpolation_quality); + let resampler = StereoInterleavedResampler::new(config.sample_rate); let normaliser = Normaliser::new(config, volume_getter); let converter = Converter::new(config.ditherer); diff --git a/src/main.rs b/src/main.rs index 231b24518..f959267a7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -24,8 +24,8 @@ use librespot::{ playback::{ audio_backend::{self, SinkBuilder, BACKENDS}, config::{ - AudioFormat, Bitrate, InterpolationQuality, NormalisationMethod, NormalisationType, - PlayerConfig, SampleRate, VolumeCtrl, + AudioFormat, Bitrate, NormalisationMethod, NormalisationType, PlayerConfig, SampleRate, + VolumeCtrl, }, dither, mixer::{self, MixerConfig, MixerFn}, @@ -240,7 +240,6 @@ fn get_setup() -> Setup { const VOLUME_RANGE: &str = "volume-range"; const ZEROCONF_PORT: &str = "zeroconf-port"; const ZEROCONF_INTERFACE: &str = "zeroconf-interface"; - const INTERPOLATION_QUALITY: &str = "interpolation-quality"; const SAMPLE_RATE: &str = "sample-rate"; // Mostly arbitrary. @@ -579,11 +578,6 @@ fn get_setup() -> Setup { ZEROCONF_INTERFACE, "Comma-separated interface IP addresses on which zeroconf will bind. Defaults to all interfaces. Ignored by DNS-SD.", "IP" - ).optopt( - "", - INTERPOLATION_QUALITY, - "Interpolation Quality to use if Resampling {Low|High}. Defaults to High.", - "QUALITY" ).optopt( "", SAMPLE_RATE, @@ -800,32 +794,6 @@ fn get_setup() -> Setup { }) .unwrap_or_default(); - let interpolation_quality = opt_str(INTERPOLATION_QUALITY) - .as_deref() - .map(|interpolation_quality| match sample_rate { - SampleRate::Hz44100 => { - warn!( - "--{} has no effect with a sample rate of {sample_rate}.", - INTERPOLATION_QUALITY - ); - - InterpolationQuality::default() - } - _ => InterpolationQuality::from_str(interpolation_quality).unwrap_or_else(|_| { - let default_value = &format!("{}", InterpolationQuality::default()); - invalid_error_msg( - INTERPOLATION_QUALITY, - "", - interpolation_quality, - "Low, High", - default_value, - ); - - exit(1); - }), - }) - .unwrap_or_default(); - let format = opt_str(FORMAT) .as_deref() .map(|format| { @@ -1671,7 +1639,6 @@ fn get_setup() -> Setup { bitrate, gapless, passthrough, - interpolation_quality, sample_rate, normalisation, normalisation_type,