Coder Social home page Coder Social logo

Comments (7)

JiaoXianjun avatar JiaoXianjun commented on July 17, 2024

to have stable wifi radar signal/phase, you need to use the iq capture functionality:
https://github.com/open-sdr/openwifi/blob/master/doc/app_notes/packet-iq-self-loopback-test.md#iq-self-loopback-quick-start

Please use the trigger condition 3:
3 the tx_intf_iq0 becomes non zero (the 1st I/Q out)
https://github.com/open-sdr/openwifi-hw/blob/900aa8f4c330d047660e10ac871fff922f44aa98/ip/side_ch/src/side_ch_control.v#L460C35-L460C55

You should start to do this from a setup with tx antenna rx antenna co-located very closely, and a quite low rx gain (check how to set rx gain in manual gain mode not AGC gain mode : https://github.com/open-sdr/openwifi/blob/master/doc/app_notes/frequent_trick.md ) to avoid interference in the air/environment.

You can monitor the iq plot via our python script, and adjust the rx gain manually to have IQ amplitude not too big (clipping) not too small (too low SNR).

After you have stable iq loop back over the air (closely co-located tx and rx antenna), you should see very stable stf and ltf at the beginning in the captured IQ real-time plot.

You can calculate the IQ sample phase difference between "all captures" and "the 1st captures". it is very stable.

You can also easily write a python script to calculate real-time CSI based on captured ltf IQ. (fft, divided by the tx ltf frequency domain signal, etc.)

from openwifi.

ThETyMaNp avatar ThETyMaNp commented on July 17, 2024

Thx very much for your help!I'll try it as soon as I can

from openwifi.

ThETyMaNp avatar ThETyMaNp commented on July 17, 2024

Thank you again for your sincere help, I followed your instructions, first I put the transceiver antennas very close to each other (I used two horn antennas about 30cm apart), then I adjusted the gain of the RX to 30 (I got a gain of about 41 at the actual reception), and adjusted the trigger mode to 3. Here are the commands I used to run it:

In one ssh:
ssh [email protected]
cd openwifi
./wgd.sh
./monitor_ch.sh sdr0 44
./sdrctl dev sdr0 set reg xpu 8 1000
insmod side_ch.ko iq_len_init=4095
./side_ch_ctl wh11d100
./side_ch_ctl wh8d3
./sdrctl dev sdr0 set reg xpu 1 1
./side_ch_ctl wh5h0
./set_rx_gain_manual.sh 30 //30dB
./side_ch_ctl g0

In another ssh:
cd openwifi/inject_80211/
(make)
./inject_80211 -m n -r 5 -n 1 sdr0

on computer:
python iq_capture.py 4095

I then ran it several times in the second ssh session:
/inject_80211 -m n -r 5 -n 1 sdr0

I have endeavored to generate LTF and STF sequences using Python, as depicted in Figures 3 and 6, and aligned them with the sampling rate of OpenWIFI (an LTF or STF sequence is 8 microseconds, which corresponds to 160 sample points at 20MHz). After obtaining the LTF and STF sequences, I removed the DC component and performed correlation calculations with the IQ sample signals that had also had their DC components removed. The resulting correlation magnitudes are shown in Figure 1, with the highest values occurring at 166 of STF and 315 of LTF(I am uncertain why the intervals are not 160 samples apart). From these peak values, I extracted 160 samples each to serve as the STF and LTF sequences, as presented in Figures 5 and 2, respectively. Subsequently, I conducted an FFT on the STF sequence (as the FFT results for the LTF sequence are more complex, I started with the simpler STF), and the outcome is illustrated in Figure 4:
Snipaste_2024-03-22_09-55-43

Question:
1.I hope you don't mind me reaching out for further clarification. I'm still learning about the characteristics of STF and LTF sequences and how to assess their stability. Could you kindly confirm if the stable section I observed is indeed indicative of a stable LTF sequence?
2.Additionally, I've attempted to apply an FFT to the STF signal and extract the phase information for frequency points with amplitudes exceeding 3000. However, I've encountered some phase discontinuities of 180 degrees, which I find puzzling. Could you provide some insight into why this might be occurring? Here are the phase values I've obtained:
Snipaste_2024-03-21_14-53-17
Snipaste_2024-03-21_14-53-30

Then, I also tried using MATLAB to perform FFT on the LTF sequence in the IQ signal and divide it by the LTF sequence at the transmitter to obtain CSI. The results were still the same: sometimes the phase information of CSI for two consecutive data packets was the same, and sometimes it would suddenly change by nearly 180 degrees.In the figure below, the first diagram shows the CSI phase of two consecutive data packets suddenly changing by 180 degrees. The second diagram is the normal one, where the horizontal axis represents the subcarrier sequence, the vertical axis represents the phase (from -π to π), and different colors represent the CSI phase of different data packets.
Snipaste_2024-05-03_18-28-44
Snipaste_2024-05-03_18-29-08

And after unwrapping the CSI phase for different subcarriers, the results are shown in the following figure.
Snipaste_2024-05-03_18-30-23

I sincerely hope that you can give me some advice.Thank you again!!!:)
Sincerely,
Guangteng Liu.

from openwifi.

petrichorZSY avatar petrichorZSY commented on July 17, 2024

Hello, I would like to ask you how you process CSI, frequency offset and other information, and how you print it out. What does this information have to do with the side_info.txt file? I would really appreciate it if you could reply to me

from openwifi.

ThETyMaNp avatar ThETyMaNp commented on July 17, 2024

Hello,

You can obtain the measurement information by running side_info_display.py, which will save it to side_info.txt for further MATLAB data processing. CSI and frequency offset data can also be acquired by creating Python scripts based on side_info_display.py.

from openwifi.

JiaoXianjun avatar JiaoXianjun commented on July 17, 2024

You might also need to disable our Tx LO automatic control. Because each time LO ON/OFF, the phase might be different.

Check the xpu register 13. Set it to 1 will disable it.

from openwifi.

ThETyMaNp avatar ThETyMaNp commented on July 17, 2024

Made it!!!
Thanks for your generous help!!!My gratitude is beyond words!
:)

from openwifi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.