SpHr_FilterBiquad [ /CF=Freq /Coef=coefsWave /Dest=[destWave] /D=[delaysWave] /C /Q=Q /B=minBW /RMS=[r] ]  srcWaveName


Applies a biquad filter centered at CenterFrequency to srcWaveName . Adapted from Malcolm Slaney@Interval. (c) 1998 Interval Research Corporation.


Parameters


srcWaveName    Specification for the single precision wave to be filtered. This wave is overwritten and thus serves as both source and destination if the /Dest flag is omitted.


Flags

/CF = cf

    Filter center frequency (Hz). This flag or the /Coef flag must be used. The /CF flag is overridden by the /Coef flag.


/L = [CFdestWaveName]

    When using the /CF flag and a srcWaveName that consists of only 2 columns, the /L flag generates a FREE wave specified by CFdestWaveName that consists of a single point set to cf. This is useful when using a subsequent operation that requires a CFs wave. The second column of srcWaveName is also written to layer 2 as opposed to column 2 (as would occur if the /L flag were omitted). Filtered output is therefore dimensioned similarly to that of the SpHr_FilterBankBiquad operation.


/Coef = coefsWave

    Filter coefficients. See SpHr_FilterBiquadCoefs. This flag or the /CF flag must be used. 


/Dest = [destWaveName]

    Results of filtering are written to the wave specified by destWaveName. The wave is single precision and always overwritten. If destWaveName is omitted, srcWaveName is overwritten.


/D = [delaysWaveName

    Delay lines are saved to the wave specified by delaysWaveName.  If delaysWaveName is omitted, delays are written to a wave having the same name as srcWaveName plus a "_delays" suffix. These delays are used on subsequent calls to SpHr_FilterBiquad unless delaysWaveName is killed or the /C flag is present. The wave is single precision and always overwritten.


/C = [c]     

    /C or /C=1 Clears delay lines before applying the filter. Delay lines are preserved if delaysWave already exists, the /C flag is omitted, or c = 0.

    /C=0: Same as no /C at all. This is the default.

    /C=1: Same as /C alone.


/Q = [q]     

    Quality factor when using /CF flag. If no q value is passed, the /Q flag does nothing and the default Glasberg and Moore Parameter of 9.26449 is used.


/B = [minBW]     

    Minimum bandwidth when using /CF flag. If no value is passed, the /B flag does nothing and the default Glasberg and Moore Parameter of 24.7 is used.


/RMS = [r]

    /RMS or /RMS=1 Filtered values in destWaveName are scaled to have constant RMS amplitude as center frequency is varied. If the flag is omitted or r is 0, biquad filters are treated as having equal areas. This flag should not be used if /Q or /B are used to set non-default values.

    /RMS=0: Same as no /RMS at all. This is the default.

    /RMS=1: Same as /RMS alone.


Example

Function SpHr_FilterBiquad_Example()

    SpHr_SignalGaussian/ms=50/Sp=1/HP=50/dB=70/Ramp=10/Buff={0,30} 48000, Noise

    variable Hz = 500

    SpHr_FilterBiquad /CF=(Hz)/Dest=filteredNoise Noise

    Display/K=1 Noise

    AppendToGraph/R filteredNoise

    ModifyGraph lsize=0.5,rgb(filteredNoise)=(0,0,0)

    SetAxis/A/E=2 left

    SetAxis/A/E=2 right

End

Contact: Brian