I am trying to measure the frequency response of acoustic filter. I sample the sound before propagation in the filter and after by 2 different mics. And now I am trying to find the system (the acoustic path) frequency response.

Using matlab how can I do it?

  • I tried the identification app but the result is not so reliable and fails if the signal is changed.
  • I tried $\displaystyle\rm H=\frac{\lvert FFT(output)\rvert}{\lvert FFT(input)\rvert}$ but the result is bad too.

UPDATE: After running this code:

[y, Ss] = audioread('4.wav');

h = fir1(30,0.2,rectwin(31));
y_f = filter(h,1,y);

[Txy,f] = tfestimate(y,y_f);    

I am getting: enter image description here

What I doing wrong?

  • $\begingroup$ What is your signal? Have you tried the wel established methods such as MLS, sweep-sine, etc? $\endgroup$ – jojek Aug 24 '16 at 10:06
  • 1
    $\begingroup$ Is your system linear and time invariant to start with? $\endgroup$ – Jazzmaniac Aug 24 '16 at 10:40
  • $\begingroup$ You often can test relatively easy test if your system is LTI by inputting a single frequency. If it is not LTI you should see different frequencies in the output. Also I assume you used the MATLAB function tfestimate, if so which window, how many windows, and how much overlap did you use? $\endgroup$ – fibonatic Aug 24 '16 at 12:33
  • $\begingroup$ According to the design of the acoustic path , it intend to behave like a filter. desired like a BPF . taking this in consideration I think the system is LTI. but I will perform the test now. thanks. I used tfestimate but without windows only input and output. I am not an expert in matlab at all :) I am very basic user. can you please explain about the windows? $\endgroup$ – Anna Aug 25 '16 at 7:01
  • $\begingroup$ fibonatic, I am trying the tfestimate function but I can not foind how to work with it. Do you have any materials? $\endgroup$ – Anna Sep 4 '16 at 9:52

tfestimate is a good approach. But it seems you're using the wrong kind of input to test the filter. If your input signal only contains lower frequencies tfestimate has not enough information to compute the transfer for higher frequencies. It's sort of a division by zero situation, then.

  • $\begingroup$ After a lot of testings I realized this :) I tried to implement the filter to white noise signal and look to its FFT or compare it to zero signal with tfestimate. After getting strange results I tried to record white noise with the microphone only and my response is not flat at all. Despite the datasheet of the microphone and te speaker promise flat response I am getting 40dB gained signal on the 1kHz point. I am understanding that I am measuing something wrong but don't know what is wrong .... $\endgroup$ – Anna Sep 13 '16 at 12:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.