Go Back   Home > Forums > Source & Line > Analogue Source
Home Forums Rules Articles Store Gallery Blogs Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

Analogue Source Turntables, Tonearms, Cartridges, Phono Stages, Tuners, Tape Recorders, etc.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 22nd March 2007, 04:24 PM   #1
diyAudio Member
 
Join Date: Mar 2007
Default Turntable -> PC (RIAA EQ done by software filter)

Hello!

Well, after many tries w/ not so good results in using various EQ plugins and standalone EQ software for RIAA compensation, I have now started implementing a solution of my own ... a RIAA reproduction filter to be used when turntable is connected into soundcard without hardware RIAA stage in signal path .. but just through a flat pre-amp. I've seen there some commercial solutions available and one 'open source' solution for Soundblaster/kX users (link given below).

All I can say so far, is that the results I get are really qood (especially w/ 88.2kHz and 96kHz filters) but, since I have only one set of hardware to evaluate this software, I would like you to evaluate this too. This filter,

Click the image to open in full size.

( .. Sorry 'bout the visual outlook but ... don't laugh, it should work well)

which I have linked below, is prepared only for this evaluation purpose. It's optimized for 44.1 kHz audio (any bit depth can be used), its for output only and it can be used through Cycling74 Max/MSP runtime enviroment only. ASIO, MME, DS, etc. are supported as well as Windows XP and MAC OS/X 10.3.9-> (there is a runtime for both systems available). For this "evaluation" version, I have included a rumble filter (Subsonic) w/ ability to set the cutoff frequency (5-30Hz) and Q (0.1-1.41). It's allways ON and not very well implemented (see below).

Here are listed the needed software:
RIAA Filter (for 44.1kHz) DEMO.rar (~16kB)
Mirror 1
Mirror 2
-- 3 files included (2 pictures and the filter .pat file)
NOTE: Filename may become changed by the service providers system.

Max/MSP 4.6.2 Runtime enviroment for PC/MAC (~4.5MB/9.1MB)

Setting it up (Windows):
- connect your turntable output through some flat pre-amp (no RIAA stage in signal path) into PC through soundcard line input(s)
- connect your output device (amp/active speakers/headphones) into soundcard output(s)
- install the Max/MSP runtime enviroment
- extract the "RIAA Filter (for 44.1kHz) DEMO.rar" to your harddisk
Start the RIAA Filter program either by
- starting the runtime enviroment and Open the "RIAA Filter (for 44.1kHz).pat" or
- double-clicking the "RIAA Filter (for 44.1kHz).pat" (through Windows Explorer -> .pat extention should be associated to Max/MSP runtime then)

In "RIAA Filter (for 44.1kHz)" screen (important):
- set I/O devices; ASIO recommended (if no sound, remember check settings in mixer software)
- adjust the Subsonic filter by dragging w/ mouse (Hz = 25Hz and Q = 0.71 are good to start from) (see below)
- adjust Gain to somewhere near the 0dB mark (128)
- press the Play/Stop button to enable the playback through filter

NOTE: If you can hear audio when Play/Stop is set "OFF" (there should be total silence) then you need to set something in your mixer software (maybe monitoring OFF, mute something, etc.) otherwise the unfiltered signal is summed into playback --> brighten sound.

Some notes:

As mentioned, this filter is for 44.1kHz samplerate/data only. What it means is that the mathematical model is matched for amount of this much samples per second (sample accurate processing). Biquad method used in this filter uses three samples to get the new output value calculated (current sample and two previous samples). What happens if you set samplerate to 48kHz, as for an example, ... samples becomes processed wrong --> quality becomes bad.


Subsonic filter:
It's low order highpass filter so the cut is not very sharp/steep ... you can use 25-30Hz as cutoff frequency w/o loosing much from above the 20Hz frequencies.
Example on how # of orders effects (this is for lowpass filter).


RIAA filter:
You see the RIAA de-emphasis curve for this filter as a background image for Filter screen. The original filter coefficients (15 decimal accuracy) gives quite accurate de-emphasis curve (error: ±0.23dB) even as a 2nd order filter (4th order filter would give error: ±0.0006dB) .. as the Max/MSP enviroment seem to scale and round the given value into 6 decimal value, it may have some negative effect on accuracy. I have compared the orignal 15 decimal data against rounded 7 decimal data and those didn't differ very much by the results (sound and frequency response curve). Some other results from measures (all these measure data is got from the project version of filter (VST)):


Phase:

Click the image to open in full size.

Harmonic distortion:

Click the image to open in full size.


