Digital speaker phase correction? - diyAudio
Go Back   Home > Forums > Source & Line > Digital Source

Digital Source Digital Players and Recorders: CD , SACD , Tape, Memory Card, etc.

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 12th November 2002, 03:05 PM   #1
Bill F. is offline Bill F.  United States
diyAudio Member
 
Bill F.'s Avatar
 
Join Date: Nov 2001
Location: SW MI
Default Digital speaker phase correction?

I only recently became interested in the possibilities of FIR DSP crossovers and EQ, and I understand little about either.

I understand DSP EQs can be programed to apply the inverse of a speaker's frequency response transfer function for flat frequency response.

In the digital domain, is it possible to do the same with a driver's phase response? For example, could DSP flatten the phase of a full-range driver in a reflex alignment which would otherwise have 200+ deg. of phase shift in the lower octaves?

If this is possible, it seems to me that the resulting performance (with EQ) could be phenominal.

Thanks in advance,

Bill
  Reply With Quote
Old 12th November 2002, 05:07 PM   #2
diyAudio Moderator Emeritus
 
roddyama's Avatar
 
Join Date: Jan 2002
Location: Michigan
Hi Bill,

I too have been interested in the idea of dealing with some of the common loudspeaker anomalies by way of digital processing techniques. It would seem that areas that have always been a problem in the analog world such as frequency response and driver offsets, can be dealt with using digital filtering and time delays.

I have minimal experience with the digital signal processing, and what I have does not include design. It would be interesting to hear from some of our digital members( )on the subject of digital phase compensation

Thanks too
Rodd Yamashita
  Reply With Quote
Old 12th November 2002, 11:01 PM   #3
diyAudio Member
 
Join Date: Aug 2002
Location: Wisconsin
Default Absolutely!

There are two unique thing about digital FIR filters compared to conventional analog filters and digital IIR filters:

1.) They can virtually 'look into the future'. In essence there is a big time delay (group delay) of the entire signal. (This could present a problem for live sound reinforcement, but for sound reproduction it doesn't matter). The output of FIFO data can be filtered based on what is happening earlier in the FIFO.

2.) The response characteristics can be pretty much arbitrary and discretely programmed. You aren't limited to predefined phase and amplitude response curves such as 'Bessel', 'Butterworth', etc...

The primary problem with FIR filters is that they are pretty much a brute force approach that requires a fairly large amount of memory, logic and/or processing power. Fortunately, with the advances in semiconductor technology, large brute force FIR filters are becoming much more practical and affordable to consider.

(I think that Altera's Stratix devices look particularly attractive for audio filter applications. These are massive FPGA's with hardware multipliers built right into their memory sections designed specifically for FIR filters. Combined with all of their other features, probably the single finest chips for audio processing currently available. My main problem with using them is that they're only available in BGA packages. (Note to self: I AM going to come up with a way to deal with BGA's at home.))

The jist of designing a FIR filter for speaker and room correction is to apply test signals to the speaker and use a calibrated microphone at the listening position to determine the impulse response of the speaker and room. The inverse impulse response is then programmed into the FIR filter. This will take care of both phase and frequency response, they don't need to be considered separately.

There is one thing that a FIR filter can't compensate for with a direct inverse: RESONANCE.

Resonances are caused by standing waves building up and reinforcing themselves. It takes a period of time for the resonance to build up when first excited by a signal, then it takes time for the resonance to die back down after the signal is removed.

A digital filter could still be useful for dealing with resonances by designing a very steep and narrow notch filter to cut out the particular excitation frequecies involved. While not perfect, it is probably still preferable to have a notch, instead of a resonance.

I suppose that it would be theoretically possible to design a filter that would dump extra energy at a particular frequency to get a resonance started up faster, followed by an 'anti-noise' signal to squash out the resonance in a way to make it match the original signal. At the present this approach still isn't practical to implement. Maybe in the future.

The bottom line: even with digital filters it will be desirable to prevent resonances in the speakers and the room from occuring in the first place.

*****

OK,
Despite all of the promise I see in massive FIR filters, I haven't tried doing this myself yet. I've got a pile of other audio projects in line before it.

