
Home  Forums  Rules  Articles  The diyAudio Store  Gallery  Blogs  Register  Donations  FAQ  Calendar  Search  Today's Posts  Mark Forums Read  Search 
MultiWay Conventional loudspeakers with crossovers 

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 

Thread Tools  Search this Thread 
2nd July 2008, 03:54 PM  #1 
diyAudio Member
Join Date: Dec 2003
Location: Oslo, Norway

Digital Xover project
Hi guys,
For some time now I have been working on a CD player project. It so happens that I'm using an FPGA and 4 fully separate DAC channels. So why not try to put a digital Xover into the thing! But I've never built Xovers before. My experience is more on combined digital and analog filter design without speaker elements involved. So I need some feedback on what makes sense and what does not. My initial design is as follows: An 8x oversampler takes CD input samples gives me stereo data at 32bits / 352800 samples pr. second. The resolution at this stage is more or less arbitrary. It comes form the 16bit dynamic range of a CD and will eventually be dithered down to 24bit for the DACs. Each of the stereo channels is passed through 2 Xover filters to produce Lhipass, Llopass, Rhipass, Rlopass. I can make more filters but four is the number of analog outputs on the board. The four outputs will have separate digital volume control (0 to 6dB) to adjust for any gain differences between bass and treble. Master volume control will still be analog and external. The Xovers themselves I imagine as 5th order IIR filters where the coefficients can be uploaded via RS232 on the fly. The coefficients are also 32bit, although the FPGA compiler can stretch a bit further. The output signal to be fed back in the IIRs is dithered down to 32 bits. I plan to use Direct Form I with parts from the Xilinx MAC core. With digital IIRs it is possible to make Xovers where the hipass and lopass parts add to 1, and hence play back with linear phase. (Search for my previous posts.) But to do that the IIR itself needs higher order (5) than the resulting hipass and lopass (3). Hence generic 5th order digital IIR filters. So to some questions: 1) Do you think 32 bit coefficients and feedback will do? 2) What types of filters would be interesting? Remember that bilinear transform may emulate Laplace filter equations that don't necessarily map into RCL structures. My ultimate goal is to build a speaker with very simple and linear analog electronics (perhaps only DC blocking for the tweeter) and then use digital filters to make the whole setup linear phase. What do you think? Cheers, Borge 
2nd July 2008, 07:19 PM  #2 
diyAudio Member
Join Date: Jun 2004
Location: Warsaw

Last time I (with my collegue) designed a FPGA filter I downloaded a free filter design software, which calculated everything to me. It was for video, so I used FIR design. I guess you can also use a FIR for lowpass and use subtraction to get hipass.
Hope this helps. Regards Adam 
3rd July 2008, 01:27 AM  #3  
diyAudio Member
Join Date: Mar 2003
Location: Mountain View, CA

Quote:
Quote:
Quote:
Quote:
Certainly, FIR filters are the "traditional" way of obtaining linear phase, and they give a lot of flexbility. Modern FPGAs are definitely powerful enough to implement reasonablelength FIR filters with no trouble.
__________________
Wingfeather 

3rd July 2008, 11:30 AM  #4  
diyAudio Member
Join Date: Dec 2003
Location: Oslo, Norway

Quote:
If I go above 35 bits for coefficients or indata, Xilinx starts needing more resources than 18x18 multipliers working in parallel. So that's sort of a hard limit. And the SPI I/O that uploads coefficients has been set to 32 bits. No hassle really to add another byte to the I/O and accomodate 35..... Quote:
Quote:
Quote:
New digital XO project It's amazing what you can do with FPGAs. I used to work with Xilinx distributed arithmetic filters. But on June 27 they released version 4.0 of the FIR generator. Now I'm able to seriously upscale my FIR filters since the library uses the embedded multipliers on the chip. Just plug in what I want and it makes the hardware for me. The trick, though, is still to develop the math behind the filters and coefficients. That's still an art. But it has become so much more fun now that the tools have improved. I didin't plan on going brickwall with the speaker outputs, even though that is possible with FIRs. I don't have a good reason to prefer IIRs, that's just a hunch. Please let me know what you think of that previous post on linearizing the phase. Cheers, Borge 

3rd July 2008, 03:35 PM  #5 
diyAudio Moderator Emeritus
Join Date: Oct 2007
Location: Santa Cruz, California

linearizing the phase requires adding delay, something you get for free with an FIR. 1020ms to do the job properly although you can get good results (minimum phase) with 510ms.
edit: you're thinking about a 2way right? so XO frequency is higher (>1KHz)? I was talking 3 way where midrange HP can be 200Hz or so. Wil you be correcting the drivers also? 
3rd July 2008, 09:04 PM  #6 
diyAudio Member
Join Date: Dec 2003
Location: Oslo, Norway

Sure, if I knew more about speakers, I'd try linearizing them too. As you saw in my previous post, I do consider using the natural poles of the speaker elements to build sumtounity IIRs.
Borge 
4th July 2008, 12:38 AM  #7  
diyAudio Member
Join Date: Mar 2003
Location: Mountain View, CA

Quote:
Quote:
Quote:
In my own filters I've used 32bit coefficients with doubleprecision feedback to yield 96bit intermediate results. It's a bit overkill most of the time, admittedly, but keeps quantisation noise in the 32bit filter below the 32bit noisefloor for all feasible IIR designs (a cutoff of 1Hz and a Q of 30 was the toughest I tested), and can even be computed relatively efficiently. Quote:
The approach looks interesting, though. I have yet to find the time to break out the pen and paper and see if I can come up with anything useful. I'll let you know when/if I can, and am definitely interested in anything good you can find.
__________________
Wingfeather 

4th July 2008, 05:41 AM  #8 
diyAudio Moderator Emeritus
Join Date: Oct 2007
Location: Santa Cruz, California

with a 5th order IIR as you spec'ed, I think you'll be OK with 32bit math. However, the 5th order IIR may not be sufficient to phase correct your crossover. As you increase the IIR filter order the math precision requirement increases to keep noise in control.
This is where your tricks may be patentable. I think this is why there isn't much advice on how to proceed here. 
4th July 2008, 07:32 AM  #9  
diyAudio Member
Join Date: Dec 2003
Location: Oslo, Norway

Quote:
It's not really that patentable after I put it in public view on diyAudio :) It might be in the US, where I believe you can publish up to a year before patenting. I did think about patenting the trick, but it's a tricky kind of investment and also hard to patent algorithms and equations. 

4th July 2008, 07:39 AM  #10  
diyAudio Member
Join Date: Dec 2003
Location: Oslo, Norway

Quote:
And the T in my equations is \tau, the time contsant. Let me know if the equations make sense. What I do is to use a very bengn set of poles (denominator being (Ts+1)^3 or (Ts+1)^5 ) and do weird things with the numerators (zeros). I did try designing some custom poles, and took a big trip down unstability lane! Borge 

Thread Tools  Search this Thread 


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Anyone interested in a digital amplifier project?  Rookie  Class D  552  24th September 2014 08:29 PM 
New digital XO project  borges  MultiWay  2  8th January 2008 06:49 PM 
digital volume pot project  digi01  Digital Source  172  27th August 2005 01:31 PM 
AC3  Dolby digital project  ksprul  Digital Source  3  2nd July 2004 01:14 PM 
New To Site?  Need Help? 