digital crossover frequency

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
hi,

I am working on a digital crossover for multichannel pc audio
cards like creative or philips in combination with multichannel power amplifiers.

The tricky part is how to design suitable filter coeff's for low and high pass-band FIR filters.

What I have tried is to do a straight forward approach with matlab (remez) to get a set of coeff's.

The result was blobs and ringing during audio playback in the low-pass filter.

my question is, do constraints exists like even or odd filter order, slope,...

can you help me..

regards, millim
 
The fundamental problem is that you are trying to design a FIR filter. So the concept of "order", "slope", etc. do not apply in the same way as they do for analog filters, or for IIR filters which mimic analog filters.

An FIR filter to implement a 80 Hz filter at 48 kHz sampling rate (pretty standard for PC audio and DVD) would have to have about 6000 coefficients. Implement one high and one low pass per channel, multiplied by 6 channels, multiplied by 48000 samples per second, multiplied by say 8 CPU instructions per coefficient calculation, and you can see that you'll need a 30 to 40 GHz processor to do this in real time. So you may be able to do this around the year 2015. If you are thinking more near-term, then consider IIR filters :)
 
macboy said:
So you may be able to do this around the year 2015. If you are thinking more near-term, then consider IIR filters :)

No -it is perfectly possible today. Take a look at the brutefir program;

http://www.ludd.luth.se/~torger/brutefir.html


With a massive convolution configuration file setting up BruteFIR to run 26 filters, each 131072 taps long, each connected to its own input and output (that is 26 inputs and outputs), meaning a total of 3407872 filter taps, a 1 GHz AMD Athlon with 266 MHz DDR RAM gets about 90% processor load, and can successfully run it in real time.

The FIR filter coefficents produced by remez is a phase linear filter and that gives rise to rining. you should look at minimum phase filters. One way of obtaining this is taking the impulse response of the corresponing analog filter. use windowing to the desired number of taps and ther you have your FIR filter coefficients

Based on IIR filers take a look at AsioXO;

http://www2.gol.com/users/pcazeles/asioxo.htm

And for formulars on IIR coefficients look at;

http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt

Nothing wrong with IIR filters you can always use DRC to correct the phase distortion they produces like conventional analog filters.

http://freshmeat.net/projects/drc/?topic_id=114

Be warned though DRC has a quite steep learning curve.


Morten
 
IIR filters (Bi-Quadratic) are minimum phase. So what is the advantage of using a FIR filter designed for minimum phase? Their impulse and therefore phase responses will be the same. Minimum phase is minimum phase is minimum phase.

BruteFIR doesn't do true FIR's. It essentially performs a long FFT and scales the result according the the filter coefficients, and then converts back to the time domain. This has a similar effect as an FIR filter, but it is not an FIR filter in the conventional sense.

I personally prefer not to subject my music to FFT's. Have you ever simply taken a piece of music and run it through a FFT and back again, and compared this to the original? You might think that it wouldn't be altered, but the effect is dramatic. A short FFT gives poor resolution in the bass. A long FFT becomes ringy, with a distinct pre-response. The effect is an overall smearing of the music in time. FIR filters can have the same effect, since they can theoretically respond to n/2 future samples (n is the number of coefficients). IIR filters can only respond to the current sample and past samples. FIR? FFT? No thanks.
 
macboy said:
IIR filters (Bi-Quadratic) are minimum phase. So what is the advantage of using a FIR filter designed for minimum phase? Their impulse and therefore phase responses will be the same. Minimum phase is minimum phase is minimum phase.

Your are right. I could have been a bit more clear on this point. Pure phaselinear filters will have a lot of ringing on their Impulse respones. Probably the optimum is in the middel between phase linear and minimum phase.


BruteFIR doesn't do true FIR's. It essentially performs a long FFT and scales the result according the the filter coefficients, and then converts back to the time domain. This has a similar effect as an FIR filter, but it is not an FIR filter in the conventional sense.[/B]


Agreed in part, but there is a more than just FFT and IFFT to it. It utillise an overlap save and partioned convolution scheme. I would say that it is one implementation of a FIR filter, but it is not a direct-form implementation of a FIR filter


I personally prefer not to subject my music to FFT's. Have you ever simply taken a piece of music and run it through a FFT and back again, and compared this to the original? You might think that it wouldn't be altered, but the effect is dramatic. A short FFT gives poor resolution in the bass. A long FFT becomes ringy, with a distinct pre-response. The effect is an overall smearing of the music in time. FIR filters can have the same effect, since they can theoretically respond to n/2 future samples (n is the number of coefficients). IIR filters can only respond to the current sample and past samples. FIR? FFT? No thanks. [/B]


