lingDAC - cost effective RBCD multibit DAC design

I've been a bit quiet on the DAC design front for the past six months or so and the main reason for that - apart from working on a couple of amps - is that I've been investing many hours in MCU understanding and programming. Which isn't something I can usefully show progress in on this thread. But just yesterday I finally got my MCU project up and running with music coursing through it. Here's a pic - the MCU board is the blue PCB at the back:
2XOS_20240208164206.jpg


The DAC is a modified early prototype Abbado II - the mods are to accept a volume control and increasing the number of DAC chips from 16 to 24.

So what's the MCU doing here you might wonder? Its performing upsampling by a factor of 2, turning an RBCD input into an 88.2kHz output. The reason I've added this to Abbado II (and not higher performing designs) is because this DAC stands to benefit the most from upsampling given it has only a 5th order filter. With a 5th order filter the image frequencies aren't suppressed as much as with 7/9th or 11th order filters. The function of the 2XOS upsampler is to shift image frequencies (with NOS operation they start at 24.1kHz) to higher freqs (68.2kHz and up in this case). At 68kHz the 5th order filter has a respectable 72dB attenuation but at 24.1kHz it has only 20dB. In theory cleaning the ultrasonics out of the signal chain should give improved dynamics, so long as the filter itself isn't introducing any artifacts.

The firmware on the MCU is rather flakey at present, if the I2S stream gets interrupted for any reason the MCU puts out a continuous blast of white noise and that's rather unpleasant at high volume! So I need to figure out a way to ensure the code recognizes when there's a dropout and get it to resynchronize itself. I'm planning to make a measurement to check that the aforementioned attenuation of ultrasonics really is happening but in the meantime the listening is rather fun :cool:
 
  • Like
Reactions: 6 users
I made some rudimentary measurements to check that the 2XOS filter was indeed sending the image frequencies out to 68kHz and above and it does do that. However on the FFT I found its creating a new frequency and so far have not figured out how it does that. For example when the test tone is 8kHz, there's a new frequency at 22.05-8= 14.05kHz. This is distortion for sure but not harmonic distortion, rather a kind of imaging but within the audio band rather than outside it. All rather puzzling so I'll have to dig deeper. The first step is to find out whether introducing the MCU has somehow itself caused artifacts. So I'll implement a pass-through which bypasses the upsampling and see if there are any sub-imaging distortion components then.
 
Yes seems rather like aliasing, given the frequency ratios.

The algorithm is in effect zero stuffing then LPF though its not implemented that way as its rather inefficient in terms of MACs to run an FIR LPF where half the data is zero. So I'm using a pair of polyphase filters, the zero stuffing is implicit.
 
The pass-through is now implemented - with that I can turn off 2XOS and revert to NOS at the press of a button. The NOS isn't 100% pure though as the DAC WS is still 88.2kHz, so instead of one sample at 44k1 the chips receive two identical samples at 88k2. Anyway the NOS bypass doesn't show any 'aliasing' effect so I'll need to dig deeper into my 2XOS code.

On a parallel track I've been investigating EQing the Abbado output filter to flatten its passband ripples and also beginning to experiment with correcting its phase response. LTSpice is proving very useful to allow me to create the impulse response of the filter which Audacity then time-reverses. Saved as a .wav it can be used as input to the filter a second time, giving a result of a symmetrical sin(x)/x curve at the output:

image_2024-02-18_102903043.png

For EQ I've played with Rephase which gives customizable EQ parameters and seems to indicate somewhere in the region of 4 biquads will be needed to get the passband satisfactorily flat. Knowing that EQ's going to be used means that the filter can be redesigned for improved stop-band rejection at the expensive of pass-band ripple. The question is - how bad (i.e. ripply) can the pass-band be allowed to get? Is there a point where the stop-band rejection doesn't get significantly better? Introducing EQ also reduces the dynamic range so that's a tradeoff to take account of too.

