Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating sine sound field? #19

Open
DvDream opened this issue Sep 23, 2020 · 5 comments
Open

Generating sine sound field? #19

DvDream opened this issue Sep 23, 2020 · 5 comments
Assignees
Labels

Comments

@DvDream
Copy link

DvDream commented Sep 23, 2020

Hi, is there a way of generating a simple signal sound wave, even a simple sine, using this library? Because as I could have seen in the ideal_wave example there is no signal that can be put in input. Thank you in advance :)

@HaHeho
Copy link
Member

HaHeho commented Sep 23, 2020

To clarify first what you are looking for. In the simulation of what kind of sound field are you interested in:

  • anechoic sound field in Spherical Harmonics?
  • anechoic response of a spherical microphone array to a sound field in Spherical Harmonics?
  • binaurally rendered ear response from the anechoic spherical microphone array response?

These are all different stages that build on top of each other. In any of the scenarios, the idea of the simulations is that one generates some impulse responses, which can then be convolved with an arbitrary source signal.

@DvDream
Copy link
Author

DvDream commented Sep 23, 2020

For a first study I would say the 1st one and maybe later the 2nd one. I would like to generate a dataset of some given signals wave decomposition into sperical harmonics.

@JensAhrens
Copy link
Member

What sfa-py primarily does is evaluating the transfer function (a.k.a. frequency response) of a given system at a given frequency. This could be, for example, the transfer function from a plane wave to a location on the surface of a spherical scatterer. The result is a single complex number in this case. Let's call it H(\omega_0), whereby \omega_0 is the radian frequency of interest.

If the plane wave were to carry a sine wave that is given in complex notation as exp(i \omega_0 t), then the signal that would arise at the given location on the surface of the scatterer will be H(\omega_0) exp(i \omega_0 t).

If you want the plane wave to carry a broadband audio signal such as speech, you'll have to sample the transfer function H(\omega) at a sufficient amount of equi-spaced frequencies so that you may interpret H(\omega) to be the result of a Discrete Fourier Transform. I'll need to impose all the symmetry that DFT spectra have by hand. Then, you can perform an inverse DFT and you'll get an impulse response that represents the transfer path from the wave to the location on the spherical scatterer. Convolve your speech signal with this impulse response, and you'll obtain the signal that a microphone at the given location on the scatterer would sense due to the plane wave that carries the speech.

@DvDream
Copy link
Author

DvDream commented Sep 24, 2020

Thank you so much for the tips! So if I'm understanding well the plane/spherical waves that I'm "creating" are going to be the same (from the decomposition point of view) unless I change the "acquisition properties" or I decide to make them carry a signal whatever it is, right?

Moreover, let's assume that I want to reproduce the obtained sound field in a reproduction area, where the pressure at the m-th matching point generated by the n-th speaker is defined as p_nm(f) = w_n(f) * g_mn(f), where w_n(f) is the n-th loudspeaker excitation in time domain, g_mn(f) denotes the impulse response between the n-th loudspeaker and the m-th matching point, both in the frequency domain.
I know that as ATF (g(f)) I can use the Green's function, while I was wondering if I could use either the obtained impulse response of the sound field captured from the microphone or the Spherical Fourier Coefficients as the excitation signal.

@JensAhrens
Copy link
Member

Thank you so much for the tips! So if I'm understanding well the plane/spherical waves that I'm "creating" are going to be the same (from the decomposition point of view) unless I change the "acquisition properties" or I decide to make them carry a signal whatever it is, right?

Yes.

Moreover, let's assume that I want to reproduce the obtained sound field in a reproduction area, where the pressure at the m-th matching point generated by the n-th speaker is defined as p_nm(f) = w_n(f) * g_mn(f), where w_n(f) is the n-th loudspeaker excitation in time domain, g_mn(f) denotes the impulse response between the n-th loudspeaker and the m-th matching point, both in the frequency domain.

I don't understand. You write w_n(f) but term it time-domain signal. Then, g_mn(f) is an impulse response in frequency domain? Isn't an impulse response a time-domain concept?

I know that as ATF (g(f)) I can use the Green's function,

What is ATF?

while I was wondering if I could use either the obtained impulse response of the sound field captured from the microphone or the Spherical Fourier Coefficients as the excitation signal.

Certainly. Yet, I don't fully understand what you want to do. Please send me an email with more comprehensive information, and maybe some papers as references or so. You'll find my email address here: http://www.ta.chalmers.se/people/jens-ahrens/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants