I am trying to realize a digital filter that has the same freq. response of an existing speaker. I have fed an audio sine sweep to the speaker and measured the speaker output, both at 48kHz. Then I perform FFTs of the input(X) and output(Y), divide the absolute values point-wise (absY./absX) to get the transfer function/freq. response (H).
Now I would like to determine the filter coefficients B and A for an FIR/IIR filter, so that I can model the speaker's response digitally. I understand my transfer function is in the domain of w, and filter coefficients are the coefficients of the difference equation of the filter.
This is where all my text-book theory seems to fall apart, and I was hoping someone could clarify:
- If I understand correctly, since my data is discrete (sampled at 48k), my data is in terms of 'n'. If I performed an ifft of H (which is complex), the resulting vector is basically my filter coefficients?
- Matlab suggests using invfreqz to find filter coefficients, given a complex frequency response. Does this function map from w to z domain? If so, am I right in understanding that the FFT needs to be converted to Z domain to derive its filter coefficients?
- What parameters does a auto-regressive filter fit to? for eg: Yule_Walker, or Levinson, or if I want to run a gradient descent to fit a filter? What is the error calculated between?