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

AoA Music #3

Open
tweigel-dev opened this issue Oct 28, 2020 · 12 comments
Open

AoA Music #3

tweigel-dev opened this issue Oct 28, 2020 · 12 comments

Comments

@tweigel-dev
Copy link

Hay,
i try to implement an AoA with my CSI data from intel5300.
Therefore i tried to use your music implementation.
i have an csi vector with 3 antennas and 30 subcarrier.
If i pass the np.matrix (3,30) through the music function (directionEstimation.py line 317)
i get the error:

""ERROR: Correlation matrix is not quadratic"

But why it should be?
I didn`t found anything at the MUSIC paper saying that it should be quadratic.
Did i misunderstand MUSIC or is there a mistake at the code?

@petotamas
Copy link
Owner

All the implemented DoA estimation algorithms work with the spatial correlation matrix, which is quadratic. You can calcaulte the spatial correlation matrix with the use of the corr_matrix_estimate() function from your measured data matrix.
Note that, this function expects a signal matrix which has a shape of N x M, where N is the number of signal samples and M denotes the number antenna channels. Therefore, you have to transpose your 3x30 mesurement data matrix before you call the correlation matrix estimation. The shape of the output matrix (the correlation matrix) should be 3 x 3.

You can find more information regarding to the usage of the above functions in the documentation:
https://github.com/petotamas/pyArgus/blob/master/docs/nb_direction_of_arrival_estimaton.ipynb

@tweigel-dev
Copy link
Author

Thanks for the quick response!
Now i getting some AoA output by MUSIC but it doesn't work correctly :(.
I measure about 30 csi matrix with the same angle to estimate the angle better then with one measurement.
now i noticed that each MUSIC result shows his own result. with nearly no correlation to the real angle.

i played around with the parameters. I found out that d has a huge impact to the results.
my antennas are 62mm apart of each other. The wavelength of wifi is about 12.3 cm. that means i should have d = 0.5 isn't it?
and the output of MUSIC describes tetha, isn't it? why the output is from 0 to 180 and not from -90(270) to 90?

my averaged results of 0°,45° and 90° with 2 measure processes in 2 different environments each of them with about 30 csi matrices:

0°
~45°
90°

@petotamas
Copy link
Owner

Setting of the proper antenna arangemenet parameters is mandatory for the correct operation.

The 'd' parameter specifies the interelement spacing in case of Uniform Linear Array antenna configuration. This parameter is normalized to the wavelength, so if you are working at 2.4GHz, the free space wavelength is 12.5 cm, and if you placed your 3 antennas in a row 6.25 cm apart from each other than you have to set 'd' to 0.5.

Also note that you have to calibrate your antenna system, and of course your 3 channel data acquisition system must be coherent.

@tweigel-dev
Copy link
Author

What did you mean with calibration ?

Thanks for your help!

@petotamas
Copy link
Owner

petotamas commented Oct 30, 2020

Every multichannel receiver hardware has inherent amplitude and phase distortions. This is because the transfer characteritics of the individual receiver channels are different, thus the phase delay information is deteriorated during the reception.
This error must be calibared and corrigated prior to the use of these algorithms.

@petotamas
Copy link
Owner

Since the originally raised problem has resolved, I am considering this issue to be solved.

@tweigel-dev
Copy link
Author

tweigel-dev commented Dec 28, 2020

I still run into problems when trying to determine the entrance angle. @petotamas

Every multichannel receiver hardware has inherent amplitude and phase distortions. This is because the transfer characteritics of the individual receiver channels are different, thus the phase delay information is deteriorated during the reception.
This error must be calibared and corrigated prior to the use of these algorithms.

did you mean, that I have to normalize the CSI amplitude before using corr_matrix_estimate() ?

Here is a plot of the amplitude of 10 sniffs with 1x3x30 CSI shape
image

All 3 antennas notice the same Signal with nearly the same amplitude. This shows us that the signal receives with theta 0° , isn't it ?
But if I use MUSIC to estimate DoA I get the following result :
image

Thanks for your help in advance!

@petotamas
Copy link
Owner

You have nearly identical amplitude on all the channels, but you have to calibrate the phases as well. This is quite crucial to the correct operation. Could you please plot the phases of the subcarriers as well for all the channels? In case the signal of interest is at boresight, you should see no relative phase differences. Another corner case that you can easily use to verify the correct operation is when the incident ange is 60 deg. In this case you should see 90deg relative phase diffs between the channels (ULA, element distance is 0.5 wavelength)

@tweigel-dev
Copy link
Author

tweigel-dev commented Jan 2, 2021

Thanks for your support!

Phase RESULTS ## phase of 1 CSI-entry with theta 0°

image

phase of 10 CSI-entries with theta 0°

image

It seems to be more or less the same phase, but each CSI has captured a different face from the frame.

By the way: did you have a hint, why the csi get a kink at the middle?

@tweigel-dev
Copy link
Author

By the way: I get very different results of MUSIC angles if I change the distance of the capture environment.
even though I am aware of the Fresnel Zone and use a LOS environment.

@petotamas
Copy link
Owner

Based on your results I think the phase differences between the channels are reasonably high and it even changes from sub-carrier to sub-carrier. A more informative plot would be to plot the phase differences of the channels only, unwrap the phases and convert it to deg.

I have the following ideas to check:

  • I guess you perform some sort of DSP on the captured time domain signal prior to the AoA estimation, as you somehow transform the signal into the sub-carrier domain. You have to make sure that you perform the same operations on all the channels. You are not compensating channel related errors differently. (such as frequency offset compenstation, carrier phase compensation, channel equalization in case it is on OFDM type of signal, passing the signal of the channels on adaptive filters independently or passing them on different filters, and so on.. )
  • Are you performing this measurement indoor or outdoor?
  • If the above cases are all false, then again, at boresight you have to see no phase differences on the channels (Uniform Linear Array). Try to test your system with a simple CW signal, and if the phase differences are not zero, you have to calibrated the channels digitally.

I would highly recommend to generate simulated signals as well so you can test you DSP and the correct operation of the PyArgus library as well.

By the way: did you have a hint, why the csi get a kink at the middle?
Since it is in the middle, I would think it is related to the DC component of your baseband signal.

@petotamas petotamas reopened this Jan 4, 2021
@tweigel-dev
Copy link
Author

Thanks for your great help and support!

plot would be to plot the phase differences of the channels only

You are right there is a phase diff. and it seems to be nearly constant at at fixed distance! But It isn't constant at different distances. And a few times I get some unclean results. I use (phase_rx_n - phase_rx_0 )mod 2pi.

Phase Diff RESULTS

5m

image

10m

image

20 m

image

30m

image

50m

image

Interesting is now, if the phase diff is semi constant, how I can be sure that the Phase shift is caused by theta != 0°

I guess you perform some sort of DSP on the captured time domain signal prior to the AoA estimation, as you somehow transform the signal into the sub-carrier domain. You have to make sure that you perform the same operations on all the channels. You are not compensating channel related errors differently. (such as frequency offset compenstation, carrier phase compensation, channel equalization in case it is on OFDM type of signal, passing the signal of the channels on adaptive filters independently or passing them on different filters, and so on.. )

my current CSI gather environment is the the Wifi Chip intel 5300 and I am using the LinuxCSI tool by halerin. This makes the Channel state Information (CSI) available. CSI contains the amplitude and phase of the received layer 2 wifi Frame per antenna.
I think it is not possible to send a valid CW to a Wifi NIC, isn't it ?
also I have no influence to the subcarrier transformation but I think they are processed equally.

Are you performing this measurement indoor or outdoor?

Currently my Tests are outside to minimize reflection and scattering.

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

No branches or pull requests

2 participants