david1412 / Time-varying--MIMO

Time varying system identification of MIMO Acoustics systems
0 stars 0 forks source link

System Identification using Spatial Interpolation #3

Closed narahahn closed 6 years ago

narahahn commented 7 years ago

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 to N which is in our example 800 and too many.

https://github.com/david1412/Time-varying--MIMO/blob/7485f3b0f09574e49d81562930913e82c641ec36/SISO4.py#L413-L427 What does M mean, and why is it 4? The length of each impulse response has to be N, and impulse_response should have the corresponding size. The for-loop up-to M also does not make sense. The sub-signal has to be a decimation by a factor of N. 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 index i for all target angles. Can we use this directly for the impulse response computation? If you get a nan in your computation, you should fix something not just ignoring it.

narahahn commented 7 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.

narahahn commented 7 years ago

@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

david1412 commented 7 years ago

I will check and try out this . Thankyou

narahahn commented 7 years ago

https://github.com/david1412/Time-varying--MIMO/blob/5cc87446d286eab0424a483f055ade65650ae7c7/SISO#L328-L334

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:

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.

narahahn commented 7 years ago

The spline interpolation still does not works in my computer, how about in yours? The linear interpolation works fine.

david1412 commented 7 years ago

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..