extracting a curve (signal) from the noise? - Page 1
Forum section: electronics / general

author: JBeale
author_rank: Frequent Contributor
timestamp: June 04, 2019, 02:38:16 am
content: This may be a purely software question, but I don't know of a better place to ask it than here. It is somewhat electronics-related, given that the input data is a spectrogram coming from an ultracheap 24 GHz doppler radar (CDM324, about $6 on ebay). In this case the signal is from two cars, both around 25 mph, passing by in opposite directions. The more vertical part of the curve splits into two parts due to separate returns from the front and rear wheels, when the car passes by and the radar sees it nearly side-on.Is there any algorithm to take as input an image such as the noisy frame at top, and extract the smooth curves shown in green and blue color at the bottom, so I can extract some measurements of the curve position and shape? I could do this easily by eye, but I'm puzzled how to construct an algorithm to do it. I know the signal should be a curving "L" shape with the longer stem pointing either forwards or backwards, as in these two somewhat overlapping examples.I think what I'm doing in my head is starting with the more visible "elbow" part of the curve, and then following the curve left or right as it gets fainter, expecting it to bend or change direction only gradually. I suppose that is what a Kalman filter does in some sense(?)

author: JBeale
author_rank: Frequent Contributor
timestamp: June 08, 2019, 05:58:46 am
content: In case of interest, here's a longer example with 15 minutes of data. This spectrogram is the more colorful one generated by "SOX" by default. It starts with the thin streaks which are cars going around 25 mph more or less, then the large, slow garbage truck stopping at each house. The big smudge along bottom right is a sudden burst of rain. I guess it's no surprise doppler radar is good for seeing rain. I'm powering it from 5V but I have 60 Hz AC power running out to the device in the yard and you can see some 60 Hz pickup as a horizontal line near the bottom edge. This becomes stronger, and a 180 Hz 3rd harmonic shows up after the ground and cables get wet from the brief rain shower.

author: David Hess
author_rank: Super Contributor
timestamp: June 08, 2019, 05:29:40 pm
content: Histograms of the input data can be processed to find the points along the curves.

author: SparkyFX
author_rank: Frequent Contributor
timestamp: June 08, 2019, 06:46:09 pm
content: Sound like a case for noise removal and edge detection.You could play with imagemagick and check how their code works.

author: JBeale
author_rank: Frequent Contributor
timestamp: June 09, 2019, 04:41:54 am
content: I played around with some basic noise reduction and edge finding, but found at least my simple attempts did not compare with what I could easily do by eye.In case anyone's interested, it turns out that "ridge detection" on a 2D greyscale image is a fruitful search term for this class of problems. The math is pretty involved, but the scikit-image library has a convenient implementation, and it does significantly better than my other attempts in approaching the result I was looking for.https://stackoverflow.com/questions/48727914/how-to-use-ridge-detection-filter-in-opencv