mincequi / qLouder

A tool to measure and design loudspeakers
GNU General Public License v3.0
15 stars 2 forks source link

How to generate frequency response of mobile devices? #7

Closed zuowanbushiwo closed 2 days ago

zuowanbushiwo commented 1 week ago

Dear Sir this is a really cool project,I am an AI software engineer. My recent work requires knowledge of acoustics and structure, but I have never been exposed to it before. I need to generate a lot of mobile device impulse responses to generate data and then train the AI model. As described in the second section of the Appendix. I wonder if your program can generate some frequency curves for devices like Huawei Mate, iPhone , Samsung and smartspeaker and laptop? Device playback augmentation with echo cancellation for keyword spotting.pdf Thanks!

mincequi commented 1 week ago

Hey there, i am not quite sure, whether i understand you correctly, but you would like measure the impulse/frequency response of several mobile phones and speakers (and especially the speakers of mobile phones)? Or do you want to measure the room response using that devices?

zuowanbushiwo commented 1 week ago

Hi @mincequi Thank you very much for your reply.

i am not quite sure, whether i understand you correctly, but you would like measure the impulse/frequency response of several mobile phones and speakers (and especially the speakers of mobile phones)?

I want to do this, I want to use the measured loudspeaker impulse response (Not include Room impulse response) to simulate the signal of this loudspeaker playing speech/music.
I think a complete impulse response h(t) when loudspeaker plays sound to microphone:

$$ h(t) = h{RIR}(t) \cdot h{spk}(t) \cdot h_{mic}(t) $$

$h{RIR}(t)$ is room impulse response which can use pyroomacoustics to simulate , $h{mic}(t)$ is a microphone impulse response, which can use a opensource micirp dataset , but about $h_{spk}(t)$ loudspeaker impulse response I haven't found a method yet, and I haven't found any open source data sets or simulations.

thanks! best

mincequi commented 1 week ago

Ok, then you have to measure the frequency response of the loudspeaker (and convert it to the impulse response). But then you have to exclude room effects using free field measurement and probably understand the farina method on how to measure this: https://www.melaudia.net/zdoc/sweepSine.PDF

The process is:

  1. Generate a sine sweep signal
  2. Play it using the mobile phone (and record it using a calibrated microphone)
  3. Apply the farina method using the measured and played (reference) signal.
  4. Then you have the impulse respone.

Note: the process is somewhat complex and error prone. You will need some in-depth understanding of acoustics and its measurement to accomplish this. Anyhow: yes, my tool can help. (It generates the sine sweep and implements the Farina method). But re-using my tool also involves knowing about C++ to modify for your needs.

zuowanbushiwo commented 1 week ago

Hi @mincequi

Thank you very much for your detailed and patient reply, which is very helpful to me as a beginner.

I have another question: according to your description above, does it ( measurement loudspeaker frequency response) need to be measured in an anechoic chamber? In principle, I think so, and from the formula above, I also think it is necessary, but the environment of an anechoic chamber is too difficult to obtain.

Best

mincequi commented 2 days ago

Hi @zuowanbushiwo , yes, for an accurate measurement (without room influences) you have to do those measurements in an anechoic chamber. Or: free field measurement, or: near field measurement, or: a gated measurement. Just in case you never dealt with (electro-) acoustics, there is very likely no way around an appropriate book or course. This topic is just too difficult...

zuowanbushiwo commented 2 days ago

@mincequi Thank you very much for your detailed and patient reply, Yes it is too difficult. Best

zuowanbushiwo commented 2 days ago

@mincequi Following the instructions you gave, I searched on Google and found this website. Is this the case? Thanks!

mincequi commented 1 day ago

@zuowanbushiwo, yes, this site might serve as a good starting point.