Software notes:
Gain, and Subsonic controllers resets to "0" when filter is loaded into runtime enviroment so, all these needs to be set every time after filter is loaded otherwise you get bad quality audio if at all. If you get rattle in audio, just toggle the Play/Stop or reassign your I/Os. Hmm.. I hope there are no bugs since I can't test or fix in realtime because of I'm still using W2k and the Max/MSP needs XP being installed (even the runtime won't get installed in W2k SP4).


Hardware notes:
You need some pre-amplification for turntable output (in most cases) to get signal levels good enough for soundcard input.


So, are you interested to try it out?

I beg you not to turn this thread into "hardware vs software RIAA" question. I just wish you could try this filter and comment the results you get. If you don't like the result then just say it and it also would be better if you could specify the reason for your opinion (I need a lot of all kind of information).

jiitee

P.S.

Actually, I have a VST/Standalone RIAA Filter project (becomes released as donationware) ongoin' but, as I want to hear some commenting and maybe suggestions from you, I prepared this special version just because of it (thanks to Peke for letting me to sit w/ him in front of his PC over a couple of hours ...). The project filter do have some additional features as like
- (22.05,) 44.1, 48, 88.2, 96 (172.4 and 192) kHz (in both)
- filter for 50/60/..Hz humming, (in both)
- maybe pop/click filter, (in both)
- better Subsonic filter (6-8th order filter) (in both)
- recording capability (16-32bit wav), (in standalone only)
- audio file playback capability (if you like to rip w/o RIAA EQ), (in standalone only)
- various presets for RIAA (there are plenty of different ones used before 1955) (in both)
- better de-emphasis accuracy for RIAA curve (3rd/4th order filters) (in both)
- DBX filter (I do have couple of DBX recordings)? !! If I can find needed data to get those filter coefficients calculated
- etc. (suggest some)


P.S.2.

BTW, if here are kX Project driver users, who are interested on this matter, there is a DSP macro for same purpose made by Hannes Rohde. You can DL it from here.
  Reply With Quote
Old 22nd March 2007, 05:40 PM   #2
diyAudio Member
 
Onvinyl's Avatar
 
Join Date: Aug 2002
Location: Germany
Hi,
i think it's great and i will try it as soon I have a decent soundcard.
Nevertheless, one needs to have a sufficient voltage level to feed the soundcard with.

Rüdiger
__________________
"I can feel what's going on inside a piece of electronic equipment. I have a sense that I know what's going on inside the transistors." Robert Moog
  Reply With Quote
Old 22nd March 2007, 05:48 PM   #3
diyAudio Member
 
jackinnj's Avatar
 
Join Date: Apr 2002
Location: Llanddewi Brefi, NJ
Ya know what would be really helpful -- an RIAA eq. in which you can choose the much, much older formats -- Rod Elliot has the time constants somewhere on his website.

With this one could transfer those very old non-LP records without having to build a filter for each format.
  Reply With Quote
Old 22nd March 2007, 07:53 PM   #4
diyAudio Member
 
nuvistor's Avatar
 
Join Date: Jun 2004
Location: Richmond CA
Hello jiiteepee -

Are you the same person who has been posting on this as juha_p at kvraudio.com and as jtp_1960[ AT ]hotmail[ DOT ]com at musicdsp.org?

If so then I guess it is you who made this post at kvraudio.com.

If so then I guess you are using the IIR biquad filter coefficients referred to in that post, which are based on inverting the coefficients given in this post at musicdsp.org for playback equalization. The musicdsp.org coefficients are for an inverse RIAA filter with the recording equalization as defined in this Hageman app note fig.2.

I have looked at the conformance to RIAA playback curve of these coefficients for 44.1kHz using LTSpice, the magnitude response is about the same as a good RIAA preamp filter, +0.27dB at 4khz and -0.5dB at 15kHz compared to 1kHz, but the phase response leads with increasing frequency, +4.7deg at 4kHz, +13 at 9kHz and +32 at 15kHz.

I think the magnitude response could be improved somewhat below 15kHz but improving the phase response requires a higher sampling rate. The normal means of translating an analog filter to IIR biquad coefficients (bilinear transform) gives significant magnitude error above 5kHz which can be compensated for by "warping" the poles/zeroes before translation, but there will still be some magnitude error, and the phase error will not be improved. At 88.2kHz or higher the magnitude and phase response could be practically perfect.

I have been investigating software RIAA playback equalization out of curiosity, and if I were to implement this I would process the 50Hz pole and 500Hz zero in software and the 2122Hz pole and optional 50kHz zero in hardware, to reduce loss of amplitude resolution in the midrange (and improve the high frequency phase response though this is not significant at 88.2kHz), but I respect your request to not debate software vs. hardware approaches. In any case, 24 bit resolution is mandatory with a software approach and highly recommended with a hybrid approach.
  Reply With Quote
Old 22nd March 2007, 08:34 PM   #5
diyAudio Member
 
nuvistor's Avatar
 
Join Date: Jun 2004
Location: Richmond CA
Quote:
Originally posted by jackinnj
Ya know what would be really helpful -- an RIAA eq. in which you can choose the much, much older formats -- Rod Elliot has the time constants somewhere on his website.

With this one could transfer those very old non-LP records without having to build a filter for each format.

The Audacity sound editor (1.3 beta version) has an equalizer with presets for these older formats. It's an FFT filter so its phase response may be linear instead of minimum like analog filters or IIR filters derived from analog.
  Reply With Quote
Old 22nd March 2007, 09:22 PM   #6
diyAudio Member
 
Join Date: Mar 2007
Yep, same person.

Quote:
I have looked at the conformance to RIAA playback curve of these coefficients for 44.1kHz using LTSpice, the magnitude response is about the same as a good RIAA preamp filter, +0.27dB at 4khz and -0.5dB at 15kHz compared to 1kHz, but the phase response leads with increasing frequency, +4.7deg at 4kHz, +13 at 9kHz and +32 at 15kHz.

I think the magnitude response could be improved somewhat below 15kHz but improving the phase response requires a higher sampling rate. The normal means of translating an analog filter to IIR biquad coefficients (bilinear transform) gives significant magnitude error above 5kHz which can be compensated for by "warping" the poles/zeroes before translation, but there will still be some magnitude error, and the phase error will not be improved. At 88.2kHz or higher the magnitude and phase response could be practically perfect.
Are you talking 'bout those coeffecients F. Umminger released there? If so then those given for 44.1kHz are maybe not OK (compare those 44.1 vs 48 there).

I have calculated those 44.1kHz cefficients which I used in this evaluation version from different sources. If you just like, I can post you the link to the source (there are coefficients for 44.1-96 up to 3rd-4th 'order' available).

Quote:
I have been investigating software RIAA playback equalization out of curiosity, and if I were to implement this I would process the 50Hz pole and 500Hz zero in software and the 2122Hz pole and optional 50kHz zero in hardware, to reduce loss of amplitude resolution in the midrange (and improve the high frequency phase response though this is not significant at 88.2kHz), but I respect your request to not debate software vs. hardware approaches. In any case, 24 bit resolution is mandatory with a software approach and highly recommended with a hybrid approach.
Hmm... aren't the phase response problematic only when it's totally opposite w/ the frequency responce curve (IIRC, someone mentioned this). The Phase plot given here looks the same w/ the one I got from VST plugin analyzer (which supports 44.1kHz mode only).

If you like to check the RIAA filter evaluation version using higher samplerate coefficients, but you don't have Max/MSP there, you can download the trial version of it and just swap those coefficients I used there with 88.2 or 96 kHz ones (you need to transfer those complex values, given behind the link I post you if you like to, into decimal values 1st). Those F. Ummingers coefficients for 88.2 and 96 didn't work when inverted (produced an unstable filter) without changing the value a1 and a2 a bit so that the result in formula "-a1 - a2" didn't exceed 1.0. By manually changing those valuse the filter results differently ofcourse.


jiitee
  Reply With Quote
Old 22nd March 2007, 10:19 PM   #7
diyAudio Member
 
nuvistor's Avatar
 
Join Date: Jun 2004
Location: Richmond CA
Quote:
Are you talking 'bout those coeffecients F. Umminger released there? If so then those given for 44.1kHz are maybe not OK (compare those 44.1 vs 48 there).
Yes, that is all you have referred to in your posts elsewhere that I could find.

Quote:
I have calculated those 44.1kHz cefficients which I used in this evaluation version from different sources. If you just like, I can post you the link to the source (there are coefficients for 44.1-96 up to 3rd-4th 'order' available).
Yes, please do. I'm curious about how you calculated them, I guessed that you inverted and then perhaps adjusted the Umminger coefficients, but maybe not. Every reference to IIR biquad coefficients for RIAA eq I could find on the Web seemed to trace back to Umminger, and unfortunately he did not base his calculations on the actual transfer function for RIAA playback eq: (3.183e-4*s+1)/((3.183e-3*s+1)*(75e-6*s+1)), but on component values of an inverse RIAA filter from the Hageman app note.

Quote:
Hmm... aren't the phase response problematic only when it's totally opposite w/ the frequency responce curve (IIRC, someone mentioned this).
Theoretically the phase response of the combined RIAA recording and playback eq is flat, in other words 0 deg. To accomplish this the phase response of the playback eq should be as close as possible to the curve shown in your reference, a very good one BTW. The numbers I quoted were for the response of the combined eq using ((3.183e-3*s+1)*(75e-6*s+1))/(3.183e-4*s+1) for the recording eq and Umminger's inverted coefficients for the playback eq, this shows how closely the playback eq matches an ideal analog implementation. In practice of course the imperfect magnitude and phase response of the physical elements in the signal chain come into play so you can never acheive flat response with respect to the master tape, so the deviation may be of academic interest. In any case at 88.2kHz or higher the deviation should be insignificant, it's only an issue for 44.1kHz.
  Reply With Quote
Old 23rd March 2007, 01:30 AM   #8
diyAudio Member
 
Join Date: Mar 2007
Quote:
[i]Originally posted by nuvistor

Yes, please do. I'm curious about how you calculated them, I guessed that you inverted and then perhaps adjusted the Umminger coefficients, but maybe not. Every reference to IIR biquad coefficients for RIAA eq I could find on the Web seemed to trace back to Umminger, and unfortunately he did not base his calculations on the actual transfer function for RIAA playback eq: (3.183e-4*s+1)/((3.183e-3*s+1)*(75e-6*s+1)), but on component values of an inverse RIAA filter from the Hageman app note.
Inversing can be done by swapping a and b vectors and then just multiplying all values by 1/a0. Normalization for b's can be done then by dividing each b by the sum of b's. From Ummingers data, you get only 44.1 and 48 kHz filters stable.

Actually, these are inversed already ... depending on the usage, you perhaps need to transform from pole/zero presentation to coefficients only (I did use functions from DFilter component (comes with VST SDK for Delphi) for transform those 44.1kHz values I needed in the evaluation version ... need to tranform those higher order versions then later when it's topical).

And yes, don't ask, it's one of my 'personalities' as well in question, who started the thread there.


jiitee
  Reply With Quote
Old 23rd March 2007, 02:12 AM   #9
diyAudio Member
 
nuvistor's Avatar
 
Join Date: Jun 2004
Location: Richmond CA
I found the poles/zeros list by Orban in your reference and tried this one:

44.1 kHz:
SUPPLY # POLES IN Z-PLANE (<=10):2
Zero # Real Imag.
1 -0.2014898 0.000000
2 0.9233820 0.000000
Pole # Real Imag.
1 0.7083149 0.000000
2 0.9924091 0.000000
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

I get a magnitude error of 0.447dB or +/-0.2235dB, and a phase error of +53deg at 15kHz, consistent with the errors quoted. The contributor probably input the RIAA playback eq s-plane poles/zeroes into an program or Matlab script that calculates the z-plane poles/zeroes to match the s-plane magnitude. I noticed that Umminger does not explain his methods, but Orban does so in this thread.

I tried to get a single z-biquad from the s-biquad using a freeware called StoZ available at digitalfilterdesign.com. It carries out the bilinear transform, unfortunately the s-pole/zero entry does not work, give it s-biquad coefficients instead, and for 44.1kHz the resulting z-biquad is < 0.2dB low below 4kHz, 1.5dB low at 10kHz, 4.5dB low at 15khz. I have not tried this at 88.2kHz but the results are probably 1.5dB low at 20khz, the Orban results for a single biquad are much better.
  Reply With Quote
Old 26th March 2007, 11:29 PM   #10
diyAudio Member
 
Join Date: Mar 2007
No feedback/results yet??

Allright, maybe it is/was too hard to use or too limited to get your attention so, ... I prepared another evaluation version ... now it's fixed for 48kHz instead of 44.1kHz, it can be used without preamplifier too (in most cases) and it's possible to record the output to a 16-/24-/32-/32f-bit wav file (though, this needs another plugin being installed, see below).

I also added a "reset to defaults" button so It's possible to get everything working much easier. Subsonic filter is not improved ... it still cuts only 6dB/oct instead of 'required' 36dB/oct.

'bout recording the output:
You need to install Voxengo Recorder VST plugin into the same directory where to this RIAA Filter is placed to, to get the recorder working. Actually, you could use any plugin but it needs to be renamed equally to the voxengo recorder .dll. Set the "MME Device" to "Sound Mapper" .. otherwise you may hear some unwanted noises (those are not added into recorded file). Set the "Output To " -> "File". Name the file before recording. Set the bit-depth.


Here are links for the new version.
RIAA Filter (optimized for 48kHz) DEMO.rar
Mirror 1 -
Mirror 2 -


Hmm... still waiting some feedback/comments ...


jiitee
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
measuring RIAA filter accuracy robmil Solid State 0 14th September 2008 08:39 PM
Suggestions for RIAA Filter Caps? thermionic Solid State 8 27th March 2008 07:57 PM
design software for active filter dick van nierop Chip Amps 7 20th March 2006 04:25 PM
Filter Auditioning In Software mrfeedback Everything Else 2 20th April 2002 03:26 PM


New To Site? Need Help?

All times are GMT. The time now is 04:46 AM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2013 DragonByte Technologies Ltd. (Resources saved on this page: MySQL 27.27%)
Copyright ©1999-2013 diyAudio