Content¶
- pyfasst.spatial.steering_vectors.dir_diag_stereo(Cx, nft=2048, ntheta=512, samplerate=44100, distanceInterMic=0.3)[source]¶
Compute the diagram of directivity for the input short time Fourier transform second order statistics in Cx (this Cx is compatible with the attribute from an instantiation of pyfasst.audioModel.FASST)
\[C_x[0] = E[|x_0|^2]\]\[C_x[2] = E[|x_1|^2]\]\[C_x[1] = E[x_0 x_1^H]\]Method:
We use the Capon method, on each of the Fourier channel \(k\):
\[\phi_k(\theta) = a_k(\theta)^H R_{xx}^{-1} a_k(\theta)\]The algorithm therefore returns one directivity graph for each frequency band.
Remarks:
One can compute a summary directivity by adding the directivity functions across all the frequency channels. The invert of the resulting array may also be of interest (looking at peaks and not valleys to find directions):
>>> directivity_diag = dir_diag_stereo(Cx) >>> summary_dir_diag = 1./directivity_diag.sum(axis=1)
Some tests show that it is very important that the distance between the microphone is known. Otherwise, little can be infered from the resulting directivity measure...
- pyfasst.spatial.steering_vectors.gen_steer_vec_acous(freqs, dist_src_mic)[source]¶
generates a steering vector for the given frequencies and given distances between the microphones and the source.
To the difference with gen_steer_vec_far_src_uniform_linear_array(), this function also includes gains depending on the distance between the source and the mics.
- pyfasst.spatial.steering_vectors.gen_steer_vec_far_src_uniform_linear_array(freqs, nchannels, theta, distanceInterMic)[source]¶
generate steering vector with relative far source, uniformly spaced sensor array
Description:
assuming the source is far (compared to the dimensions of the array) The sensor array is also assumed to be a linear array, the direction of arrival (DOA) theta is defined as in the following incredible ASCII art drawing:
theta ----->/ / | / / y / / / / ^ / / |/ / +---> x o o o o o o M1 M2 M3 ... <---> d = distanceInterMic
That is more likely valid for electro-magnetic fields, for acoustic wave fields, one should probably take into account the difference of gain between the microphones (see gen_steer_vec_acous() )
Output:
- a (nc, nfreqs) ndarray
- contains the steering vectors, one for each channel, and