Kyma Forum
  Kyma Sound Exchange
  RIAA Equalization and other notes

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   RIAA Equalization and other notes
David McClain
Member
posted 20 April 2001 13:22         Edit/Delete Message   Reply w/Quote

riaa_eq.zip

 
Attached Zip file contains the required spectral shapers for block FFT equalization of the RIAA transfer function. The sound produces the RIAA equalization using one of these two shaper files (AIF files).

The shaper files were computed from a Mathematica description of RIAA equalization, then normalized to a max gain of unity. It is a simple matter of cutting and pasting to generate the associated AIF files. Just use a 4096 element table of values interpolated on a linear frequency scale (from 0 Hz to Nyquist) and in direct amplitude space (not dB's). Then paste your table in the following skeleton code and run from the Kyma waveform editor...
--------------------------------
| fileBuffer correction |

correction := #( ...insert table here...).
fileBuffer := self getFileBuffer.
1 to: 4096 do: [ :i | fileBuffer writeSample: (correction at: i)]
---------------------------------

The correct shaper file to use depends on your sample rate. There is one file for 44.1 KHz, and another for 48 KHz. While the difference (about 9%) is very noticeable for osciallators, it is probably not noticeable for broadband filtering.

Right now the equalization sound is using 512 point FFT's. Go ahead and change them to any other power of two. The shaper files remain the same.

There is no DC blocking incorporated in these transfer functions. You should ensure that ahead of this sound. Because of the gentle logarithmic behavior of these transfer functions, I didn't bother to convolve with Kaiser windows or anything else.

This sound should probably be used in preference to the 11-band Graphical EQ sound that I put here last night. I think the Graphical EQ with only 11 bands is too coarse at correcting the RIAA curve.

One neat thing about the Kyma/Capy oscillator is that by means of its interpolation you can run these correction tables at any FFT length you want without ever needing to change the table contents. I find this very satisfying for rapid prototyping!

Anyone know the transfer function for Dolby/B or DBX used on casette tapes about a decade ago?

- DM

[This message has been edited by David McClain (edited 20 April 2001).]

IP: Logged

John Dunn
Member
posted 24 April 2001 17:33         Edit/Delete Message   Reply w/Quote

phono_in.zip

 
David,

Thanks for the phono input Sound. I've had a good time playing with it, perhaps even learning a thing or two along the way. Unfortunately, as a practical replacement for the phono input on a stereo receiver, it doesn't quite work. Two problems, one I could fix and one I could not.

The fixable problem is simply that you set it up as a mono input. Which makes sense, just use two for stereo, right? Not quite in the real world because stereo phono cartridges are the norm - you might find a mono one somewhere, but I can't guess where. So even with a mono record, there are slight differences between the left and right channel, and you will get phasing if you assume they are the same signal. It was a pretty simple fix, which I have done, and uploaded here.

The problem I couldn't fix, is that it results in a harsh sound. Sort of like an aural exciter gone bananas. I tried adjusting input and output levels, but was not successful at cleaning it up. So in the end, I borrowed my neighbor's stereo receiver and that worked fine for the job at hand.

But I really like what you have done with your filter thread - I plan to download the others and try them out. The IQ ring modulator sounds especially cool. I'll give feedback when I am able to give it a go.

Regarding DBX and Dolby-B. I can't give you any help on the transfer function. But I can tell you that while Dolby companded only the high frequencies (which you most likely know), DBX companded the entire bandwidth, without filtering. As a result, Dolby A, B, & C worked pretty well with tape, where tape hiss was the main noise problem. DBX worked for some kinds of sounds, but it had a severe "breathing" problem with simple sounds like synth music. This because there always must be some lag in the compression/decompression, and so transients were overshot a lot. Sounded terrible.

John


IP: Logged

David McClain
Member
posted 24 April 2001 22:31         Edit/Delete Message   Reply w/Quote
Just wondering what causes the runaway exciter effect? Sounds like the compensation we gave doesn't cut deep enough at the high frequencies.

I notice that the compensation filter you were using was not windowed. But unless you have massive amounts of bass I wouldn't expect the filter leakage to cause this effect, especially given the steep rolloff of the RIAA curve.

I did notice, during other experiments, that the FFT in Kyma likes about a -3 dB input attenuation. It seems to have trouble with sound that tops the scale.

I wonder if windowing is really more important than I had thought here?

(...and yes I fully expected that you would need to double up the sound for stereo...)

And, by the way, thanks for the input on DBX encoding. I didn't know anything about it except that my old Porta-Studio used it. I was aware of the Dolby style compensation, but I don't have any specifics for it.

- DM

[This message has been edited by David McClain (edited 24 April 2001).]

IP: Logged

pauld
Member
posted 27 April 2001 00:43         Edit/Delete Message   Reply w/Quote
I didn't realise that people were actually trying to use the Capy for record playback instead of attempting the RIAA curve as an interesting exercise (which it is). . .

Basically, as you've discovered, it can't be done. The best thing to do if you want to play records is to use a phono preamp. Decent units range in cost from $20 - $200. The important issues are that the RIAA encoding was done with analog filters, and the input loading for the phono cartridge. This should be a parallel RC network with a 47K ohm resistor in parallel with a 33pf capacitor. That is for a "moving magnet" phono cartridge. A "moving coil" phono cartridge needs another 10dB of gain, and a cartridge specific load of somewhere between 10 and 220 ohms with 0 - 300ish pf.

I think the best course of action is to either use a hi-fi amplifier with the aux/tape outs going to the Capy (which is what I do), or a specific phono preamp. One thing to watch out for is that some manufacturers do not correctly follow the RIAA playback spec and they fail to roll off the sub bass. This can cause a lot of very low frequency (record warps etc) energy to be input to the Capy, limiting your dynamic range.

Cheers,
Paul

IP: Logged

Bill Meadows
Member
posted 27 April 2001 14:43         Edit/Delete Message   Reply w/Quote
quote:
Originally posted by David McClain:
Just wondering what causes the runaway exciter effect? Sounds like the compensation we gave doesn't cut deep enough at the high frequencies.

David, I had a similar problem running your 11-band EQ. I my case it was "buzz", especially noticeable in the lower frequency bands (3-6). I changed you rectangular window to a smoother one (Ham or Hann) and it was improved.

Didn't you have this problem?


IP: Logged

opiumeater
Member
posted 27 April 2001 22:14         Edit/Delete Message   Reply w/Quote
I couldnt run any of davids files. I guess I need more DSP cards.

IP: Logged

David McClain
Member
posted 29 April 2001 21:45         Edit/Delete Message   Reply w/Quote
Bill,

I don't know which window you are referring to... The output window should remain a centered rectangle equal to half the duration (2048 samples) of the AIFF file (4096 samples). I presented a Hanning windowizer based on frequency domain convolution that should clear up any filter bleedthrough. And no, I didn't have any of these problems you refer to, unless you are speaking of the "unwindowed" versions of my Sound being fed by a lot of bass energy.

I tested these EQ filters using both pink and white noise, using source cross-corellation to get the transfer function amplitudes and phase characteristics. I can certainly believe that the unwindowed versions would demonstrate problems. But the Hanning windowed version should be just fine.

And Paul, why do you state that the Capy can't be used for this purpose? Are you hinting that some phase shift is necessary? And in that case, couldn't the Capy run an IIR filter with the correct phase and amplitude response?

[Aha! Bill! I'll bet you are referring to the original adaptation from SSC with the upper branch of the Talking Forced Air Heater Sound...

That one had a window applied to the input ahead of the FFT. Doing so produces a buzz roughly equal to your sample rate divided by the FFT length - which with 48 KHz sample rate and 512 length FFT's would be around 100 Hz. Yes indeed!

You don't want any window applied to the input sound ahead of the FFT's. You want the windowing applied to the filter frequency response as with my convolutional Hanning windows.

The output window is simply a re-assembler that throws away the artifacts at the beginning and end of each sound block. These artificts are produced by the circular convolutions of the sound and the filter. The central part of the convolution is unmolested by these circular artifacts and that is what is preserved by the centered rectangle output window.]

- DM

[This message has been edited by David McClain (edited 29 April 2001).]

IP: Logged

David McClain
Member
posted 29 April 2001 22:42         Edit/Delete Message   Reply w/Quote
Bill,

I just tried a configuration that fed a stereo signal to the 11-band EQ and found the buzzing that you were talking about...

Realize that the 11-band EQ as submitted is a strictly monophonic EQ. Feeding a stereo signal to it causes a buzzing since the FFT alternately forms the frequency domain values for left and right channels. This switches back and forth about 100 Hz causing a buzz unless you feed a monophonic signal to the input stage. That's the reason for the 512 sample delay line inserted into the left channel at input. It simulates a left and right channel signal from a mono input.

By placing a 1 sample delay right after the input stage I can feed a stereo signal to the EQ without getting the buzz, because the delay throws away the stereo right channel and forces a delayed left channel on both outputs. Now the buzzing is gone...

If you want the sound to work in stereo you have to double up the EQ for separate left and right channel processing.

- DM

IP: Logged

John Dunn
Member
posted 30 April 2001 04:57         Edit/Delete Message   Reply w/Quote
That's what I did, in the above "phono_in.zip," or at least it's what I thought I did & what I intended. Buzz is still there.

IP: Logged

pauld
Member
posted 30 April 2001 09:37         Edit/Delete Message   Reply w/Quote
[QUOTE]Originally posted by David McClain:
[B]Bill,

And Paul, why do you state that the Capy can't be used for this purpose? Are you hinting that some phase shift is necessary? And in that case, couldn't the Capy run an IIR filter with the correct phase and amplitude response?
- DM

Hi David et al, it's a combination of the load required for the phono cartridge, the amplification required and the phase shift required to properly compensate for the RIAA encoding. All of these are signifigant factors in getting a good quality transcription of what's in the vinyl grooves. Boosting the phono cartridges signal, say with a mixer (cartridge not properly loaded then), before equalizing it (in the Capybara) leads to some problems. The phase response of the phono cartridge will be out of spec because the load is not right, as will the HF amplitude response - it can ring too. Also, increasing the gain of the signal before equalising it can lead to problems because any distortion added at the peak of the unequalised signal (by adding gain to all of that HF energy, including crackles and pops) will result in nonlinearities at the crossover region of the signal after equalisation. This has a particularly nasty sound as the ear is more sensitive to this.

While, as you say, it is theoretically possible to do it all with the Capybara, I find it impractical when for 20 bucks I could get a "radio-shack" like dedicated phono amplifier to do the job quite nicely and I could use my DSP power for other things... So it's mostly just my opinion, but it's based on experience as I have been doing this recently to get quite a few old electroacoustic music records onto CD.

Cheers,
Paul

IP: Logged

David McClain
Member
posted 30 April 2001 13:08         Edit/Delete Message   Reply w/Quote
Paul,

Thanks for your input on this. And I agree that the DSP's probably have better things to do. Your description of the input network is the Bessel filters I was originally talking about. Knowing manufacturers, they wouldn't put in anything very elaborate when a few pennies would do...

Bill got me thinking about his output windowing and so I sat down and reworked the math on this one. I originally developed it from a seat of the pants approach and there are some gotchas in the way I implemented these filters....

The convolutional windowing of the filter transfer functions approximates a full-interval windowing instead of a zero-padded windowed filter as I originally intended. Hence, there are end effects throughout the entire result due to the circular nature of convolution here. Had these filters actually been half-length windowed filters then my spectral-joiner rectangular window would have been appropriate.

But because there are end-effects throughout the entire result, I find that in fact, using a different window, such as hann or Bristow-Johnson, actually improves the filter rejection considerably. {Spectrum analyzer shows -72 dB stop-band rejection for Bristow-Johnson windows, vs. -48 dB for my spectral-joiner window.]

Basically we want to suppress the end-effects as much as possible while joining successive sound blocks back together. All of these filters will have diminishing time-domain behavior, but not zero values in the wings, as would have been had with half-length, windowed, and zero padded filters. That, coupled with my whole-interval Hanning windowing of the filters instead of half-interval Hanning windowing, means that there will be leakage over the entire output window, and not just confined to the first and last quarter intervals.

Hence, using a smoother output window to glue the sound blocks back together does improve the overall behavior of this block FFT approach. The spectral-joiner window (centered half-width rectangle) is really only appropriate when you have used interpolated half-length FIR filters.

Thanks for tickling my neurons on this one... As it happens I was in the midst of doing something similar for producing spectrally shaped noise records for my work, completely unrelated to my Kyma fun. There is considerable overlap between my analysis work and the things I play with in Kyma, and I often use the Kyma to test out scaled models of my ideas.

- DM

[This message has been edited by David McClain (edited 30 April 2001).]

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply

Contact Us | Symbolic Sound Home

This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.


Ultimate Bulletin Board 5.45c