Software based RIAA EQ for PC/MAC systems.

By jiiteepee@yahoo.se

Last updated: 25-Jan-2011



T.O.C.

1. EQ (VST -plug-in) w/ RIAA preset

2. Max/MSP implementation (standalone)

3. SynthMaker implementation (simple VST plug-in)

4. SynthEdit implementation (simple VST plug-in)

5. CPS implementation (simple)

External Subsonic/Rumble filtering

RIAA Filter software specs

Coefficients





Hardware setup:



Resolution 1. EQ (VST -plug-in) w/ RIAA preset

ddmf has couple good free EQ's you can use for this:

Additional software, you may need

Available RIAA EQ Presets for above mentioned ddmf EQ's:

NOTE: These RIAA EQ Presets does not work correctly w/ other ddfm EQ's (meaning LP10 and IIEQ Pro) and are samplerate sensiteve (44.1kHz filter does not work @ 96kHz).

IIEQ v1.12 DISCONTINUED PRODUCT

RIAA Preset for IIEQ v. 1.12 @ 44.1kHz and 96kHz

SmallEQ

RIAA Preset for SmallEQ @ 44.1kHz

IIEQ v. 1.21 and Morcky IIEQ

RIAA Preset for IIEQ v. 1.21 @ 44.1kHz

Download (Alternative Download location)

Above 44.1kHz presets gives the RIAA curve shown red in below picture (blue is the reference curve (RIAA standard)):



If you prefer to tweak those 44.1kHz presets to become more accurate, it's easiest to do by using Cristian Budde's Plugin Analyzer.


Quality:



Resolution 2. Max/MSP implementation

Needed components:

Additional software (extract these into same directory w/ RIAA_Filter (or install using the installer)):

RIAA Filter software for Max/MSP 4.x:



for Max/MSP 5.x:




I found E-MU 0404 USB troublesome when changing samplerate on-the-fly. If the filter freezes, just kill the MaxRT or Max process through task manager (ctrl-alt-del).


I/O Settings:






Resolution 3. SynthMaker implementation

Download SynthMaker (NOTE: trial version adds peridiocal noise ...)


On SynthMaker enviroment, it's possible to use two different methods to build a plug-in:


1. by Coding:


// RIAA EQ Reproduction Filter for 48kHz data
monoin inL;
monoin inR;
monoout outL;
monoout outR;

float a0, a1, a2;
float b0, b1, b2;
float inL1, inL2, inR1, inR2;
float outL1, outL2, outR1, outR2;

a0= 1.00000000000000000;
a1=-0.75555209999999995;
a2=-0.16462571129709999;
b0= 1.00000000000000000; // never needed
b1=-1.73276550000000020;
b2= 0.73455344362250008;

// Proces left channel
outL = a0*inL + a1*inL1 + a2*inL2 - b1*outL1 - b2*outL2;

// Process right channel
outR = a0*inR + a1*inR1 + a2*inR2 - b1*outR1 - b2*outR2;

// save previous I/Os
outL2 = outL1;
outL1 = outL;
inL2 = inL1;
inL1 = inL;

outR2 = outR1;
outR1 = outR;
inR2 = inR1;
inR1 = inR;

    2. By using build-in components:






Coefficients for various filters can be found in the end of this page.


Load the RIAA EQ VST plug-in to a VST Host software etc. .



Resolution 4. SynthEdit implementation

Needed software:



You may also need to make a folder named as ”vstplugins” under \Program Files\SynthEdit\.


Save SE project as a VST plug-in:

It's needed to create separate plug-in for each samplerate (44.1/48/88.2/96kHz and 192kHz) so, I have made four separate projects because of that (to make it simple).

Start SynthEdit and load the project file (riaa_se_xxx.se1) you want to save as VST plug-in.


Something like this should appear:




From File -menu, select Save as VST...




Name the .dll file and give an unique ID for each plug-in you create.


NOTES:





Load the RIAA EQ VST plug-in to a VST Host software etc. .


Subsonic filter result:




NOTE:



Resolution 5. CPS implementation


<not implemented>



Additional plug-ins



SUBSONIC/RUMBLE Filtering

Chebyshev I, HP Filter 36dB/oct (subsonic/rumble filter) @ 20Hz / BW20

Result (lighter line)







Christian W. Buddes RubberFilter :

(48dB/oct @ 20Hz)

Result:







Both mentioned plug-ins can be found @ http://www.savioursofsoul.de/Christian/?page_id=64



RIAA Filter software specs

Phase

Harmonic distortion









Filter Background (regarding coefficients)


This RIAA Filter accuracy depends on sample-rate because of the filter is sample accurate.

By calculated results (by Robert Orban),


@ 44.1 kHz:
two pole IIR filter:
MAXIMUM ERROR FROM 0.00 Hz TO 20000.00 Hz IS 0.2239207dB
MAXIMUM PHASE ERROR FROM 0.00 Hz TO 20000.00 Hz IS ~+/- 30 degrees
where the "phase error" is computed after a constant delay is added
or subtracted to make the phase error equiripple

