Phono preamp: RIAA EQ using IIR digital filters

I was recently contacted by a fellow DIYer. He was interested in using a pro-audio recording interface plus digital filtering to create a phono preamp. Pro audio interfaces often have sufficient gain, and all the EQ can be done in the digital domain. It seemed like an interesting project, so I decided to try and produce the appropriate EQ curve.

I managed to track down a usable source of information about the RIAA EQ curve on Rod Elliot's web site:
Hi-Fi RIAA Phono Preamp
This was an invaluable source of information about the poles and SPL levels that made it very easy to reproduce the target curve.

After applying several filters I was able to get an excellent match to the RIAA EQ target. The attached figure shows the two curves, with the target in white and the IIR EQ in blue overlaid. It's an excellent match.

One point of note: I used a lowpass filter to implement the final roll off at high frequency. Unlike analog filters of this type for which there is a zero at infinity, the zero for an IIR filter is at the Nyquist frequency. This zero pulls down the response at high frequencies when the sample rate is not high. In the figure I have used 96kHz, and this shows very minimal deviation at 20kHz. In contrast, for a 48kHz sample rate there was a couple of dB of difference at 20kHz. Probably not critical but it should be kept in mind.

The filters that were used to obtain the fit to the RIAA target curve are:
1st order low-pass filter: Fp = 2100 Hz
1st order low-shelf filter: Fp = 155Hz, gain = +20 dB
PEQ band: Fp = 50 Hz, gain = +2.5dB
PEQ band: Fp = 500 Hz, gain = -2.5dB
PEQ band: Fp = 2100 Hz, gain = +2.5dB


The PEQ bands are used to bring the response to the target at the inflection points. To relax this a bit, you may reduce the gain for each PEQ band towards zero dB gain to suit your tastes.

I used my ACDf IIR LADSPA filter to implement the EQ curve, however, I believe that these values could also work on a miniDSP and correspond to their filter nomenclature.

This seems to be an interesting way to marry your vinyl gear with DSP, especially if you already do further processing using DSP e.g. for a loudspeaker crossover, etc.


.
 

Attachments

  • RIAA EQ via IIR filters at 96kHz.png
    RIAA EQ via IIR filters at 96kHz.png
    37.9 KB · Views: 705
Last edited:
Nice! Thanks Charlie. This is a very useful tool if one wants to implement a fully digital phono stage. Mind you, it'll probably take some doing to get the signal voltage up to something useful :D

