RH BiQuad

BiQuad Multimode Filter module

– Types: LP, HP, BPF1 (new!), BPF2, Notch, Peak, Loshelf, Hishelf
– BPF1: peak gain = Q, BPF2: peak gain = zero.
– Cascade: up to 8x (new!)
– Freq: 20 – 20.000Hz
– Q: 0 – 10v
– PeakGain: -30dB – 30dB
– 64bit internal processing
– CPU usage (32bit): for LP 12dB about 0.17% (streaming)(Core i5-2450m).
– CPU usage (64bit): for LP 12dB about 0.70% (streaming)(Core i5-2450m).

– Gain compensation: use the properties screen to subtract a value from the Q, per stage.
This way it allows the Q range on the slider to stay 0 – 10v, and stop/contain the peak overload.

Example values to subtract from Q ( closer to 0 means more overload ):
– Gaincomp2: 6.5
– GainComp3: 7.7
– GainComp4: 8.2
– etc..

– Code optimising.
– Maybe split the Coefficients from the Engine ( like CK his BiQuad system ).


Source 32bit: RH-BiQuad
Source 64bit: RH-BiQuad-64

– Andrew aka Ichad.c (blog)
– Nigel Redmon @ Earlevel.com (used his implementation).
– Chris Townsend @ MusicDSP.org.
– Peter (Scoofy) Schoffhauser, used his musicDSP post for the coefficient calc of the BPF1 type.






Update 19-9-2015:
– Cascade up to 8x
– Added additionkal BPF type ( BPF1 ).
– Added manual “gain compensation”.

Update 10-2-2014:
– Added Adaptive processing.
Credits for this enhancement go out to Andrew @ SESDK usergroup.
He offered his help to implement this, fixed my Many2one problem in the process.
This lowers CPU usage a lot while an input parameter is not streaming.

Update 6-2-2014:
– Downscaled Q a bit.
– Added Cascading: 12,24,36,48dB

Update 5-2-2014:
– Changed some compiler settings, speeds up the module slightly.
– Low value limit set on the Q parameter, to prevent the filter crashing.
– Made some code improvements, and small fixes ( thanks Andrew @ Yahoo Usergroup ).
– Removed the fake blockmode, it didn’t work as planned while using a Manytoone.
When I come up with a fix i’ll reintroduce it..as it does save quite a lot on CPU usage.
– Sleepmode corrected.

RH Math Modules

Dsp and Subcontrol math functions modules.
– Faster approximations (link) used in the DSP version.
– Subcontrol version was converted from SDK2, added a few functions.
– Functions: Sin, Cos, Tan, Tanh, Exp, Log.

Update 12-7-2015: Subcontrol bug choice not saved fixed.
Update 8-1-2013: DSP version created, removed approximations from subcontrol module.






Test Project file: test-rhmath2sdk3

RH 3Ddistance & Cart2Polar

DSP & Subcontrol Cartesian 2 Polar, and subcontrol 3D distance SDK3 modules.
Reference: polar-cartesian-coordinates

– RH-Cart2Polar has a selection pin to choose between 180/-180 and 0/360 degrees.
– Converted from SDK2, RH-3Ddistance was RH-2D_3D_distance
( removed choice option, use Cart2Polar for X + Y ).
– Both subcontrol modules combined into one SEM to save memory usage (ran into problems with the DSP versions so they are not combined for now).

12-7-2015: Subcontrol bug choice not saved fixed.
15-5-2015: Added sleepmode in the DSP versions, forgot about that.
13-5-2015: Polar2Cartesian DSP (32/64 bits) version released. It has a mode pin to select between: “Normal, Approx (fastsin/cos) and Update ( update state using the Bool Update pin, uses math.h sin/cos )”. Note: I’ve used the fastonebigheader.h for the fastsin/cos functions. CPU usage(i5)(32bit): normal = 1.5%, Approx = 0,4% and Update = 0,15%.
6-5-2015: Cartesian2Polar DSP (32/64bits) version released. It has a mode pin which lets you choose between : “Normal, Approximation (of atan2) or Update ( update state using the Bool Update pin, uses math.h atan2 as with normal mode )”. If your application doesn’t require constant computing, use the update mode with update pin.
CPU usage(i5)(32bit): normal = 1.6%, Approx = 0,5% and Update = 0,13%.
4-5-2015: Cartesian2polar subcontrol modules are now bidirectional, you can enter distance and angle values to get X,Y coordinates.



RH Distortion modules

6 DSP side Distortion modules converted from SDK2.
– All have new SEM IDs, and are combined to one SEM to save memory.
Let me know if there is a problem with any of them.

They are:
– RH-Booster
– RH-Foldback
– RH-Limit
– RH-Softdist
– RH-Waveshaper
– RH-Waveshaper2 ( new module, is not the same as the SDK2 module )

All distortion code, except for the limit module, orginated from Musicdsp.org.
Credit goes to the posters of the source, and the contributors.


Source: SDK3 code