# Guess the frequency response of a filter with little information

I have a processing unit that does a nice EQ filtering on soundfiles. The only thing I can do is : I give the original .wav file, and the processing unit gives me back the filtered .wav. I have no other information than this.

I'd like to know the frequency response graph of this processing unit. How to do it ?

• 1) feed the unit with a "flat spectrum white noise", and see the spectrum of the filtered file? It works but it is not very accurate

• 2) feed the unit with sinewaves soundfile with frequency = 20, 30, 40, 50, etc... 20 000 Hz. Then I examine the response for each file... and I can draw a frequency response graph after 10 hours of work :)

• 3) feed the unit with a frequency sweep ? and then try to see what's the unit's reponse to this sweep ? How to decode the response into a nice frequency response graph ?

• 4) I imagine that there is another better solution?

Thank you.

• All of the methods that you proposed are viable options. The easiest is probably to feed the algorithm with white noise. Why do you feel like it isn't accurate? Oct 22, 2013 at 15:50
• Method 1 with white noise is okay for having the general shape of the frequency response curve, but it is not accurate (I know it because I tried this method with some filters for which I knew frequency response, and the dB given by this empirical method is not accurate)
– Basj
Oct 22, 2013 at 16:55
• The white noise approach becomes more accurate as you do it longer and average the results. In any given stretch of time the frequency of white noise will not be perfectly flat. It only flattens in long periods of time due to the "regression to the mean" effect. Oct 22, 2013 at 17:10
• Yes that's true, I have noticed that the longer the white noise is, the best the shape of frequency response is. However, even with a very long time (e.g. 60 seconds), the frequency response graph made with method #1 (white noise) only gives poor result... the dB attenuations shown by the empirical graph are not the real dB attenuation of the "ideal frequency response graph"
– Basj
Oct 22, 2013 at 18:43

## 1 Answer

If you know that the system is linear and time invariant, the easiest method (assuming that you have no noise added in the process) is to let the system act on an impulse function. The Fourier transform of the output is the frequency response of the system.

• Should I feed the unit with a wav file with data = 0, 0, 0, 0, then just one 1.0, then 0, 0, 0, ...? (ie a .wav file with the first sample at full volume and the rest at 0)
– Basj
Oct 22, 2013 at 16:57
• Yes, precisely. The result is then the impulse response of the system. And because the Fourier transform of the impulse has unit magnitude and the system is linear, the Fourier transform of the impulse response is the frequency response. Oct 22, 2013 at 17:50
• Also note that there are more robust methods for measuring the impulse response, but they only make sense if the result from the naive impulse response measurement don't come out very well. That would apply for example if the system was measured with a microphone in a noisy environment. Oct 22, 2013 at 17:53
• it works ! 1/ I give a Dirac to the unit 2/ I get a .wav in return (=impulse response) 3/ I display the spectrum (=frequency response)
– Basj
Oct 22, 2013 at 18:55
• @Jazzmaniac - How to go if the unknown system in not LTI . And secondly What do you mean by 'system was measured with a microphone in a noisy environment'? Oct 25, 2013 at 13:41