joaocarvalhoopen / Partial_implementation_of_the_ApneaAPP_paper___FMCW_sonar

The technique described in the original paper has the capacity to monitor the breading abdominal movements in a sleeping person, normally used to detect sleep apnea.
7 stars 3 forks source link

Run the code and get straight line for the final result #1

Closed yanbigong2 closed 2 years ago

yanbigong2 commented 3 years ago

Hi,

I tried your code and got nothing output. Could you please highlight the part you calculate the distance?

joaocarvalhoopen commented 2 years ago

Hello yanbigong2,

This is only some code that I made in 2018 (like is said in the text explanation, I publish it at a later time), where I was trying to understand how the paper of Appnea APP worked. The paper implements a FMCW RADAR/sonar, and that is a very simple king of RADAR. Basically you generate a chirp that is a signal that goes up or down (in one direction) in frequency along the time. Then it goes out of one speaker and into the air medium, then it collides with a target and it comes back again reflected at a smaller amplitude and smaller "power". Along that time the speaker is currently already sending a signal at a higher frequency and in the microphone you will receive at that moment of the arrival of the reflection of the signal two peaks of the FFT, one bigger, of what the speaker small path to the microphone is sending currently and other smaller from the reflection from the target. I don't remember currently what I did exactly on the code, but is very simple, you find the 2 peaks (that gives you a syncronization between the sent time and the receiving time), you subtract there frequency difference and and you multiply by the rate of the frequency you are increasing or decreasing the chirp. That will translate differences in frequency of the two peaks into differences in time that multiplied by the sound velocity at the current high that you are on will give you the distance. I think that I just plotted the relative variation in the animation. But I don't remember because I made this in 2018, a long time ago :-) But I remember that it worked. At that time I had sent to same friends a big email full of graphics of all the experiments that I had made at the time. I have also implemented at least another radar that used OFDM, another paper from the same author, also to learn about that one, how it worked by doing same experiments and reading same books and papers. But I don't think I publish that one, and sincerely don't know currently where that code is. To many projects to remember :-)

The chirp wav must be playing while you record the file output and then OFF-LINE analyze it. Just see the code and study it, it's not long.

The majority of the things that I share in my GitHub, are not full flagged programs, they are exploration that I made with some incites that I found while doing that exploration of knowledge, normally in the code itself. They are meant to share the code so other giving a look at the same problem can have there path a little bit simplified, but they are not full turn key programs for end users to use, with same exceptions. Normally my target audience is the fellow programmer seeking like myself for knowledge and that is willing to study code and the references that I give and not the end user of a program.

Hope this helps.

Best regards, João Carvalho

joaocarvalhoopen commented 2 years ago

Yesterday night I wrote a simple program to explain better how you could calculate the distance it in a simple way. But there are many ways of doing it. See FMCW_in_Python__How_to_calculate_the_distance

Hope this helps,

Best regards, João Carvalho