I do not agree. If the overlap add and save scheme is use - no ringing is present ( unless when the FIR coefficents is so that Ringing should be present).

Can i challenge you to try Foobar 2000 with the convolution module ? Use the Kroenecker delta impulse as the FIR coefficents. I would be most interesting to know if you can hear any difference using the convolver or not. This convoler is based on the same but slightly simple scheme as Brutefir. ( i does not use partioned convolution)

Morten
 
macboy said:

BruteFIR doesn't do true FIR's. It essentially performs a long FFT and scales the result according the the filter coefficients, and then converts back to the time domain. This has a similar effect as an FIR filter, but it is not an FIR filter in the conventional sense.

I see this type of statement on this board from time to time, and I'm sorry, but you are simply wrong.
The topology of a filter is DEFINED by it's impulse response. Period. How it is implemented is completely irrelevent to the question.
The FFT-based approach is a very very common way to implement FIR filters, as it is computationally efficient. *PROPERLY IMPLEMENTED* there is no problem and no difference compared to a 'normal form' FIR


I personally prefer not to subject my music to FFT's. Have you ever simply taken a piece of music and run it through a FFT and back again, and compared this to the original? You might think that it wouldn't be altered, but the effect is dramatic. A short FFT gives poor resolution in the bass. A long FFT becomes ringy, with a distinct pre-response. The effect is an overall smearing of the music in time. FIR filters can have the same effect, since they can theoretically respond to n/2 future samples (n is the number of coefficients). IIR filters can only respond to the current sample and past samples. FIR? FFT? No thanks.

Well, it's almost a certainty that every single piece of music that you listen to on CD has been through a bunch of FFT's, so you're pretty much stuck.
The problems you're seeing with FFT's and FIR's must be due to the software you're using. Any FFT/IFFT filter that unexpectedly alters the signal is simply poorly implemented, or else is showing the effects of poor windowing choices. I don't doubt for a second that there are a lot of sub-optimal implementations out there.

I'm not trying to suggest that FFT's or FIR filters are automatically perfect, only that your arguments are based on an incomplete understanding of the underlying processing. There is nothing to be inherently afraid of in these approaches, although you certainly can screw up the signal if you do things incorrectly.
 
FIR digital crossover frequency, yes

Some experiences from another soundcard player:

I use labview based FIR filers with adjustable cross-over frequency and adjustable tweeter delay, a 5.1 audio card and a 4 channel power amplifier to realize stereo digital two-way cross-over.

The nice thing about software filters is that you can actually visualize the highpass and lowpass response before turning on the poweramp and possibly destroying a tweeter in case of (DC) errors.
Visualizing the highpass, lowpass and the sum of these response makes it clear that FIR filters can actually be quite near to perfect.

Early mistakes I made:
I used much too less FIR filter taps:
use about 333000/f(cross-over), so 333 for 1kHz, and 3333(!!) for 100 Hz cross-over.
Too few taps will result in bad filtering (especially lowfrequency signals will occur in the highpass response).
Ringing occurs if you filter block wise without overlap and deleting distorted parts:
always use overlapping blocks of data and cut off the beginning and end of about the size of the number of taps used for FIRring.

Done right, FIR rules.

(however, I will have a look at IIR filtering too, because its so easily implemented)
 
Its all possible now...

I've been running an embedded DSP crossover on my sound system for a few months now. I wrote the firmware for a DSP-based system which implements a 3-way stereo crossover. Crossover points are 1200, and 100Hz. Using linear phase filters of >1000 taps for HF, and the equivalent of 12000 taps for LF.

I run them with a pair of 250mm subs, some Vifa paper cone 165mm mid-woofers, and some home made 200mmx 20mm true ribbons.

The filter is linear phase, but due to the long filter tap length, and high-resolution floating point filter implementation there is no trace of ringing.

If you do the calcs for 48k this adds up to a lot of taps. The trick is to devise an efficient filter structure, using multiple sample rates and polyphase filtering. Downside to this approach is that you cant correct for speaker deficiencies. It only caters for 0-ripple, flat passbands.

I'm thinking of commercialising it for the audiophile market. Low profit, low volume, just to cover my development costs. I've spent a long time getting this thing going...

The format I'm looking at is a remote controlled preamp, with some stereo inputs (3 line level + 3 SPDIF), 6 line level outputs (Low, Mid, High) and a USB interface for firmware/filter set upgrades via PC application. Internal sampling rate will be either 96k or 192k, with a sample rate converter for the SPDIF ins. SNR + distortion should be >105dB.

It will be a step up from what I'm running at the moment- my existing prototype is only 48kHz, and around 85dB end-to-end.