But I did just get my first samples of TI's new TAS3103 DAP chip!
I'm going to use them for a digital crossover, much in line with the present discussion. While these don't have FIR capability, they do have twelve biquad IIR filters per channel, plus a FIFO for each channel that can be used to adjust group delay (in my case to perform driver time-alignment). While not as ideal as a brute force FIR, this approach should offer a big improvement in uniform phase and frequency response.

I'm hoping that it'll just take me another week or so to finish my board design for these, then I'll probably have several months of playing around with measurements and adjustments. I'm very anxious to hear how things sound with this approach!

Regards,
Brian.
  Reply With Quote
Old 13th November 2002, 04:48 AM   #4
MWP is offline MWP  Australia
diyAudio Member
 
Join Date: Oct 2002
Location: Adelaide, South Australia
Default Re: Absolutely!

Quote:
But I did just get my first samples of TI's new TAS3103 DAP chip!
I'm going to use them for a digital crossover, much in line with the present discussion.
Wooo... they are avaliable as samples now then?
Im planning also to use them for crossovers.
I was just about to make up some PCBs for the TAS3001, but if these are avaliable, i might scrap that idea and jump straight to the TAS3103.

How are you going to control these?

BTW... if you want to look into high power FIR filters, look at BruteFIR for Linux. On my low powered PC (P2-300), itll do a 3 million tap FIR filter in real time. Quite amazing.

[edit]
Just ordered my samples.
Ill be using them with 3 of my PCM1730/OPA627 DAC boards im building. Will be very interesting to listen to the results.

Argh, they are 38pin TSSOP... damn non DIY friendly packages.
  Reply With Quote
Old 14th November 2002, 01:39 AM   #5
diyAudio Member
 
Join Date: Aug 2002
Location: Wisconsin
Default The Logiculator

Quote:

How are you going to control these?
With a PIC18F252.
This micro is a bit overkill for this application, but it's not that expensive.
All I'm using it for is to control IIC parameter downloads to audiochips and for a simple volume knob and mode button user interface.
The flash is convienient to have.
Another reason I like using this is because of the ICD II debugger interface. This allows me (through the PIC's IIC port) to directly peek and poke parameters into the audio chips from a PC interface.

Probably on subsequent board designs I'll be switching to one of the new dsPIC30F series devices with an IIS port. I don't plan on actually passing my audio signal through this part, but I think it will be very usefull as a digital function generator / analyzer for helping with the system calibration of the digital filters we are talking about. Also it will be able to take over the IIC housekeeping tasks for the audio chips.

I'll also mention that I like to use one of the cheap MAX3000 series EPLDs to glue all of the audio chips together, even though they could be directly interfaced. There's several advantages to doing this:

1: I can use the EPLD as a digital selector switch for selecting different inputs or to switch various processing devices in and out of the audio stream.

2: It can easily do format conversions. I usually just stick to IIS, but its nice to be able to use others, just in case. It can also serialize / deserialize multichannel into a single TDM stream.

3: I connect all of the mode / configuration pins of the audio chips to a static output pin on the EPLD. This way, if I want to reconfigure something, I can just reprogram the EPLD, instead of having to move jumpers or resolder something.

4: By routing all of the tracks in and out of the audio chips straight into the EPLD, it makes board layout immensely easier. The vast majority of the signal routing is then inside the EPLD, and the need for signal traces to cross over one another on the PC board can almost be eliminated. This is such a blessing when doing a two layer board. The back side can be predominantly a ground plane. The main thing left to worry about is how to distribute power.

Quote:

BTW... if you want to look into high power FIR filters, look at BruteFIR for Linux. On my low powered PC (P2-300), itll do a 3 million tap FIR filter in real time. Quite amazing.
Thanks for pointing it out. I wasn't aware of this program.

A couple of comments on BruteFIR:
It operates in the freqency domain (to help efficiency), which requires convolution before and after. I'm actually hoping someday to do a massive FIR that keeps things in the time domain.

Also, BruteFIR is essentially two isolated mono channels. There's a lot more potential if multiple FIRs can be interactive.

For example, if you have a stereo system with two isolated FIRs, they will typically be set for proper response when a sound is panned full left or right. But then if a sound is going equally through both channels (as a phantom center image appearing between the two speakers), then you'll still have the typical problem of comb filtering from interaction between the two channels.

A Stereo FIR filter would have massive parallel interaction between the two channels. This way the filtering of one channel is affected by what's happening with the other channel, and the problems associated with acoustic crosstalk can be addressed.

This concept can be extended to FIRs used as digital crossovers. Frequency overlap and acoustic interaction between drivers can be much better addressed.

From a conceptual design standpoint, this stuff is actually pretty simple, just very large. (So I say now. I hope I still think that when I try it.) The problem is mostly having enough hardware to do it. I think that large programmable logic devices will prove superior to serialized DSP approaches. This is actually a case where an algorythm lends itself to massive parallism.

Quote:

Argh, they are 38pin TSSOP... damn non DIY friendly packages.
Are you etching your own boards?
I'm not familiar with what's available in Australia, but in the last couple of years (since the downturn in the tech. sector) there's a lot of places offering really great deals on prototype circuit boards in quantities of 2 or 3 (I've been happy with Advanced Circuits. They offer full featured 2 sided boards for $33 each (min 3)). A good footprint with soldermask on the board makes soldering these parts pretty easy by dragging the iron across the pins.