three pole IIR filter:
MAXIMUM ERROR FROM 0.00 Hz TO 20000.00 Hz IS 0.0113530dB
MAXIMUM PHASE ERROR FROM 0.00 Hz TO 20000.00 Hz IS ~+/- 23 degrees
four pole IIR filter:
MAXIMUM ERROR FROM 0.00 Hz TO 20000.00 Hz IS 0.0005780dB
MAXIMUM PHASE ERROR FROM 0.00 Hz TO 20000.00 Hz IS ~+/- 21 degrees

@ 48 kHz:
two pole IIR filter:
MAXIMUM ERROR FROM 0.00 Hz TO 20000.00 Hz IS 0.1395898dB
MAXIMUM PHASE ERROR FROM 0.00 Hz TO 20000.00 Hz IS ~+/- 24 degrees
Three pole IIR filter:
MAXIMUM ERROR FROM 0.00 Hz TO 20000.00 Hz IS 0.0037544dB
MAXIMUM PHASE ERROR FROM 0.00 Hz TO 20000.00 Hz IS ~+/- 16 degrees
four pole IIR filter:
MAXIMUM ERROR FROM 0.00 Hz TO 20000.00 Hz IS 0.0000998dB
MAXIMUM PHASE ERROR FROM 0.00 Hz TO 20000.00 Hz IS ~+/- 15 degrees

@ 88.2 kHz
two pole IIR filter
MAXIMUM ERROR FROM 0.00 Hz TO 20000.00 Hz IS 0.0081862dB
MAXIMUM PHASE ERROR FROM 0.00 Hz TO 20000.00 Hz IS ~+/- 3 degrees
three pole IIR filter
MAXIMUM ERROR FROM 0.00 Hz TO 20000.00 Hz IS 0.0000096dB
MAXIMUM PHASE ERROR FROM 0.00 Hz TO 20000.00 Hz IS ~+/- 2 degrees
etc.

@ 96 kHz:
two pole IIR filter:
MAXIMUM ERROR FROM 0.00 Hz TO 20000.00 Hz IS 0.0057028dB
MAXIMUM PHASE ERROR FROM 0.00 Hz TO 20000.00 Hz IS ~+/- 2.4 degrees
three pole IIR filter:
MAXIMUM ERROR FROM 0.00 Hz TO 20000.00 Hz IS 0.0000046dB
MAXIMUM PHASE ERROR FROM 0.00 Hz TO 20000.00 Hz IS ~+/- 1.6 degrees
etc.
--> the filter should be accurate compared to RIAA standard (* see notes below).


Robert Orban, person behind these filter coefficients, describes the method he used for to calculate coefficients:
An IIR simulation of the RIAA phono de-emphasis curve (assuming s-plane poles at 50.5 and 2122 Hz
and an s-plane zero at 500.5. Hz), here are some good minimum-phase magnitude approximations.
(The RIAA de-emphasis is minimum-phase in the analog domain.)



UPDATES:


04/2010


Scott Wurcer informed me about possible *) error in Orban's calculations and this was confirmed later by Orban.

Orban had used value of 50.5 Hz instead of 50.05 Hz for one pole.

By the given information, resulting error in frequency responce isn't meaningful since it mostly touches lower frequencies. It certainly degrades the overal accuracy mentioned earlier (I have not compared this yet). Instead of fixing coefficients, I'll add another coefficients for 96kHz (see next update).


05/2010


Scott Wurcer presented new 96hHz and 192kHz filter coefficients.


These are calculated using equal height minimum ripple fit (20Hz to 20kHz).

The fit at 192kHz is .00033dB and at 96kHz it is .0056dB.




RIAA EQ filter coefficients


To use with software as like SynthMaker, SynthEdit and Max/MSP, etc. on Biquad -implementations.



FROM CALCULATION (GAINED)

MATCHED GAIN (~0dB @ 1 kHz)

Coeff

Khz

b0

b1

b2

a0

a1

a2

Gain dB

b0

b1

b2

a0

a1

a2

44.1

1.0

-1.700724

0.7029382

1.0

-0.7218922

-0.1860521

+12.466

1.0

-1.700724

0.7029382

0.2380952

-0.1718791

0.0442981

48

1.0

-1.732766

0.7345534

1.0

-0.7555521

-0.1646257

+12.752

1.0

-1.732766

0.7345534

0.0267592

-0.0459208

0.0192123

88.2

1.0

-1.855465

0.8559721

1.0

-0.8479577

-0.1127632

+17.944

1.0

-1.855465

0.8559721

0.3414135

-0.2895042

-0.0384989

96

1.0

-1.866608

0.8670383

1.0

-0.8535331

-0.1104595

+18.625

1.0

-1.866608

0.8670383

0.1711450

-0.1460779

-0.0189046

96

1.0

-1.866634

0.8670602

1.0

-0.8535323

-0.1104603

+15.641

1.0

-1.866608

0.8670383

0.1170960

-0.0999452

-0.0129345

192

1.0

-1.931263

0.9313725

1.0

-0.8796912

-0.1023703

+24.350

1.0

-1.931263

0.9313725

0.0606061

-0.0533146

-0.0062043



NOTES: