Page:12345

# TOPIC: Re: Digital crossover for my WMTMW speakers

## Re: Digital crossover for my WMTMW speakers 9 years 2 days ago #4479

 Jakster Offline Junior Boarder Posts: 24 Thank you received: 4 Karma: 3 Just to see if I understand this right: filtering with FIR is a convolution of the input signal with a filter kernel that is a vector of coefficients.Correct, for each output Y[n] filtervector G[1]....G[filterlength] is multiplied with signalvector X[n]....X[n-filterlength], vectorsum equals Y[n]. If this vector is symmetric about the center, the kernel itself will not affect the phase characteristics (other than delay).Correct So, in order to make a linear phase acoustic response, the kernel should not be symmetric - it should produce a phase response that is opposite to the speaker phase itself.Correct (opposite speaker phase + pure delay), and to me and important design parameter, I see a lot of diy loudspeaker projects (passive, active and digital) discarding speaker units level and phase correction by placing a std. LR crossover somewhere in the overlap of the two units. Probably because most of the available litterature deals with theoretical crossovers with perfect speakerunits. By importing the response data and target data, maybe a kernel can be calculated iteratively by fitting the convoluted response to the target response?Yes, though I think you can do it iteratively and "non-iteratively" The administrator has disabled public write access.

## Re: Digital crossover for my WMTMW speakers 9 years 2 days ago #4483

 Crumboo Offline Expert Boarder Posts: 144 Thank you received: 14 Karma: 13 Yes, it should be non-iteratively (much simpler). I am looking on one algorithm right now, looks very easy actually (not sure that it works yet though): Define the sampling frequency and filter length Define what filter response you want (ideal filter) and input this as a vector Do IFFT of this to get the corresponding impulse response Window this (for example with a Hanning window)- and there is the coefficient vector you are looking for! Does it look reasonable? The administrator has disabled public write access.

## Re: Digital crossover for my WMTMW speakers 9 years 1 day ago #4487

 curryman Offline Platinum Boarder Posts: 792 Thank you received: 181 Karma: 101 The general procedure looks resonable. Filter development (inverse speaker response + crossover) can be done in frequency domain (complex of course) and then transferred to time domain (IFFT -> impulse response). However the exact implementation can be very tricky Are you working with matlab now? Do you have access to any toolboxes (signal processing toolbox helps a lot). The administrator has disabled public write access.

## Re: Digital crossover for my WMTMW speakers 9 years 1 day ago #4497

 Jakster Offline Junior Boarder Posts: 24 Thank you received: 4 Karma: 3 Agree with Curryman, and be prepared to try numeorous ways in search of "the perfect correction filter". See Horbach and Keele part 1 for their method: corr. filter = ifft( Hcrossover/fft(driverresponse)) You probably need to try different approaches in both time an frequency (convolution in time = multiplication in frequency and deconvolution = division) and always check time and frequency response of your correction filter before applying it to your speaker. I would probably start like this (simplified): -Measure speaker unit impulse responses (you have that). -Create target curve using in frequency domain (only magnitude) -Transform target curve to linear phase impulse response (using Parks-McClellan for matlab www.mathworks.se/help/toolbox/signal/ref/firpm.html or remez function in Scilab) - Create correction filter by using wiener filter og LMS in time domain (en.wikipedia.org/wiki/Similarities_between_Wiener_and_LMS) I really hope you continue down this path and share your progress in this thread - maybe even share some of the Scilab code. Only because I remember using the wiener filter and because I think I had problems while doing this in the frequency domain (I´m not exactly sure, but I think the IFFT(correctionfilter) I did once resulted in complex numbers in time domain. Please note that I haven´t been doing any signal processing for a long time, so this is all based on "what I think I remember" - I hope that Curryman and other will correct me if I´m wrong. I think windowing (hanning, hamming, kaiser) should be applied to you desired response, not your filter - Im not sure though. The administrator has disabled public write access. The following user(s) said Thank You: Crumboo

## Re: Digital crossover for my WMTMW speakers 9 years 1 day ago #4498

 Crumboo Offline Expert Boarder Posts: 144 Thank you received: 14 Karma: 13 Yes, I'll try different approaches if needed. Shouldn't I be able to use measured frequency (and phase) response for the driver? This could be transformed to impulse response using IFFT? The measurement software I use can automatically convert the response to minimum phase. One thing I'm really not sure about is how I should define the phase of the target function. I guess the target cannot be zero phase since the output will be delayed (constant)? I'll probably try to define the phase as zero at first and check if the result seems right... I figure the windowing should be applied to the "ideal" filter response (that is IFFT(target) / IFFT(measured data)) in order to obtain a filter impulse response of reasonable length (number of taps)? Currently I'm working in a program called IDL, which has many similarities with Matlab. I'll probably switch to Scilab though. By the way, you asked in a previous post about what soundcard I'll use. I'm not sure yet, but believe M-AUDIO 1010LT can be a good candidate. One more thing: check out this link. It's a Java applet found on wikipedia for looking at different filters. It's interesting to use the "Custom filter" where you can "draw" the target response you like (and choose filter length) and see the filter impulse response and frequency response changing in real time. Last Edit: 9 years 1 day ago by Crumboo. The administrator has disabled public write access.

## Re: Digital crossover for my WMTMW speakers 9 years 1 day ago #4500

 Crumboo Offline Expert Boarder Posts: 144 Thank you received: 14 Karma: 13 Having some thoughts on the equipment I need. I think I'll build a box containing all parts (computer etc.). I found this remotely operated multichannel volume control (I have heard that it is a good idea to have volume control after the DAC). What do you think? Also, as I want to keep the signal in the digital domain as long as possible I need some kind of input selector (which don't need do be remotely operated). Any tips on this? It should accept at least two sources of digital signals (spdif coax and toslink). Thought about using a miniDIGI, but I'm not sure about the input selector - is it only set by jumpers on the board or can it be controled from "outside"? The administrator has disabled public write access.