Target price will be around $US800.

Group delay is 80 to 150ms depending on filter settings, which makes it sort-of tolerable to watch DVDs and TV in stereo, but is unsuitable for use in a surround system combined with conventional speakers, unless your surround processor can add delays in the order of 150ms to each of the non-FIR channels.

If it proves popular I might also do an integrated 6ch version, with video delay compensation.

Anyone interested? I need to know whether or not it will be worthwhile- you guys would be my main market! Email me before March '04:

Final product format will be sorted by then, so any suggestions on desirable features are welcomed.

lockwood@tieline.com

Cheers,

Chris

PS: About myself- I design high-speed DSP-based products for the broadcast industry, and automotive test and measurement. My specialty is hardware design, and embedded software. I work freelance, as a sole trader, with several local clients providing plenty of work...
 
I'm using AD at the moment for the crossover, and TI on another project. The TI is a much easier platform for development IMHO. The tools are much less buggy- and the silicon actually has a useful cache. For (very) small code size though, the AD is adequate. AD have just bought out some new floating pt DSPs designed for audio apps. These look very good on paper, but my experiences with AD make me hesitant- especially regarding the stability of their silicon.

I've thought about adding a surround decoder, but it does increase the complexity significantly, and issues with licensing- especially since I'm looking at low volumes for now...

The only downsides to the filter structure I developed is that the delay is much larger than a direct implementation, and you cant tailor the response of each passband to compensate for driver and room deficiencies. The delay makes the unit less suitable for AV applications. I might however put in a low delay algorithm option which sacrifices sonic performance for adequate lip syncing :)

Best thing is that it should be within the budget of the "consumer".

Chris
 
Good to see a user of TI DSP. I guess you were using C6711 or C6713. Am I right? I guess you are also using ADI 21161 hammerhead DSP... Hopefully not TigerSHARC as it's too expensive...??

I have some experience with TI C6713 and Mot 56367, but I prefer TI ones to Mot ones... yeah great development tools...

The reason I wanted to mod A/V pre/pro was, as you may already know, because I didn't want any digital source signal going through unnecessary AD/DA steps. It seems that the only way to preserve full-digital path from DVD players down before DAC/amp/speaker for multichannel audio system is modifying the processor. It will also save some money by using existing pre/pro's hardware... I am now looking at Onkyo RDC-7.1 as they have 2 DA610's inside, and has XLR outputs and 1394 inputs. First step would be using 300 ~ 380Hz crossover in place of bass management S/W. Using FIR for crossover would probably require addition of a DSP. I tried some simulation and I yielded that 1 ~ 2K tap would suffice for 300 ~ 400Hz crossover LPF/HPF even in 192kHz fs. This seems to be okay with direct implementation, but I don't remember the slope.

Regarding the slope, I think too stiff crossover may result in 2 side effects:

1. temporal degradation by long FIR(surely also high MIPS cost)
2. timbral mismatch in crossover range as little sounds from both drivers would mix.

I am not sure about optimal slope for this application, but 60db/oct may be pretty good enough, but not as stiff as "brickwall" filters...

Your opinions?
 
good guesses with the DSPs. The 6713 is a lot more powerful.

Digital outputs from surround processor is an easy way of making the shortcut.

"temporal degradation by long FIR" ? What do you mean? Do you mean the information loss due to truncation of floating point values during the MAC? One way around this is to use optimised integer coefficients, but the filter length then becomes longer, resulting in more delay, and more processing power requirement for the same passband ripple, cutoff freq, and transition bandwidth.

"timbral mismatch in crossover range" implies a frequency shift in the signal for either passband. I cant see how this is possible. Given the aggressive slope, there will be only a very narrow band of frequencies where both HF and LF will be sounding simultaneously with an amplitude level of within 30dB. Even then, the effect is similar to a decent IIR phase-matched crossover.

Advice for the day- when having a party, make sure you cover up your ribbon tweeters- inquisitive fingers usually dont stop after destroying the first in a pair...
 
Chris,

I am not sure if I used the right terms, but let me try to explain:

Temporal degradation I meant was something like adverse effect by ringing of impulse response in long brickwall FIR. The ideal of LPF or HPF would be ones with infinite slope cutoff characteristics and impulse response as short as possible, not to cause too much temporal dispersion(?).
What I meant on "timbral mismatch" was caused by concern with extremely stiff crossover used in digital crossover filter. Since stiffest cutoff would isolate 2 drivers almost completely, 2 drivers with different transient/non-linear characteristics may exhibit some audible mismatch in crossover range, I think.

So, I thought somewhat gentler slope than 120+dB/oct slope might be better.
 