Later,
Brian.
  Reply With Quote
Old 14th November 2002, 04:46 PM   #6
MWP is offline MWP  Australia
diyAudio Member
 
Join Date: Oct 2002
Location: Adelaide, South Australia
Ill probably end up using a AVR (8535) for controlling it.
IIC in software will be lots of fun... i havnt looked at IIC before.
I would like to set up the AVR to use a LCD and keypad to setup the TAS3103's coeffs. But im not sure if ill be able to manage this, otherwise, ill be doing the same as you, using the uC as a path from the PC.

Using a PLD between the chips is a great idea. Would make things very configurable.
In my case though, i dont think the extra effort will be worth it.
Ill be splitting my DAC up into smaller PCBs (like, SPDIF rec, DAC, AVR, headphone amp, TAS3103, etc) to make setting it up easier. Once it is set up though, i dont think ill be changing things around too much.

NWFIIR was the first software the same guy wrote... it has a much nicer web page on how to use it for room eq.

I think BruteFIR might be more configurable than you think.
It can handle as many data streams as you like (not just 2), and i think it does come with some other filtering plugins besides simple FIR.
Quote from the web page "Here follows an example of a main configuration file, showing some of the aspects of BruteFIR's possibilities. It implements a cross talk cancellation filter for a stereo dipole...."

Im making my own double sided PCBs by using presensitised "Kinsten" brand PCBs. Just found out that i can do 10mil tracks quality easily using a bubblejet printer and special transparencies so the packaging now shouldnt be a problem.

We should keep in touch. Might be hand when we get down to working out the innards of the TAS3103.

Still got the first step of getting my DAC going though. Its my first attempt at building a DAC, so im not quite sure what to expect.
  Reply With Quote
Old 15th November 2002, 10:05 PM   #7
diyAudio Member
 
Join Date: Aug 2002
Location: Wisconsin
Default Psychoacoustic Fantasy

Quote:
Originally posted by MWP
Ill probably end up using a AVR (8535) for controlling it.
IIC in software will be lots of fun... i havnt looked at IIC before.
I would like to set up the AVR to use a LCD and keypad to setup the TAS3103's coeffs. But im not sure if ill be able to manage this, otherwise, ill be doing the same as you, using the uC as a path from the PC.
Bit-Twiddling IIC is reasonably easy. Or you might likely even find an IIC driver that someone has already written for your micro.

Manually typing in all of the coefficients could become tedious really fast. At least with the default settings in the TAS3103 it will only take a couple of settings to get the basic sound coming in one end and going out the other.

If I have room left, I'll probably put a DIP8 socket on the board so that I can have the option of putting the TAS3103 into IIC master mode and down downloading stuff from an EEPROM. This would mostly be to get me up and running faster, before having to debug my PIC code.

Quote:
NWFIIR was the first software the same guy wrote... it has a much nicer web page on how to use it for room eq.
I saw that too. I was planning to study more of the details on his particular implementation of an MLS test signal generator. This is one area that, other than conceptualizing, I haven't spent much time on yet.

