Hi all,
I successfully built an RIAA equalizer with sigmastudio to Play vinyl discs.
Is it possible to filter the noise made from scratches on my discs ?
Michael
ADAU1701
Production
The ADAU1701 is a complete single-chip audio system with a 28-/56-bit audio DSP, ADCs, DACs, and microcontroller-like control interfaces. Signal processing...
Datasheet
ADAU1701 on Analog.com
Hi all,
I successfully built an RIAA equalizer with sigmastudio to Play vinyl discs.
Is it possible to filter the noise made from scratches on my discs ?
Michael
Hello Michael,
That's an interesting application. You could always reduce treble response, but we hope to do better with DSP. There's several possible methods, all of which depend upon the high-frequency content and the short time of the pops and ticks common to vinyl. Perhaps the most ambitious method is one that BSR developed many years ago. I remember reading about it and it works something like this: The incoming audio went through a short delay -- likely an analog bucket brigade at the time. Normally the listened-to sound is taken from the delay output. But when circuitry looking at the input detected a vinyl defect, it would wait until just before the defect reached the delay's end, then momentarily switch to the non-delayed signal to skip over the defect. Very cool!
It won't be a trivial undertaking, but something like this should be quite possible with SigmaStudio. In fact I had thought about making one of these but didn't pursue it. The key to detecting vinyl defects is their transient nature -- they come and go quickly. Most important, their direct mechanical production right at your turntable means there's absolutely no reverberation or echo in their decay characteristic. This separates vinyl defects from virtually any recorded sound, making the needed "click detector" possible to implement. Delays of course are easy in DSP, so there you are! Perhaps someone out there has already done this, but you'll have lots of fun developing it further yourself. And you won't burn your fingers on a soldering iron in the process!
Best regards,
Bob
Hi Bob,
thanks for your fast response.
My problem is how to detect that click, or what kind of filter do i have to use to detect it ?
Michael
Hello Michael,
There's no one filter or block to perform this function. We can, however, wire together several to help identify the clicks among the music according to their unique decay characteristic. In SigmaStudio there's often more than one way to do something -- and the more complex the function, the more ways exist. The method shown below is just one possibility:
I suspect (but don't know) that the vinyl scratches cause primarily vertical stylus motion. This would translate to out-of-phase (L-R) signals at the cartridge. Thus I made the circuit sensitive to such signals (of course you would be the expert on this). The peak-sensing envelope follower works much like a full-wave rectifier & capacitor filter. Its output rises instantly with input peaks, then decays in between. The feedback, multiplier and DC source establishes an exponential "RC" decay characteristic (otherwise, the decay is linear --
see https://ez.analog.com/message/146951?commentID=146951#comment-146951 ).
The "hold" time of 3 mS bridges the gaps between peaks, reducing output ripple. Without hold time the circuit responds to ripple, resulting in premature triggering of the "click" function which actually lets clicks through. At the peak follower's output we have a positive signal which follows the level of the (L-R) input.
Next, we need to sense a sudden downturn of this level, indicating that a loud disturbance came and went with a fast decay (a click or scratch). The following circuit takes the difference between the current sample and one two samples previous, to measure the rate of change. It's purposely wired backwards so the faster its input falls, the more positive its output goes. As a result, the higher the differentiator's output, the more likely there's been a click. So we can use the output of this circuit for our click detector.
No suggestion is truly helpful unless it has at least a chance of working, so I built a demo project to test it. In addition to the click filter, the project contains:
The project runs on the ADAU1701MINIZ board. I suggest using the built-in click at first. Add some music, and adjust the threshold downward until you see LED D5 blink, showing that the thing is finding the clicks. The clicks will then be rendered nearly inaudible! Next you can switch off the built-in clicker and try some bad vinyl. You'll need to add your RIAA EQ.
At this point you're free to come up with variations or an entirely new circuit. The more you learn about the blocks and what they do, the more likely you'll succeed. Here's a few more tips:
Best regards,
Bob
Hi Bob,
wow, thats a lot of stuff i have to understand.
I will try to implement this on my board, as i don't own the MINIZ board.
I will keep you informed and post my hopefully working project.
It is just for hobby, and anyone who wants can use it for non commercial projects.
Many thanks.
Kind regards,
Michael
Hello Michael,
Sorry I forgot to attach the project. Here it is. It should be fairly easy to adapt it to the Sure DSP or similar boards, just change your ins and outs. Anything needing more explanation, just ask. Hobby projects are fun!
Best regards,
Bob
Hi Bob,
finally I got the hardware and software running with good results.
The clicks of old vinyls are nearly inaudible and the RIAA curve is nearly 100% exact.
Now I would like to make some of the parameters (treshold etc.) externally adjustable via the AUX-ADC's
but I don't know how to do it in studio.
Kind regards
Michael
Hello Michael,
Glad to hear you got your hardware going. Now for the fun part, tweaking and improving your project. Your use of hierarchy boards is a fine idea, as well as providing external adjustments via Aux ADCs. The ADAU1701's aux ADCs go from zero to 1.0 decimal, so all we need do is scale this to the needed level. For example, the Threshold presently goes from -80 dB (or 0.0001) to -40 dB (0.01). The arrangement of gain, DC source, and adder shown below will provide approximately that range as you turn your pot connected to the Aux ADC:
There's more sophisticated approaches involving a Lookup Table (LUT) -- for an example of interfacing an Aux ADC and LUT, see https://ez.analog.com/dsp/sigmadsp/f/q-a/66309/logarithmic-pot-by-index-lut
Best regards,
Bob
Hello Bob,
finally I got an USBi interface, so testing my design is easy from now on.
I found a project from you about a dynamic loudness enhancer and tried to implement this
into my RIAA project to make old vinyls sound better. Unfortunately is does not work as expected.
Putting the loudness in front of the RIAA block works, but sounds not so good.
Putting the loudness after the RIAA block gives only hiss, like white noise,
but no music at all. And I don't know why.
Best regards,
Michael2746.Vinyl-fixer-RIAA-2.zip
Hello Michael,
The processing order in the project you have attached is the best: The click filter first, where it receives the best click information. Then the RIAA EQ, and finally, the dynamic loudness which operates on a normal (flat) signal. And yes, it hisses and quite loudly at that. Fortunately, another EZ engineer figured out why this happens and found an easy workaround.
The problem lies in the Dynamic Loudness circuit, which I made years ago before the problem was discovered. It turns out that when a Feedback block feeds two or more destinations via a T junction, the compiler doesn't assign memory for the extra connections. Occasionally it works anyway, as it did when I made the Dynamic Loudness. Other times it doesn't -- and the DSP departs to Mars. The result is that awful hiss. The fix is to use a separate Feedback for each needed signal:
Bad: Hisses
Good:
By the way, AD has used a similar "implicit" calculation arrangement in their analog RMS converter chips. Here it performs two mathematical functions which would otherwise require a boatload of ADAU1701 instructions. The higher-end DSPs (ADAU1452 and above) can handle square root and divide much more efficiently.
Making the above change will get rid of your hiss. I did notice one other thing you need to fix, this in the differential outputs. The Buffer Gates shown below are not audio buffers but are used for logic functions. They won't pass audio, only distortion. And you don't need them anyway so take them out!
Best regards,
Bob
Hello Bob,
thank you for the fixes.
I placed the Buffers there because I was thinking of timing issues between the positive and
negative outputs. The negative signal will be a bit delayed because of the inverters ?
Best regards,
Michael