Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

Digital Line Level DACs, Digital Crossovers, Equalizers, etc.

DIY DAC goodness
DIY DAC goodness
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 20th May 2017, 07:20 PM   #1
Noah Santer is offline Noah Santer
diyAudio Member
 
Join Date: Feb 2017
Default DIY DAC goodness

Hi, I posted a few months ago about a FPGA-based digital-to-analog converter, and I'm happy to say that I've made a lot of progress.

I have two working versions, one uses a board by the company Digilent called the "CMOD A7" that's a breadboard-able Xilinx FPGA. It only has USB connectivity via a serial connection so I set it up to play PCM data sent over that line, and made a little Python driver script. It's flow controlled, so there's no bit slip due to the interface--everything's re-clocked on the FPGA and buffered there. On Linux you can even tell ALSA to redirect all sound to the script so it's more like a sound card.

The other version uses a similar board by Trenz Electronics that includes an ARM core alongside the FPGA (Xilinx's Zynq technology) and plays WAV files off a microSD card, mp3-player style (support for compressed formats is proving difficult due to limited available memory... if anyone knows of decoders that will work with less than 256K holler!)

Both of the boards suffer from electrical noise that dominates the DACs response, so my next step is to design a custom board more suited to analog signals--but these are nice proofs of concept that it's possible.

It's all dependent on the Xilinx tools, but those are free (although I believe there are export restrictions, ymmv.) The modulator, UART, and software I wrote myself -- optionally, it's easy to plug in a CIC or FIR interpolation block between the buffer and the output and Xilinx provides canned solutions for both. I'm not an expert in the topic, but I haven't gotten satisfactory gains from including either. It's something I want to look into.

The DAC logic itself is quite simple, set up as a Delta-Sigma modulator with one, two, or three delta registers and flexible coefficients. Something I've learned from this is that there's definitely multiple ways to skin the hog, extensive simulation and testing still has me waffling between the way different modulation schemes sound. (Right now I'm listening to what I've termed [+1,+1] and it has beautiful low-end response but, sadly, audible distortion in extremely quiet passages.)

The flexibility and ease of A-B testing is, in my humble opinion, the best feature of this whole thing--I can listen and test different architectures back-to-back with ease.

This is getting long, but I wanted to end by saying if folks are interested, I'm more than willing to hook anyone up with source code and "getting started" info.

-Noah
  Reply With Quote
Old 21st May 2017, 06:49 AM   #2
Extreme_Boky is offline Extreme_Boky
diyAudio Member
 
Join Date: Dec 2003
Quote:
Originally Posted by Noah Santer View Post

(Right now I'm listening to what I've termed [+1,+1] and it has beautiful low-end response but, sadly, audible distortion in extremely quiet passages.)



-Noah
Maybe upsample and add some dither beforehand. Adobe Audition maybe? See if that makes any difference.

You could also power Cmod A7 up with an external 3.3 -5.5V, so I suggest giving that a try, in an attempt to obtain better noise performance.... shunt regulator would work really nice here.
  Reply With Quote
Old 22nd May 2017, 08:46 PM   #3
MarcelvdG is offline MarcelvdG  Netherlands
diyAudio Member
 
Join Date: Mar 2003
Location: Haarlem, the Netherlands
What do you use as the actual digital to analogue converter? Simply an FPGA GPIO, a re-clocking flip-flop on a clean supply, an RTZ DAC made with a few logic gates on a clean supply?
  Reply With Quote
Old 22nd May 2017, 09:12 PM   #4
Noah Santer is offline Noah Santer
diyAudio Member
 
Join Date: Feb 2017
A FPGA GPIO, yeah. It's shocking that it works, honestly. But it does.

I want to try a reclocking flip-flop on a clean supply, but I haven't yet.

Right now I'm focused on digital filtering possibilities.

Edit: the very low tech solution of a powered USB hub helped a lot with background noise.
  Reply With Quote
Old 22nd May 2017, 09:27 PM   #5
MarcelvdG is offline MarcelvdG  Netherlands
diyAudio Member
 
Join Date: Mar 2003
Location: Haarlem, the Netherlands
OK, but then it is hardly surprising that soft passages don't sound good. Who knows what kind of crap you have on your reference (FPGA I/O supply)? It should improve a lot with a reclocking flip-flop and a return-to-zero gate on a clean supply.

Are you interested in apodizing filters?
  Reply With Quote
Old 22nd May 2017, 09:38 PM   #6
ArchimedesMP is offline ArchimedesMP  Germany
diyAudio Member
 
Join Date: Apr 2017
Hi Noah, did you read this?
https://www.ee.usyd.edu.au/people/ph.../dac_fpt03.pdf
The paper is called "An FPGA-based Re-configurable 24-bit 96kHz Sigma-Delta Audio DAC", but it's already pretty old (2003) and not too much details.
It describes their Sigma-Delta DAC with a 64x/128x/192x interpolator, 3th or 5th order SDM.
They tested it on two boards: One is a "Celoxica RC200" with a Xilinx Virtex II XC2V1000. The other their own "Pilchard" memory interface board with a Xilinx XCV1000E. That board seems to be designed for data processing (mainly cryptograhy, it seems).
But they claim a extreme good SNR (up to 170db at low playing levels; but 115db seem more likely for realistic scenarios).

Due to the rather dodgy quality of the paper, and since I could not find a follow-up paper (seems they did that for a conference), I suppose that was the work of a student who decided he could build a DAC for home use and his final thesis
  Reply With Quote
Old 22nd May 2017, 10:31 PM   #7
MarcelvdG is offline MarcelvdG  Netherlands
diyAudio Member
 
Join Date: Mar 2003
Location: Haarlem, the Netherlands
They claim extremely good signal to noise ratios (139.8 dB...170 dB) measured with a logic analyser, that is, with only quantization noise taken into account and without any of the non-idealities of a real-life DAC. The analogue performance "will be presented at the conference".
  Reply With Quote
Old 22nd May 2017, 10:40 PM   #8
MarcelvdG is offline MarcelvdG  Netherlands
diyAudio Member
 
Join Date: Mar 2003
Location: Haarlem, the Netherlands
By the way, Noah, nice project! Much cooler than making standard applications for standard interpolation filter and DAC chips!
  Reply With Quote
Old 22nd May 2017, 11:08 PM   #9
ArchimedesMP is offline ArchimedesMP  Germany
diyAudio Member
 
Join Date: Apr 2017
Quote:
Originally Posted by MarcelvdG View Post
They claim [...] without any of the non-idealities [...] "will be presented at the conference".
As I said, dodgy

As I understood Noah, he is using "only" a third order SDM, and the graphs in the paper look a lot as if they achieve their... uhm... good results with a fifth order SDM. So the noise shaping becomes steeper, and [I'd guess] requires a steeper filter between the the FPGA and the audio sink.
They also interpolate data points, so effectively they are are over-sampling at 96kHz*64 = 6.144MHz. No idea how big that impact is.

Noah: I read some stuff on FPGAs and am very impressed with what you're doing! The TE board seems quite nice feature wise, but the whole Zinq platform seems to be not exactly beginners turf. If you're getting somewhere with that, I *really* have to disciple myself from ordering one; especially considering word at this years LLVM conference was that they're interested in compiling for FPGAs
  Reply With Quote
Old 23rd May 2017, 01:15 AM   #10
Noah Santer is offline Noah Santer
diyAudio Member
 
Join Date: Feb 2017
Yeah, I have the advantage that FPGA tech has come a long way since the Virtex II. Five generations, actually, I'm using an Artix/Zynq 7.

They upsampled up to 192x, I'm actually using ~2000x upsampling of a 48KHz signal. I've looked into higher order sigma-delta, but you end up needing to restrict the amplitude and throw away linearity as you do so. (e.g., quantizing at double the max amplitude puts you one bit farther away from where the SDM works best, and so on.)

That much upsampling eases the restrictions on the analog-side output filter considerably too. No need for high-order cutoffs and such.

A quick simulation shows that their claim of >140dB SNR is easily achievable for sine waves no more than ~3 bits below peak... Which isn't really representative in my opinion, almost all of the troubles I've run into are when the music quiets down.

That 3-bit figure is without interpolation, though. The FPGA can easily pull FIR filters with thousands of taps to do interpolation, but I've not ironed out all the details.

@ArchmidesMP Not only is the Zynq platform not "beginners turf", that TE board is a royal pain above and beyond the usual Zynq difficulties. It *is* cheap, though. Even after you throw in the cost of a JTAG adapter.

Also... what's an apodizing filter?
  Reply With Quote

Reply


DIY DAC goodnessHide 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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
McIntosh Goodness From Scratch Rosinante Tubes / Valves 144 16th November 2016 06:01 AM
Aussieamp related goodness for cheap ShinOBIWAN Swap Meet 12 6th May 2010 11:40 PM
Using a computer for DSP audio goodness??? rochmndx Digital Line Level 2 7th March 2009 11:06 AM


New To Site? Need Help?

All times are GMT. The time now is 08:20 AM.


Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 15.79%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Copyright ©1999-2018 diyAudio
Wiki