Applies a DF2 filter to an audio signal. More...
Import Statement: | import |
Inherits: | |
Inherited By: |
This AudioEffect applies a series of direct form 2 filters to an MP3Decoder's audio signal.
The DF2 filter's data. Set it to a JSON object with the following entries:
order
: The filter's order, or the number of iterations it performs. This is twice the number of second order sections the filter contains.sosMatrix
: The filter's second order sections data, as a 2D JS array of real
values. It should have order / 2
sub-entries each with 6 real
values. These 6 values represent this filter section's coefficients B0, B1, B2, A0, A1, A2
.scaleValues
: The filter's second order sections scale values, as a JS array of real
values.Example:
DirectForm2Filter { data: ({ order: 8, sosMatrix: [ [1, 2, 1, 1, -1.999582010463876, 0.999583152065339], [1, 2, 1, 1, -1.998812233343328, 0.998813374505309], [1, 2, 1, 1, -1.998223471725322, 0.998224612551167], [1, 2, 1, 1, -1.997904980861054, 0.997906121505067] ], scaleValues: [ 0.000000285400366, 0.000000285290495, 0.000000285206461, 0.000000285161003 ] }) }
Note: The value A0
for a DF2 filter is always 1
, so the actual value of the fourth entry in a sos-section is ignored.
Reset the filter algorithm's state and memory. Call this to treat the rest of the MP3Decoder's audio signal like a completely new audio signal.