I want to get all my hardware working first.

Quote:
I think BruteFIR might be more configurable than you think.
It can handle as many data streams as you like (not just 2), and i think it does come with some other filtering plugins besides simple FIR.
Quote from the web page "Here follows an example of a main configuration file, showing some of the aspects of BruteFIR's possibilities. It implements a cross talk cancellation filter for a stereo dipole...."
I didn't mean to imply that I didn't think it wasn't powerful. I agree it's quite impressive, especially for a real time PC based application.

It is possible to make serialized FIR filters have interaction between multiple data streams, but this implies that (in a stereo example), that there would be four filters: one for the right channel direct data, one for the left channel direct data, one for the left onto right cancellation data, and one for the right onto left cancellation data. The distributive property then allows one to mix the output of these four filters into two outputs. Assuming that you have sufficient processing speed, you'll get the same results as if a direct parallel stereo FIR had been implemented.

(As a side note, one of the great features that the TAS3103 offers is its '3D processing section', which among other things will allow the design of a crosstalk cancellation filter through a structure similar to above.)

There's three limitations that I see to the BruteFIR engine: The quality of the FFT convolution (at initial glance it appears that they did a good job here), processing speed limits (especially for multichannel, the number of serial FIR filters required for interchannel interaction blows up exponentially with additional channels, and the difficulty of deriving the filters required.

I'm probably way, way ahead of myself, but I was proposing an even more fundamentally brute force approach with parallel logic FIR filters working in the time domain.

By staying in the time domain, it isn't necessary to worry about the quality of the FFT.

I believe that coming up with an algorythm to measure room response and derive a time domain correction filter will be much easier than a frequency domain correction filter.

I also believe that parallel logic has a higher performance potential than DSP with the present electronic state of the art. We are just now getting to the performance level where time domain correction can be considered.

