I used numpy library to perform required calculations.
-
performed normalisation as following:
mean = np.mean(tx)
norm_tx=tx-mean
norm_rx=rx-mean
-
then performed correlation b/w them using following function:
res_corr=np.correlation(norm_tx,norm_rx,‘same’)
-
the length of norm_tx,norm_rx,res_corr are:
len(norm_tx),len(norm_rx),len(res_corr)=2048
-
and argmax(res_corr)=1038
-
and therefore delay is:
delay=argmax(res_corr)-(round(len(norm_tx)/2))
=14
Here 14 consists of 14 time unit, which if sampling rate is 5MHz, then is 1 unit=2x10^-7s .
Please provide your valuable suggestions or if I missed anything.I have attached the simulated wave forms that I performed my experiment, they have calculations in them, annotated with red rectangle where first line denotes the length of each sample file.



WEEKLY REPORT 6
-
Have created and pushed PRU0 assembly code for generating clock required for sampling and to round robin the channel inputs
-
Have created and pushed PRU1 assembly code to add other two new channels in ring pointer transferring data to host program
-
edited round robin.c file to store six sample values and reboot PWM module after every 4000 loops
Next thing:
-
To test above changes and make them work, since kernel structure has changed than from the time they were created in their src repository
-
Make another arrangement to perform above functions as Stephen asked me to do, by using last year code developed in beagle-sonic-anemometer GSoC project
If the changes I pushed to repo today, starts to work, than the major thing to encounter would be just hardware interfacing, which involves some digital electronics and circuits knowledge, and then some nice method to use sampled data, currently we are using method from last year, that uses a library zeroMq, it is an low level API that transfers data using sockets principle, but in last year method it required us to use two instances of shell.
Once we create a program to process raw sample data to find TOF and temp, I would start testing and debugging these set of program.
This might take only a week or two at max, then we work on enhancing other aspects, like accuracy and sensitivity etc.
Weekly Report 7
- created a python program to process the temp and sampled wave-forms from PRUdAQ to find time of flight, ultimately the wind speed.
- configured setup.sh to enable PWM module, and nerdboy figured out workaround for requirement of uio_pruss which was deprecated and disabled in ti kernel images in favour of remote-proc method.
To be Done:
- test the programs for tx and rx part
- implement a micro-server like flask to provide calculated results i.e. wind speed and other data like temp
- test the accuracy of algorithm and method for determining TOF and then calculation of wind speed
- a slight hiccup: I wanted to know how to share internet connection from mac to beaglebone black wireless, I tried from settings option to share internet to other ports but that messed up with DHCP and disrupted the SSH connection and iptables command is not available in mac
In windows , I was able to share internet but git is always unable to fetch files, hence I can’t execute any apt-get command or update-script
Any suggestions are welcome regarding the transfer of sampled data from C program to python program, currently we are relying on last year GSOC method using ZMQ library, it creates tcp connection ports that can be used to transfer data but I feel they are not reliable in maintaning the sequence of sampled data, and this can introduce serious errors in calculation as for ex. tx samples gets appended into rx waveform.
Thanks!
Naveen Saini
Weekly report 11:
Now the software part is almost complete, I have started the documentation for testing out the apparatus, currently I have created the wiki page to test using arduino uno for simulating waveform.
What I have done
-
Completed the multi axis program, such that the samples are collected in every 2 seconds, and are sent to python program
-
Earlier I was sending the whole buffer transferred from PRU to the python program which was I guess unnecessary, now the samples to be used for cross correlation are taken care during transfer from python to C
What is to be done:
-
Test the apparatus for TOF calculation
-
complete the documentation for the anemometer, working the principle we are using in this code.
Weekly Report 12:
- I made out lots of minor improvements to code for better result calculation in both single and double axis anemometer,
- completed some of documentation to explain the whole concept, and software modules I have implemented
- tested with arduino, while the results indicate the logic part of software is correct but requires some more minor tweaks like time interval sampling rate for better results
Now I have to complete documentation for test circuit implementation and explanation of software part so that anyone new can pick up to contribute into this project.