## Re: Digital crossover for my WMTMW speakers 8 years 11 months ago #4510

 Crumboo Offline Expert Boarder Posts: 144 Thank you received: 14 Karma: 13 Hi again, Have been struggling to create the filters in need and I think I'm on the right track. In order to prepare the "ideal" response i wish for my filter (HP part as example) I found SpeakerWorkshop (SW) to be useful. In that program it's easy to export data in equally spaced frequency (not log). The way I prepared the data in SW was this: I imported measured data for a tweeter (frequency and phase) and for the high-pass target curve (which I calculated in Excel). Then I divided the target curve with the measured curve to get how the "ideal" filter would look. In the resulting plot, I changed the frequency scale to be 2000 (arbitrarily chosen) points, covering the range 0 Hz to 22050 Hz, equally spaced elements (not log spaced) and exported it as a text file. I imported the text file in the programming language IDL (which is quite similar to Matlab and Scilab, and I choose it because I've used it before and is somewhat used to it AND for I found some useful examples that I followed). The "ideal" frequency response of the filter looked like this: I'm really not sure about all the steps below - I just followed an example: I defined the frequency spacing (the reciprocal of the sampling frequency) and chose the filter length to be 1024 (i.e. the number of filter coefficients in the resulting filter - I could have chosen whatever I wanted here, but 1024 seemed enough in this case). The next step was to rescale the "ideal" response to be a vector of the length (filter length/2+1) and mirror the vector (not really sure about this, but it gives the right result it seems). Then IFFT of the vector and scale the amplitude with the filter length. Then I shifted the result so that the high amplitude part of the vector moved to the center of the vector (and not in the edges). Thereafter I applied a Hanning window. Here's the result (the vector of filtercoefficients): By doing FFT of this I got this result: The result look right. Also I tried to validate this by importing a filter found here (which was used in bruteFIR) and by doing FFT of this the response came out right. This should verify that the filter actually produces the right magnitude response in bruteFIR. So that was that. There is one problem however which I haven't been able to solve. The above calculation used only the magnitude data and not phase. The IFFT algorithm converts the input data to complex numbers (if it wasn't complex in the first place) - and I guess it sets the imaginary part to zero. I've tried to use the imported phase data to produce the complex response data to insert in the IFFT, but then the result comes out wrong. I haven't figured this out and it's a bit annoying since I wanted the filter to correct the phase turning in the speaker itself (apart from the magnitude); that is, I wanted to have a filter response that was NOT linear phase. Also, the filter phase that comes out looks a bit weird (not only with my data, but also with the data I used for verify the calculations). Any comments on this? I'll try to implement the same thing in Scilab and I'm happy to share the code if I get it working alright. By the way, feel free to comment on my previous two posts! Last Edit: 8 years 11 months ago by Crumboo. The administrator has disabled public write access.

## Re: Digital crossover for my WMTMW speakers 8 years 11 months ago #4515

 Jakster Offline Junior Boarder Posts: 24 Thank you received: 4 Karma: 3 damn, you work fast... I´m flooded workwise, so I can only give a few short comments. 1) I read the papers describing your crossover. I like it!! but I need to read it a few times, not entirely caught up on the mathematics of it. 2) soundcard seems fine, Anders Torger has preference for RME hammerfall, buts it´s pricey 3) I´m pretty sure minidigi could be used (with or without sample rate conversion), but devteam or Curryman should confirm this 4) what sample rate are you planning on using on bruteFIR? 5) What program do you use to measure your loudspeakers? 6) regarding your last post - Impressive progress on a short period of time. As far as I can tell, you´re definitely on the right track. Here´s few thoughts: I would do the speaker response / targetcurve in IDL. And you need to know the phase response of your ideal filter (maybe look at a std linear phase fir filter in frequency domain and steal that phase reponse, but maybe that´s what you tried?) A few steps: Target response phase & mag --> target response complex numbers speaker response phase & mag --> speaker response complex numbers Inverse Filter = Ifft(speaker_complex/target_complex) I wish I had more time to look into this!! /Hans The administrator has disabled public write access. The following user(s) said Thank You: Crumboo

