# Can I get more information from this signal other than magnitude?

First a bit of background. I'm working on a metal detector that produces a pulse across a coil. The pulse signal is influenced if metal is present within the coil aperture.This link provides more information on Pulse Induction Metal Detectors. The ideal signal looks like this: Detection of metal relies on back EMF and the signal recovers after a pulse. I'm working on a design that removes all aspects of the signal except for this "recovery curve" aspect. In MATLAB there is a clear definition between the recovery curve when there is metal and no metal: At the moment I am calculating the average of the entire "recovery curve" over a number of curves (reading in 50 curves and then calculating the average of each point in the curve) to create an average representative curve and then turning the curve in to just a single number i.e. the average single value of 50 curves. Here is a number of recovery curves of 4 different metal pieces. And here is when I calculate the average of 50 for each metal piece to create one representative curve: I am then turning the curve into a number and if it exceeds a set threshold then metal is considered present. Effectively I am turning the average of 50 curves into a single magnitude and then comparing it with a no metal reference value.

While this works, I feel like a better comparison can be made. I want to be able to generate a profile of what a no metal present "recovery curve" looks like and then compare subsequent curves to my reference curve. At the moment I am just using single magnitudes and a comparator to my reference curve. Are there any other techniques I can use to make a more detailed comparison?

Because the shape of the curve changes, i.e. the intial slope can be steeper, the knee of the signal can become rounder etc. is there any kind of technique or filter that I can use to more accurately profile the shape of the curve and compare the shapes rather just the average magnitude? I'm a complete newbie in regards to DSP so If I can be given some direction it would be appreciated.

thanks.

• Do you have full control over the excitation / acquisition curve? Is it possible that the metal / coil would move considerably between 1 of those 50 acquisitions?
– A_A
Jan 4 at 17:20
• It is possible that impulse noise or further electrical noise would be superimposed over the signal but this would also be present on the no metal reference curve. Metal (passes through the coils on a conveyor belt) would be present within the coil for hundreds of these recovery curves (Pulse is 5khz, i.e. 200us period with a D.C. of 25%). I'm attempting to look at the change in the trend over a period of dozens or hundreds of these recovery curves. I'm struggling to come up with any ideas of how I can incorporate the curve shape to make a comparison. Simple magnitude comparison seems a waste Jan 4 at 18:41
• I would measure the amount of time between the pulse and a specific reference voltage being exceeded. This could be done very simply with a comparator and a timer. Any amount of time exceeding the reference would indicate some metal.
– IanJ
Jan 5 at 1:15
• @IanJ while I am currently doing something similar (not over a single curve, but calculating the mean of a number of curves and then comparing the magnitude to my reference) I want to know if there is potentially any benefitting in taking the entire profile of the curve and comparing various characterisitics. I want to move away from a simple magnitude threshold. Jan 5 at 12:38
• I don't think the shape of the curve is very important. It should just be dependent on the current impedance of the coil.
– IanJ
Jan 5 at 21:31

There's a lot of answers -- look at what's different between the metal and no-metal case, and try to make some signal processing that'll do the best job of differentiating between them.

Something that I suspect that will work well would be to start a clock as soon as the pulse goes negative (possibly according to the transmitter timing, if that will be reliable). Capture the height of the peak, then integrate the area of the whole response over time. That peak to area ratio should be very indicative of the presence of metal.

My gut feel is that the ratio of the peak to the integral of the overall response should be more indicative than the actual value of the integral -- but if the pulses are repetitive enough, just that integral may be enough. If you want to go down that road, be sure to try to detect every different thing you may be concerned with, at every different range.

It may be more reliable to capture the peak by integrating for a short time, and comparing that number to the integral of a longer time span.

Continuing in this direction, if you were to integrate the pulse over time and look at the shape of the resulting integrated pulse it should be very indicative of what's going on. Once again my gut feel is that you want to look at ratios -- I'd normalize the integrated pulse to its final value. The points at which it reaches 1/4, 1/2, 3/4, etc., of its final value should be very telling.

• Hi TimWescott, I think that's a really good idea. I can do this in MATLAB by using the curve fitting tool (it's a double exponential according to MATLAB) to generate the function from the dataset and then integrate the function. Perhaps this should be asked as a separate question, but I'm wonder if it is possible to get the curve function without a curve fit as my solution is intended to eventually be implemented on a (powerful) microcontroller. Jan 8 at 12:55

Because the shape of the curve changes, i.e. the intial slope can be steeper, the knee of the signal can become rounder etc. is there any kind of technique or filter that I can use to more accurately profile the shape of the curve and compare the shapes rather just the average magnitude?

The general way to do this would be to treat the curve as a vector and then assess its distance from a reference vector (or more).

This is very close to how nearest neighbour classification works.

You will need to acquire $$N$$ curves for outcome "Metal" and $$N$$ curves for outcome "No-Metal" (or "Other-Detectable-Metal"). These are $$N$$ "column" vectors (so $$K \times 1$$ where $$K$$ is the length of the signal). You then derive the two separate means (or "centroids") and this gives you two reference signals. Given a third signal (a new measurement not encountered in the signals that make up the centroids), you simply take its distance to the two centroids and base the decision of what is in-front of the detector by taking the outcome that belongs to the nearest reference signal.

In fact, you will most likely have to use something like a nearest neighbour classifier to account for variation between curve profiles that belong to the same outcome. It would be useful to have a feature like this in case you wanted to calibrate the detector to work in a specific set of conditions.

Note here however that the rate at which the curve decays is a function of the amount of metal, its orientation and distance to the coil, external fields and (if applicable) to the relative speed between coil and target (if they are moving). The coil will respond with this standard curve anyway which will be "modulated" by these factors. So, yes, you can obtain a bit more information from the time evolution of the curve but you will have to be clear about what exactly you are after and how this phenomenon affects what you are measuring.

Hope this helps.