image_2024-02-18_103527093.png
 
  • Like
Reactions: 1 user
Thanks for your perennial encouragement George. I wonder if any readers would be interested in an optimization problem, to see the most economical way to flatten the frequency response of a Chebyshev lowpass filter. I understand REW has an optimization engine but when I tried it it seems my filter is already too flat for it, its used to correcting acoustic responses which can deviate double digit dBs easily, so my filter with less than 2dB ripple is already seen as effectively perfect with REW. A manual approach using Rephase is what I've been using and I get this after some tweaking :

image_2024-02-18_172513151.png


To get this degree of flatness takes 4 EQ sections, I did have to tweak their centre frequencies from the standard ones Rephase provides. But there may well be a better optimum, after all I've only whiled away half an hour or so playing with this.. If anyone has Rephase or is willing to download it, I'd be interested in anyone else's solution. This is just for fun as optimization problems intrigue me.

The original filter FR is attached, designed using https://markimicrowave.com/technical-resources/tools/lc-filter-design-tool/ with a 17.7kHz cutoff and 1.75dB ripple. However I added some series resistance to the inductors in LTSpice which droops the FR somewhat. Using Rephase the .txt file can be loaded in with the 'import from file' command which will give you this plot. Your mission, should you choose to accept it is to flatten it as best you can using the EQ controls (bottom left pane in Rephase), 'Paragraphic Gain EQ' tab. Best to load the 'flat 1/3rd octave high freq' preset and set the gain range to minimum (3dB).

image_2024-02-18_173821787.png


https://rephase.org I did have a problem at first with this software as it asks for .NET 2.0 which is truly ancient but eventually I did find a link to that package. More's the pity I can't recall where right now.
 

Attachments

  • Cheby5th1.75dB.txt
    116 KB · Views: 14
Can't sadly help but find all this interesting.

Perhaps a way to see how far to go with the trade-offs, or also how far to go re tweaking the filter's response, would be to perform some listening tests so you know where to stop. Flattening response curves or reducing ringing on impulse response can be endless, but when does it start to get meaningless?

Good luck and thanks again for sharing this

Claude
 
Hi Claude - you have put your finger on the issue here. I don't know if a flatter FR will sound better so I'm not doing it for that reason, rather for the sake of completeness so as not to leave any stone unturned. I have the hypothesis that phase correction will make an improvement and I don't want to leave that undone. Put it down to trying to overcome my own inherent laziness plus following my curiosity. If it makes no difference then I can always disable it but at least I'll have proved to myself (even if to no-one else) that I can do it. I wonder if, marketing-wise my designs might well have more appeal if I can point to a modicum of measurements.

Low frequency phase correction I have heard for myself so I'm a believer in that already. But I'm unsure whether I'll add that feature to the firmware at present as its an issue introduced by loudspeakers, not DACs. So I'm not sure that the DAC is the ideal place to introduce that.

Oh and as regards listening tests I have one underway at the moment, using wifey's ears rather than my own. I'll reveal the nature and result of that when its done.
 
Your mission, should you choose to accept it is to flatten it as best you can using the EQ controls (bottom left pane in Rephase), 'Paragraphic Gain EQ' tab. Best to load the 'flat 1/3rd octave high freq' preset and set the gain range to minimum (3dB).

On second thoughts please don't spend any time on this, at least not just yet. I'd made the assumption that the EQs would run at 44.1kHz but modelling the biquads with this sample rate in LTSpice does not produce the flattened result as shown in post#1647. So whatever the rate is, it isn't 44.1k but I really need a solution at that rate for the DAC.
 
I applaud your relentless quest for improvement paths and do fully understand - even share - it!

LOL on the marketing around mediocre measurments

Low frequency phase correction, yes makes sense on a lot of speakers... is rather indeed a LS issue, but then who knows, might be handy at DAC level (easier costwise at the source?), that is as long as you are all digital.

Keep us posted, we do read you... with lot of pleasure !

Claude