Again, I think that BruteFIR looks like a great program (especially since it's shareware). I was just trying to float out my dreams for something even higher performance and hopefully better sounding.


Quote:
Im making my own double sided PCBs by using presensitised "Kinsten" brand PCBs. Just found out that i can do 10mil tracks quality easily using a bubblejet printer and special transparencies so the packaging now shouldnt be a problem.

We should keep in touch. Might be hand when we get down to working out the innards of the TAS3103.

Still got the first step of getting my DAC going though. Its my first attempt at building a DAC, so im not quite sure what to expect.
Cool.

Good luck with your project.
I'll need it on mine. I'll admit that this is the most ambitious DIY that I've yet to take on. I'm having lots of fun with it though, and even if I don't make it all the way to an automated room correction system, I think that the intermediate steps should still give me better sound than I've had before.

Regards,
Brian.
  Reply With Quote
Old 16th November 2002, 05:16 AM   #8
diyAudio Member
 
Join Date: Feb 2002
I am actually using BruteFIR for digital xover and room correction. My take on it is that the filters you use are far more likely to be the limiting factor than the software. Although a 'direct form' approach is attractive for it's purity, the practical reality is that current technology simply can't do it at the moment, at least not affordably.

The FPGA approach is probably the only way you'll see a direct-form solution that can compete with a frequency domain implementation. As Bruce seems to indicate, this is probably still beyond the casual hobbiest.

As for filter generation - this really is the crux of the problem - worrying about the actual implementation before you have a good filter generation algorithm is probably a waste of time. A simple inversion is easy enough, but typically sounds horrible. Theres a package available called 'drc' for Digital Room Correction that is actually relatively sophisticated - applies time-varying windowing to the impulse response to reduce over-correction of mid/high freqs. Very promising (search freshmeat for drc). For driver response and phase correction, you're at the mercy of your measurements.

I have to admit, I'm a bit fuzzy to say the least on the 'stereo' filter Bruce is describing. I'm not really sure how you'd approach that in a form other than the sequential crosstalk-cancellation filter way - trying to generate a filter that (and topology) that simultaneously corrected a channel and dynamically eliminated crosstalk is beyond me at the moment.
  Reply With Quote
Old 16th November 2002, 06:16 AM   #9
MWP is offline MWP  Australia
diyAudio Member
 
Join Date: Oct 2002
Location: Adelaide, South Australia
BTW... if your in need of a OSS output plugin for BruteFIR, ive got one here i wrote for use with my AWE64s.
Not sure if the guy who wrote BruteFIR ended up making it avaliable on the BruteFIR web page.
  Reply With Quote
Old 19th November 2002, 01:30 AM   #10
diyAudio Member
 
Join Date: Aug 2002
Location: Wisconsin
Default Creating the filter

Quote:
Originally posted by dwk123
I am actually using BruteFIR for digital xover and room correction. My take on it is that the filters you use are far more likely to be the limiting factor than the software. Although a 'direct form' approach is attractive for it's purity, the practical reality is that current technology simply can't do it at the moment, at least not affordably.

The FPGA approach is probably the only way you'll see a direct-form solution that can compete with a frequency domain implementation. As Brian [ed] seems to indicate, this is probably still beyond the casual hobbiest.
Cool! Would you care to expound on your experiences with BruteFIR? Are you using DRC to generate your filters?

BTW: Who's casual?! I thought this place was for fanatics.

Quote:

As for filter generation - this really is the crux of the problem - worrying about the actual implementation before you have a good filter generation algorithm is probably a waste of time. A simple inversion is easy enough, but typically sounds horrible.

Theres a package available called 'drc' for Digital Room Correction that is actually relatively sophisticated - applies time-varying windowing to the impulse response to reduce over-correction of mid/high freqs. Very promising (search freshmeat for drc). For driver response and phase correction, you're at the mercy of your measurements.
I guess I may have gotten too far off on a tangent here about the ultra-massive parallel FIRs. It's just that it's a topic I find very exciting.

My concern at the moment is to come up with a platform that I can use for experimentation. To that end I'll be begining with the TAS3103, with its IIR filters and FIFO time delays. (Clearly the BruteFIR engine offers better performance potential.)

My second step will be to come up with a platform to generate and analyse test signals. Once I get proficient at tuning a TAS3103 based system to what I believe is its full potential, then I'll turn to a FIR based approach.

Quote:

I have to admit, I'm a bit fuzzy to say the least on the 'stereo' filter Brian is describing. I'm not really sure how you'd approach that in a form other than the sequential crosstalk-cancellation filter way - trying to generate a filter that (and topology) that simultaneously corrected a channel and dynamically eliminated crosstalk is beyond me at the moment.
This is one reason / goal of keeping things in the time domain.

I'll try to illustrate an example of one type of approach:

Let's focus on the Left Channel:
A 'stereo' FIR filter would start out the same as a mono FIR filter. Each time sample element (tap) of the Left channel FIFO would be linked to the Left channel summation stage by a certain gain. The algorythm to tune the gain coeficient of each tap for a signal that was only on the left channel is fairly straight forward.

Next, add a FIFO buffer with Right Channel data (only to be used for comb filter and crosstalk cancellation of the Left channel, the Right channel will be processed separarately). Each time sample element (tap) of this Right channel FIFO will be linked to the Left channel summation stage by a certain gain. The tuning algorythm for these crosstalk taps would be done by applying a test signal equally to both channels.

This approach allows the Left channel to be filtered based on what is happening in the Right channel. This should be a superior approach compared to the more conventional method of sequencially adding some sort of inversion of the Right channel to the left. It can address the 'over-correction' concerns you mentioned.

This approach can be extended to multichannel. Just add more crosstalk FIFOs and interchannel taps. (Maybe I should refer to this as a Mega-Massive parallel FIR.) The hardware to achieve this is now starting to come into existance (i.e. Stratix). I'm presuming it will come down in cost.

I believe that algorythms of this type could be approached much more mechanically, and yet yield better sonic results. Time, testing, and listening will tell.

Regards,
Brian.
  Reply With Quote

Reply


Hide 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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Phase correction??? jdlech Multi-Way 11 2nd January 2008 01:25 AM
Digital predistortion for speaker correction rtarbell Digital Source 14 21st October 2005 10:34 AM
phase correction on speaker design blu_line Multi-Way 1 11th September 2002 01:05 PM
phase correction in crossovers caseyk Multi-Way 3 9th July 2001 09:58 PM


New To Site? Need Help?

All times are GMT. The time now is 06:46 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2