I checked the amount of gain available on e.g. a Focusrite Scarlett series interface that I own and it has up to 50dB. That should be enough. For example according to Table 1 in the analog phono preamp circuit article at the link in my post (Rod Elliot's project 06) there is 41.2dB of gain at 1kHz. So in addition to the EQ curve I developed another 40dB or so of gain is needed and this is well within the gain range of the Scarlett interface.
 
To help some other folks who might want to play in this space, I found this:http://www.channld.com/pure-vinyl_faq.html

Cut and Thrust: RIAA LP Equalization | Stereophile.com

and this
Digital RIAA equalization filter coefficients — Musicdsp.org documentation
though, tbh I don't understand how to translate their biquad coefficients into real things, so I'd stick with what Charlie has above

So there are two EQ processes:
1. When the record is being cut - there is bass cut and treble boost applied to the signal before the master is cut.
2. After the groove is "read" by the needle - in the phono preamp stage, the reverse EQ is applied, which boosts the bass and cuts high frequencies.

It's the EQ curve #2 that we are would like to replicate.

It's not clear to me whether the target curve is closely followed in #1 above, or if there are only a couple of low order approximations to it that are used.
 
Another point is that the overall gain can be split up between the analog gain (e.g. in the preamp stage of the audio interface itself) and the digital gain (in the DSP filters used to EQ the phono input signal). I'm not sure where the sweet spot would lie, that minimizes noise.

For example, I mention that one would need my EQ curve PLUS about 41dB of gain. This means the overall gain is about 62dB at 20Hz, falling to about 22dB at 20kHz or so, and these endpoints are connected by the EQ curve. How you divide up the boost is up to the end user.

I don't own a turntable or any vinyl, so I can't experiment with that. Maybe someone who is more familiar with phono preamps can chime in on that?
 
This has been discussed a lot on here
What about digital RIAA?
Designing a universal diff-in/diff-out Head Amp


And Scott's Linear audio article gives biquad values for most sample rates.

I don't use "biquad values" directly. Instead I use a DSP framework (LADSPA) and a plugin I wrote. This allows me to specify filters in terms of F and Q or similar terms, and the plugin code via the sample rate calculates the biquad coefficients during initialization. In the end it is the same thing, only my way is likely easier for the user and can be done using freeware Linux software.

Thanks for the links, and mention of to Scott's article (reference?). I was not aware of them.
 
Here's a simple method to put everything inside one biquad and also this method lefts you one pole for to tweak the hf response (or use it for 50k pole) - Website of Wayne Stegall - Digital Phono Equalization

The optimum values can be computed exactly, I have published them several times. With two bi-quads the error vanishes at any sampling frequency, now any DSP box can do this real time.
 
Well, I see this has been done before. But I find that biquad coefficient method to be very tedious indeed.

OTOH, with my filter values, my ACDf LADSPA plugin, a LADSPA host like ecasound, and a pro-audio interface with sufficient gain and you can be up and running in under 5 minutes. You can then choose sample rate at will and can very easily tweak the RIAA EQ curve to suit your tastes or accommodate that 2% deviation.
 
The optimum values can be computed exactly, I have published them several times. With two bi-quads the error vanishes at any sampling frequency, now any DSP box can do this real time.

Sadly I am either lazy or bad at googling, as I haven't not found them.

One of the nice things about Charlie's filters is that they run on a raspberry pi, making this (with a decent a/d converter) quite a reasonable DIY proposition. My current DSP (crossover, eq) is all done with Charlie's LADSPA plugins within ALSA, making it quite easy to add a couple more filters and have a fully digital front-end :)
 
Sadly I am either lazy or bad at googling, as I haven't not found them.

One of the nice things about Charlie's filters is that they run on a raspberry pi, making this (with a decent a/d converter) quite a reasonable DIY proposition. My current DSP (crossover, eq) is all done with Charlie's LADSPA plugins within ALSA, making it quite easy to add a couple more filters and have a fully digital front-end :)

LADSPA does bi-quads. If typing in 6 numbers from a table is tedious fine. LADSPA
 
And Charlie makes it easy for normal people to use LADSPA biquads here:
http://audio.claub.net/software/LADSPA/ACDF_v3.tar

Why must we enter 6 non-sensical coefficients to high precision when you can talk in the language of Fp,Qp,Fz,Qz to describe any first or second order function at any sample rate?

If you have read Bob Orban's ancient post on comp.dsp what you posted in #1 is not optimal. I'm tired after years of trying to help people, do whatever you want.
 
Member
Joined 2014
Paid Member
I used my ACDf IIR LADSPA filter to implement the EQ curve, however, I believe that these values could also work on a miniDSP and correspond to their filter nomenclature.
.
I linked the other threads because miniDSP biquads are published there and are a simple cut and paste. At least for me this is a lot quicker than programming in the PEQs. I have no experience of LADSPA so cannot comment.



Scott's article from LA is here Linear Audio | your tech audio resource for a small fee. Personally I think it's worth every penny as covers most of the angst factors over digital RIAA without having to wade through pages and pages of threads. Oh and has coefficients if you do archival stuff on pre-RIAA records (which I don't).
 
This is a DIY website. We are not all professionals around here. Sorry if offended you because I am not up to speed regarding the apex of RIAA EQ science. I don't use that pathetic format anyway. My opening post was meant as a conversation starter, not the be all end all of the topic.

Don't give up because of someone says you're doing it wrong way! I've been through this all but, still keep going my own path in this subject (as seen in earlier linked thread).

It's been long time since Robert Orban kindly posted me those digital RIAA coefficients at DSPRelated.com (though there were little bug to fix in his calculation) ... but, those were calculated just up to 96kHz processing. As I needed filters for 192kHz processing, getting those started something called a new hobby for me.

The goal is same, still, wouldn't it be nice to have some variation in ways of implementation of this digital RIAA filter ... just as there are in analog world?