OK- I see what you mean. "Temporal Dispersion" anomilies could only be a problem if time-based information is lost(discarded) in the filtering process. Incompletely overlapped FFT-truncate-IFFT methods could suffer from this if the FFT is not done for every input sample. Many (most) implementations work on the assumption that processing blocks of data representing a time slice is OK, even if that time slice is greater than the sample period. When the time slice data is overlapped (but not completely), it still sounds OK. Our ears dont seem to mind, and best of all it doesn't take a great deal of processing power to implement. Seems to work well with sine waves... Not sure about music yet :)

By definition, if you want the response to be low-pass with a very steep transition, the impulse response will have a long decay which looks like ringing. The ringing HAS to be there or it wont be a low-pass filter!

If you take a "nice-looking" impulse response with rapid decay of ringing, the transition slope will be VERY shallow. The impulse response (including the length of ringing) and the filter shape are directly linked.

Thats why 1st order IIRs look so nice. Thats why the impulse response of a driver always shows ringing- its got a natural LP filter due to the mass of the voice-coil and diaphragm. Theres nothing wrong with that. Ringing on the impulse response does not imply transients will be destroyed, just bandlimited.

For any sceptics out there, take your best sounding dac, and create a synthetic impulse- not too hard with some logic gates on the serial input- just fire a 1 on the data line for 1 sclk period corresponding to the second most significant bit of the audio frame (assuming its signed data). This will give an impulse at -3db.

Through all the noise on the output of the DAC, you will see an impulse response that looks like a bell ringing! Thats the reconstruction filters doing their job. Filtering. Limiting the passband to below 1/2 the sample rate, and usually with a very aggressive slope. And it doesn't sound at all bad.

As far as timbral mismatch goes, it could be a bit of a problem for a non-symmetrical driver layout. I use MTM arrangement. Since ribbon drivers are VERY directional vertically, there is a narrow sweetspot pretty much inline with the centre of the ribbon, the MTM arrangement is well suited. The best thing about such directionality is there is very little interference from room floor-ceiling reflections in the HF/upper midrange. Reproduction is therefore less sensitive to the listening room, and sounds more like the original recording environment. Some people dont like it. They prefer Bose systems :)
 
Chris,

Thank you for sharing your knowledge here. I am still a little bit nervous about overlapped FFT method or MFFT?(like MDCT?), and long impulse response of stiff LP FIR. I hope you can get a good result with actual music where transients may make audible difference. Good luck! :)
 
There is nothing wrong with the long decay of the impulse response. The ringing defines the filter slope. You are listening to this every time you play a CD.

Since "brick-wall" filter rolloffs are used in EVERY ADC and EVERY DAC used in EVERY digital recording system, EVERY piece of music on EVERY CD will have been filtered with at least one of these filters. They have very long impulse responses. Put an impulse in the source, and it will come out with a large amount of ringing. Fact of life.

All recording systems are bandlimited. Fact of life. By using brick-wall filters, we use most efficiently our PCM recording bandwidth.

If you pass an impulse through two of these filters in series, you will see very little difference between the outputs of the first and second filters. The impulse after the first filter will be bandlimited (hence the ringing), so the resulting signal is mostly in the passband of the second filter. The result is very little alteration by the second filter, except in the transition and stop regions. Since these are very narrow, the impulse response will look relatively unchanged.

This means sticking 20 of them in a row will also make very little difference (maybe worse SNR due to implementation). After say 2 or three, any further differences will be buried in the noise floor.

Putting a shallow IIR filter at the end of the line in the crossover will NOT reduce the end to end impulse response ripple in any way. Anyone who says otherwise is welcome to prove their point scientifically.

The important thing to understand is that the impulse response ripple DOES NOT imply long decay time on transients. Time domain responses are difficult to interpret. Unfortunately, our instinct is to see the long decay time as a bad thing, and is often labelled "time smearing", or "smudging" or other such terms.

They teach you a bit about such things after a year or two of university-level maths. Then it starts to make sense :)

There is a big difference between long decay times of drivers due to cone resonances and other forms of mechanical energy storage, and the ringing seen in the impulse response of a brick-wall filter. They are two entirely different phenomena.

An ideal low-pass filter (brick-wall) will have an infinitely long decay on its impulse response. The function is Asin(kt)/kt.

If we accept that our ears wont respond to anything above 20kHz, then there is nothing wrong with this. Going higher will open up some serious technical challenges, especially in adoption of new technology in the recording studios (including mics).

Sorry if this upsets anyone!

Chris

PS- as for the FFT-truncate-IFFT method, I dont use it. I use a direct implementation of the FIR.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.