SpHr_FilterBankBiquad [ /Dest=[destWave] /D=[delaysWave] /C /RMS /RMSW=[srcWaveName] ] centerFrequencies, coefsWaveName, srcWaveName [ , srcWaveName2 ]


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


Parameters

centerFrequencies  Specification for a double precision wave of center frequencies (Hz). See SpHr_FilterCenterFreqs.


coefsWaveName  Specification for a double precision wave of biquad filter coefficients. See SpHr_FilterBankBiquadCoefs.


srcWaveName Specification for the single precision wave to be filtered. This wave typically consists of two columns (stereo/binaural audio) but can also have only one column (mono audio). This wave is overwritten and thus serves as both source and destination if the /Dest flag is omitted.


[srcWaveName2] Optional specification for a second single precision wave to be filtered. When included, srcWaveName and srcWaveName2 must both have: no columns, identical x-scaling, and the same number of points. Results for srcWaveName and srcWaveName2 are written to the first and second layers of a multidimensional destination wave (see destWaveName).


Flags

/Dest=[destWaveName

    Filtered results are written to the wave specified by destWaveName. If destWaveName is omitted, the destination wave uses the name of srcWaveName as a prefix and appends '_filtered'. The wave is single precision and always overwritten. Results for each frequency band are written along rows for as many columns as centerFrequencies. If srcWaveName has two columns (stereo/binaural), results for the first column (channel) are written to layer 0. Results for the second column are written to layer 1.


/D = [delaysWaveName]

    Delay lines are saved to the wave specified by delaysWaveName. If delaysWaveName is omitted, the destination wave uses the name of srcWaveName as a prefix and appends '_delays'. These delays are used on subsequent calls to SpHr_FilterBankBiquad unless delaysWaveName is killed or the /C flag is present. This wave is single precision and always overwritten.


/C = [c

    Clears delay lines before applying the filters. Delay lines are preserved if delaysWaveName exists and the /C flag is omitted.

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

    /C=1: Same as /C alone.


/RMS = [rms]    

    Filtered values are scaled by RMS values. If this flag is omitted or rms = 0, filters are treated as having equal areas. This flag should be used with caution if flags /Q or /B of the in SpHr_FilterBankBiquadCoefs operation are used to set values other than Glasberg and Moore defaults. In these instances, the /RMSW flag should be used.

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

    /RMS=1: Same as /RMS alone.


/RMSW = RMSWaveName

    Specification for a wave of amplitude scales that may be used to obtain constant amplitudes across frequency bands. The wave RMSWaveName may be obtained using the SpHr_FilterBankBiquadCoefs operation with the /RMS flag.


Example

Function SpHr_FilterBankBiquad_Example()

    variable lowHz = 50

    variable highHz = 1500

    variable numBands = 24

    SpHr_FilterCenterFreqs/Type=2 lowHz, highHz, numBands, CFs

    variable fs = 48000

    SpHr_FilterBankBiquadCoefs fs, CFs, coefs

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

    SpHr_FilterBankBiquad/Dest=filteredNoise CFs, coefs, Noise

    Display/K=1 Noise[][16]

    AppendToGraph/R filteredNoise[][16]

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

    SetAxis/A/E=2 left

    SetAxis/A/E=2 right

End

Contact: Brian