# Estimation of filter response

If I have samples of input say x(1:500) and it passes through FIR filter with 9 taps and some unknown coefficients. The output y(1:508) is also known. The aim is to estimate the filter response in frequency domain. I know using Convolutional theorem $\hat{H} = (X^H*X)^{-1}(X^H*Y)$, but this requires fFT of full 500 samples, However I can only do fft of 128 samples at a time. How to estimate the filter response in frequency domain ?

• Couldn't you simply run a 128 sample impulse at the input, then do the FFT at the output? – a concerned citizen Dec 18 '17 at 7:30
• yep, assuming the taps aren't distributed over delays > 118, I don't see why you'd need all your input for classification. It would, however, be very interesting why you can't do a larger FFT. That is an unusual problem. – Marcus Müller Dec 18 '17 at 12:30

## 2 Answers

You may wish to easily do sliding window fft, and to get a set of outputs. That means that for the first run you will do fft on samples 1:128, on the second run fft on samples 2:129 and so on. In this way, you will get 500-128 fft outputs, each one of 128 length. After this, you may average all fft sample outputs, and get what you are looking for. The second and a better way is possible if you have control over the filter, i.e, you can send input to your filter, the best way is to have just a single pulse running through it, and calculating fft after that.

If your system is noise free, you really only need the first nine samples of input and output.

$$h[0] = y[0]/x[0]$$ $$h[1] = (y[1]-h[0] \cdot x[1])/x[0]$$ $$...$$ If there is noise, numerical problems, or if the initial state of the filter is unknown, you can set this up as a least square error problem in the time domani.