Let’s create a feedforward comb filter as shown in Figure 1. This can be achieved by using the FixedDelay() processor.
signal DelayedSignal {
default: 0.0
rate: AudioRate
reset: MasterReset
meta: none
}
# Feedforward Comb Filter Implementation
AudioIn[1]
>> FixedDelay (
samples: 32
default: 0.0
reset: off
bypass: off
)
>> DelayedSignal;
[ AudioIn[1], DelayedSignal ]
>> Level (
gainType: 'Linear'
gain: [ 0.5, 0.45 ]
offset: 0.0
bypass: off
)
>> Mix ()
>> AudioOut[1];
Let’s create a feedback comb filter as shown in Figure 3.
signal Feedback {
default: 0.0
rate: AudioRate
reset: MasterReset
meta: none
}
# Feedback Comb Filter Implementation
[ AudioIn[1], Feedback ]
>> Level (
gainType: 'Linear'
gain: [ 0.5, -0.45 ]
offset: 0.0
bypass: off
)
>> Mix ()
>> AudioOut[1]
>> FixedDelay (
samples: 32
default: 0.0
reset: off
bypass: off
)
>> Feedback;
Let’s create an allpass filter as shown in Figure 5.
signal FeedForward {
default: 0.0
rate: AudioRate
reset: MasterReset
meta: none
}
signal Feedback {
default: 0.0
rate: AudioRate
reset: MasterReset
meta: none
}
# Allpass Filter Implementation
[ AudioIn[1], Feedback ]
>> Level (
gainType: 'Linear'
gain: [ 1.0, -0.90 ]
offset: 0.0
bypass: off
)
>> Mix ()
>> Feedforward
>> FixedDelay (
samples: 32
default: 0.0
reset: off
bypass: off
)
>> Feedback;
[ Feedback, FeedForward ]
>> Level (
gainType: 'Linear'
gain: [ 1.0, 0.90 ]
offset: 0.0
bypass: off
)
>> Mix (
gainType: 'Linear'
gain: 0.5
offset: 0.0
bypass: off
)
>> AudioOut[1];
Let’s create an biquad filter as shown in Figure 7.
constant A [2] {
value: [0.0, 0.0]
meta: 'Output difference polynomial coefficients.'
}
constant B [3] {
value: [1.0, 0.0, 0.0]
meta: 'Input difference polynomial coefficients.'
}
signal Z [3] {
default: 0.0
rate: AudioRate
reset: MasterReset
meta: none
}
[ AudioIn[1], Z[2], Z[3] ]
>> Level (
gainType: 'Linear'
gain: [ 1.0, -A[1], -A[2] ]
offset: 0.0
bypass: off
)
>> Mix ()
>> Z[1]
>> FixedDelay (
samples: 1
default: 0.0
reset: off
bypass: off
)
>> Z[2]
>> FixedDelay (
samples: 1
default: 0.0
reset: off
bypass: off
)
>> Z[3];
[ Z[3], Z[2], Z[1] ]
>> Level (
gainType: 'Linear'
gain: [ B[3], B[2], B[1] ]
offset: 0.0
bypass: off
)
>> Mix ()
>> AudioOut[1];
The following block declares a processor block for reuse. The examples is based on the Biquad filter example.
module Biquad {
input: Input
output: Output
propertyName: [ 'inputCoefficients', 'outputCoefficients', 'reset', 'bypass' ]
propertyDirection: in
propertyBlock: [
constant B [3] { value: [ 1.0, 0.0, 0.0 ] },
constant A [2] { value: [ 0.0, 0.0 ] },
trigger Reset {},
switch Bypass { default: off reset: none }
]
internalBlock: [
signal Input { rate: streamRate reset: Reset },
signal Output { rate: streamRate reset: Reset },
signal Z [3] { rate: streamRate reset: Reset },
]
streams: [
[ Input, Z[2], Z[3] ]
>> Level (
gainType: 'Linear'
gain: [ 1.0, -A[1], -A[2] ]
offset: 0.0
bypass: off
)
>> Mix ()
>> Z[1]
>> FixedDelay (
samples: 1
default: 0.0
reset: Reset
bypass: off
)
>> Z[2]
>> FixedDelay (
samples: 1
default: 0.0
reset: Reset
bypass: off
)
>> Z[3];
,
[ Z[3], Z[2], Z[1] ]
>> Level (
gainType: 'Linear'
gains: [ B[3], B[2], B[1] ]
offset: 0.0
bypass: off
)
>> Mix ()
>> Result;
,
Bypass
>> Select (
whenOn: Input
whenOff: Result
)
>> Output;
]
meta: none
}
constant Y [2] {
value: [0.0, 0.0]
meta: 'Output difference polynomial coefficients.'
}
constant X [3] {
value: [1.0, 0.0, 0.0]
meta: 'Input difference polynomial coefficients.'
}
AudioIn[1]
>> Biquad (
inputCoefficients: X
outputCoefficients: Y
reset: off
bypass: off
)
>> AudioOut[1];