## Re: Digital crossover for my WMTMW speakers 8 years 11 months ago #4518

 curryman Offline Platinum Boarder Posts: 792 Thank you received: 181 Karma: 101 very interesting work. Unfortunately I am also full of work and not able to follow and comment everything ;( Just want to add one remark: miniDIGI can work as input selector and has one! stereo digital SPDIF output. But I am not sure if it can work standalone, since the output samplerate of the SRC is set by the microcontroller on board of miniDSP (depending on used plugin). So a miniDSP may be necessary. The administrator has disabled public write access.

## Re: Digital crossover for my WMTMW speakers 8 years 11 months ago #4520

 KAMIKAZE Crumboo wrote: Having some thoughts on the equipment I need. I think I'll build a box containing all parts (computer etc.). I found this remotely operated multichannel volume control (I have heard that it is a good idea to have volume control after the DAC). What do you think?After filter it's very good, however if miniDSP will have hi-end boards with good quality components - it's will be a reasonable to use vol. control after filter or after DAC's. But for now it's not necessary to use vol. control for miniDSP, because of it low quality and as result low price. What better? I have 8-channel vol. control (forum.cxem.net/index.php?showtopic=80013...w=findpost&p=1045705) and its wait for a time a hi-end boards and FIR filters ) and of course DAC's so for 4-way system it will be 4 DAC's, 8 amplifiers in A class for mid-tweet, and AB for wof-sub. Try to find out cost of this project Also this is best it can be - altor.sytes.net/Articles/Vol_Control_2/V...sh/vol2_english.html www.vegalab.ru/forum/showthread.php/4202...мкости-Никитина-с-ДУ Last Edit: 8 years 11 months ago by KAMIKAZE. The administrator has disabled public write access.

## Re: Digital crossover for my WMTMW speakers 8 years 11 months ago #4522

 curryman Offline Platinum Boarder Posts: 792 Thank you received: 181 Karma: 101 I am wondering about your target response in the lower left figure. You mentioned zero phase, however linear phase system does not have zero phase, but linear rising or falling phase. This corresponds to a constant group delay. So for a linear phase system the part with the longest group delay (should be the woofer, b.t.w. closed or vented box?) will define the complete group delay of the complete system. Thus it makes sense to start with the woofer, define the group delay of the overall system (e.g. 50ms, quite typical for vented boxes) and then use this group delay to define the group delay (phase) for the other speakers. Does this make sense? Just a thought Best regards The administrator has disabled public write access.

## Re: Digital crossover for my WMTMW speakers 8 years 11 months ago #4523

 Crumboo Offline Expert Boarder Posts: 144 Thank you received: 14 Karma: 13 Curryman...I have to give this some thought. The most important thing is that the individual speakers are perfectly in phase with each other throughout the crossover region. I guess this is easiest to achieve of the phase is constant for all speakers (zero group delay), but also if the group delay is constant (linear phase). Then, it would be a bonus if there is a perfect transient response. What is the difference between zero phase and linear phase with regard to the transient response? By the way, found something useful about creating filters with arbitrary response here! And yes, it's a vented box. The administrator has disabled public write access.

## Re: Digital crossover for my WMTMW speakers 8 years 11 months ago #4525

 curryman Offline Platinum Boarder Posts: 792 Thank you received: 181 Karma: 101 What you ideally want for a speaker system is a constant group delay for all frequencies. This (theoretically ) results in a perfect step response. The difference between zero phase and linear phase is just a shifted impulse response. While the zero phase response has an impuls response symmetrical arround time zero (an thus needs negative indexes to be described), the corresponding linear phase impulse reponse is equal in shape but shifted to positive time values (-> this is the group delay ). The source you mentioned does explain most of it quite detailed. Good link! The administrator has disabled public write access.
 Page:12345
Moderators: devteam