import type { FnN , FnN2 } from "@thi.ng/api" ; import { TAU } from "@thi.ng/math/api" ; param f param fs export const normFreq = ( f , fs ) => f / fs ; param f param fs export const freqRad = ( f , fs ) => ( f / fs ) * TAU ; param f export const freqMs = ( f ) => 1000 / f ; /**
 * Reverse op of  freqRad .
 *
 *  param rad param fs export const radFreq = ( rad , fs ) => ( rad / TAU ) * fs ; example param t param fs export const msFrames = ( t , fs ) => t * 0.001 * fs ; /**
 * Reverse op of  msFrames .
 *
 *  param frames param fs export const framesMs = ( frames , fs ) => ( frames / fs ) * 1000 ; param x export const magDb = ( x ) => ( 20 * Math . log ( x ) ) / Math . LN10 ; param x export const dbMag = ( x ) => 10 ** ( x / 20 ) ;