Closed narahahn closed 6 years ago
Let's continue our discussion here. I'm quoting your Email:
I have taken the M= N because , when i compute circular cross correlation I need equal lengths ( for computation, i took equal lengths , where in our case N=800) .
sorry, its K=N ,, not M
K
is the number of required impulse responses which is independent to N
. You can compute as many impulse responses as you need. Of course, you can compute just one. Therefore, the choice of K
should not affect the system identification process. If it works only if K=N
, something is wrong.
After the spatial interpolation, the impulse response is given as the circular cross-correlation of the sound field and the excitation signal. Yes, you need two signals having the same length N
. But the question is, is y_i
the sound field at a particular position. Why it does not have length of N
but K
?
Maybe it will help to look at the overall structure in #1.
@david1412 Please check numpy.interp
and see how a periodic signal is interpolated.
https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.interp.html
I will check and try out this . Thankyou
You are replacing the first (or the last) element of phi_i
with phi_target
. If you do so, the first (or the last) sample of s_i
is considered to be obtained at phi_target
which is not true. Probably, the interpolation result will be equal to s_i[0]
(or s_i[-1]
). The interpolator tries to find the value of s_i
corresponding to phi_target
which cannot be other than s_i[0]
(or s_i[-1]
) due to the replacement.
I want to remind you that the polar angle phi_i
and the corresponding signal s_i
are periodic. If phi_target
is smaller than phi_i[0]
(or greater than phi_i[-1]
), you can take the data from the previous (or the next) period. The additional data should be appended to the original one:
[phi_i[0], phi_i[1], ..., phi_i[-1]]
, [s_i[0], s_i[1], ..., s_i[-1]]
[phi_i[-1]-2*np.pi, phi_i[0], phi_i[1], ..., phi_i[-1], phi_i[0]+2*np.pi]
, [s_i[-1], s_i[0], s_i[1], ..., s_i[-1], s_i[0]]
In the above case, only one sample is appended at each end. Notice that both phi_i
and s_i
have to be appended so that they have the same length. Also, 2*np.pi
is subtracted from the left-appended data and added to the right-appended data.
The spline interpolation still does not works in my computer, how about in yours? The linear interpolation works fine.
I dont have problem with spline interpolation . it is working well and i used Linear interpolation as well. but the issue is kernel will die when i run the code after 3 hours..
https://github.com/david1412/Time-varying--MIMO/blob/7485f3b0f09574e49d81562930913e82c641ec36/SISO4.py#L362
K
is the number of impulse responses we want to have at the end. It is not necessary equal toN
which is in our example800
and too many.https://github.com/david1412/Time-varying--MIMO/blob/7485f3b0f09574e49d81562930913e82c641ec36/SISO4.py#L413-L427 What does
M
mean, and why is it4
? The length of each impulse response has to beN
, andimpulse_response
should have the corresponding size. The for-loop up-toM
also does not make sense. The sub-signal has to be a decimation by a factor ofN
.phi[i::M]
does not gives the sub-signals we need.https://github.com/david1412/Time-varying--MIMO/blob/7485f3b0f09574e49d81562930913e82c641ec36/SISO4.py#L426-L436
y_i = spatial_interpolation(s_i, phi_i, phi_target, interp_method)
computes the sound field at time indexi
for all target angles. Can we use this directly for the impulse response computation? If you get anan
in your computation, you should fix something not just ignoring it.