Hi! I am a newbie on DSP working on a project which involves using a few different kinds of loudspekers so I have to be able to equlize them. The plan is to do that using a FIR filter. All implementation is done in MATLAB. I have not been able to find any good matlab examples on this matter. I have got this far: 1. Got a nice 128 samples impulse response. 2. I use the rceps function to get the minimum phase part. 3. use fft(response, 256) 4. invert fft response 5. convert to dB scale, 20*log10(abs(FFT_inv_response)) 6. Remove mean 7. Apply a window between 400-12000 Hz 8. Convert back 10.^(FFT_response_win.*0.05) 9. The magnitude response looks good now. Using ifft to get the filter but when I try the filter I don't get the result I expected at all. I'm not sure that this process is the correct and I would be very thankful if someone would take a look at it. I'm happy to send some code if that would help. Thanks, Johan Gustafsson

# Loudspeaker Equalization using FIR (newbie)

Started by ●October 5, 2006

Reply by ●October 6, 20062006-10-06

jogu wrote:> Hi! > > I am a newbie on DSP working on a project which involves using a few > different kinds of loudspekers so I have to be able to equlize them. The > plan is to do that using a FIR filter. All implementation is done in > MATLAB. I have not been able to find any good matlab examples on this > matter. > > I have got this far: > 1. Got a nice 128 samples impulse response. > 2. I use the rceps function to get the minimum phase part. > 3. use fft(response, 256) > 4. invert fft response > 5. convert to dB scale, 20*log10(abs(FFT_inv_response)) > 6. Remove mean > 7. Apply a window between 400-12000 Hz > 8. Convert back 10.^(FFT_response_win.*0.05) > 9. The magnitude response looks good now. Using ifft to get the filter but > when I try the filter I don't get the result I expected at all. > > I'm not sure that this process is the correct and I would be very thankful > if someone would take a look at it. I'm happy to send some code if that > would help.The phase response of loudspeakers used together is important. Symmetric FIRs can't help you with that. Jerry -- "The rights of the best of men are secured only as the rights of the vilest and most abhorrent are protected." - Chief Justice Charles Evans Hughes, 1927 ���������������������������������������������������������������������

Reply by ●October 6, 20062006-10-06

Hi, Thanks for the answer. What I am doing right now, though, is just to try to correct the direct response from the speakers separately. I don't have to think about their phase response. I am just trying to get white noise to sound the same from three different loudspeaker models. I believe that I might have my problem when I try to construct the filters from the desired magnitude response. I read somewhere about using the hilbert transform to reconstruct the phase. Does that make any sense to you, I am not quite sure about how to do that. Cheers, Johan>jogu wrote: >> Hi! >> >> I am a newbie on DSP working on a project which involves using a few >> different kinds of loudspekers so I have to be able to equlize them.The>> plan is to do that using a FIR filter. All implementation is done in >> MATLAB. I have not been able to find any good matlab examples on this >> matter. >> >> I have got this far: >> 1. Got a nice 128 samples impulse response. >> 2. I use the rceps function to get the minimum phase part. >> 3. use fft(response, 256) >> 4. invert fft response >> 5. convert to dB scale, 20*log10(abs(FFT_inv_response)) >> 6. Remove mean >> 7. Apply a window between 400-12000 Hz >> 8. Convert back 10.^(FFT_response_win.*0.05) >> 9. The magnitude response looks good now. Using ifft to get the filterbut>> when I try the filter I don't get the result I expected at all. >> >> I'm not sure that this process is the correct and I would be verythankful>> if someone would take a look at it. I'm happy to send some code ifthat>> would help. > >The phase response of loudspeakers used together is important. Symmetric>FIRs can't help you with that. > >Jerry >-- > "The rights of the best of men are secured only as the > rights of the vilest and most abhorrent are protected." > - Chief Justice Charles Evans Hughes, 1927 >��������������������������������������������������������������������� >

Reply by ●October 6, 20062006-10-06

jogu wrote:> Hi, > > Thanks for the answer. What I am doing right now, though, is just to try > to correct the direct response from the speakers separately. I don't have > to think about their phase response. I am just trying to get white noise > to sound the same from three different loudspeaker models. I believe that > I might have my problem when I try to construct the filters from the > desired magnitude response. I read somewhere about using the hilbert > transform to reconstruct the phase. Does that make any sense to you, I am > not quite sure about how to do that.... There are a number of techniques for achieving an arbitrary frequency response. In general, IIRs require less computation, but FIRs and are perhaps easier to design. (At least easier for me by far.) Chapter 17 of the book at http://www.dspguide.com/ will give you a start on how. You'll need to read other chapters to make sense of it. A Hilbert transformer is a bandpass filter that causes a 90 degree phase shift. It is not of use for what you want to do. Jerry -- "The rights of the best of men are secured only as the rights of the vilest and most abhorrent are protected." - Chief Justice Charles Evans Hughes, 1927 ���������������������������������������������������������������������

Reply by ●October 7, 20062006-10-07

Jerry Avins <jya@ieee.org> writes:> [...] > A Hilbert transformer is a bandpass filter that causes a 90 degree > phase shift. It is not of use for what you want to do.In the ideal case, the Hilbert transformer is an allpass filter. I believe in practical implementations it is high-pass. -- % Randy Yates % "Bird, on the wing, %% Fuquay-Varina, NC % goes floating by %%% 919-577-9882 % but there's a teardrop in his eye..." %%%% <yates@ieee.org> % 'One Summer Dream', *Face The Music*, ELO http://home.earthlink.net/~yatescr

Reply by ●October 7, 20062006-10-07

Randy Yates wrote:> Jerry Avins <jya@ieee.org> writes: >> [...] >> A Hilbert transformer is a bandpass filter that causes a 90 degree >> phase shift. It is not of use for what you want to do. > > In the ideal case, the Hilbert transformer is an allpass filter. I > believe in practical implementations it is high-pass.You're right. An ideal Hilbert transformer generates a quadrature signal at all frequencies and can't be realized. It's obvious that a 90 degree shift at frequencies approaching DC takes too long to be practical. I had in mind an odd-tap version so that the in-phase signal is available at the middle tap. That makes it a half-band filter, and the response near Fs/2 mirrors the response at DC, making it a bandpass. An even-tap HT is high pass, but I never used one. Jerry -- "The rights of the best of men are secured only as the rights of the vilest and most abhorrent are protected." - Chief Justice Charles Evans Hughes, 1927 ���������������������������������������������������������������������