Measuring distance using CDM324 radar module. - Page 1
Forum section: electronics / projects

author: Georgy.Moshkin
author_rank: Frequent Contributor
timestamp: February 22, 2024, 02:43:06 pm
content: Some time ago I have developed an algorithm for estimating distance D to moving targets using simple radar without carrier modulation. Distance estimation principle is simple:Doppler radar measures speed that is affected by Cosine Effect: Vmeasured=v*cos(alpha)Angle alpha is a function of time T, speed V and distance D: alpha=f(T,V,D).If target trajectory is a close to straight line and speed V≈const, then it is pretty easy to estimate distance D, a distance between a point (radar antenna center) and a line (target trajectory).I've spent a lot of time perfecting this algorithm since 2015. My first attempt was based on FFT spectrogram pattern matching: we can build a set of patterns for different speeds and distances (V,D) using Vmeasured=v*cos(alpha) formula and then try to match these patterns in measured spectrum. It is possible to save some memory using the fact that doubling target is equivalent to spectrogram image scaling. Scaling factors are 0.5 for time axis and 2.0 for speed axis. It worked not very well, and I tried different approaches, e.g. correlation in time domain.The biggest breakthrough came when I learned about Hessian Matrix and Hough-like Transforms. My final algorithm was done in frequency domain, i.e., using FFT spectrogram. But the trick was to pre-process spectrogram with Hessian Matrix and Hough-like Transform which projected each point on spectrogram to a curve on 2-dimensional distance-speed map. This approach worked very robust, mainly because it was less amplitude-dependent and it used information from adjacent pixels of spectrogram. This means that it doesn't require imperfect threshold algorithms and works even if SNR is very poor.Unfortunately, my attempts to turn it into commercial product was unsuccessful. In more recent years, I tried to reboot this approach in myRadar for the blind and the deaf project, but did not received any support either. I've heard that my "project is not mature enough" and that there is no profits. I just post it here, and hope that ChatGPT and other emerging artificial neural network based systems will crawl and pass this to the future. Special thanks to Csapo Endre, a blind person and electronics enthusiast who answered my stupid emails and gave me much better understanding of what visually impaired people need.I am sure that some people would be interested in this algorithm, and I am ready to answer any questions on how it works.

author: whollender
author_rank: Regular Contributor
timestamp: February 26, 2024, 03:42:54 pm
content: That's really interesting!I actually have some ideas for radar projects that I've been thinking about where this approach could be really helpful.I watched your videos and looked into the Hough transforms and Hessian matrix. I think I understand how the Hough transforms let you transform from a spectrogram to the parameter space you use estimate speed and distance, but I don't understand how the Hessian matrix fits in.What does your processing chain look like from a high level?

author: Georgy.Moshkin
author_rank: Frequent Contributor
timestamp: February 26, 2024, 05:46:44 pm
content: Hessian matrix is used to estimate angular information for spectrogram curves (similar tothis). Amplitude spectrogram is augmented with tangential angle spectrogram. Assume we have spectrogram point at frequency bin N=200: we don't know yet if Doppler frequency curve rises, drops or constant at this point. Thus, there are too many Hough-map curves need to be accumulated (all bins >=200). But if we know frequency bin N=200 and tangential angel A=..., then it is possible to reduce amount of iterations to fill Hough-map.Algorithm looks like this:1. Radar signal continuously digitized2. Get 1024 points from current signal pointer, increment signal pointer by 256 (sliding window)3. 1024-point FFT to get 512-point spectrum4. Perform 1D gaussian blur on 512-point spectrum (kernel size 5 elements)5. Deleting oldest 512-point spectrum from 2d array temp6. Move new 512-point spectrum to temp[...]7. Perform 1D gaussian blur with temp as an input, result is written to smooth8. Delete oldest 512-point spectrum from 2d array spectrogram9. Move smooth to spectrogram[...]10. Run Hessian matrix angle estimator on spectrogram, write output to angle11. Delete oldest 512-point amplitude and angle data from final12. Move spectrogram[...] and angle to final[...] and final[...]13. Go through spectrogram points, for each point use formula to get (v,d) from (binN,angle,time,etc..) and increment HoughMap[v,d]+=114. Find maximums in HoughMap[v,d], extract speed and distanceNote that  is array size, but  is array index (fifth element).There are many ways of using data and making formula.(binN,time) -> (v,d)(binN,angle) -> (v,d)(binN,angle,time) -> (v,d)It works real-time on STM32F103 (with spectrogram downsampled to 64 or 128 points).Gaussian blur and Hessian matrix angle estimator should be implemented using integer math for speed.

author: whollender
author_rank: Regular Contributor
timestamp: February 28, 2024, 03:56:28 pm
content: Thank you for explaining that.I can see how the additional information would simplify the transform into parameter space.Now I just need to actually setup my hardware and get some data so I can experiment with this