DSPRelated.com
Forums

How to recognize the signal?

Started by LVitya September 11, 2013
I have a signal from sensor. It look like upper part of this pictures
http://postimg.org/image/l51neenup/
http://postimg.org/image/ddkxfujpd/

I need to recognize two oposite forms of signal: 1) when it goes up then
down; 2) when it goes down then up. For example
http://postimg.org/image/vxuhwk611/
On this picture 1st forms are marked, 2nd is unmarked.

I tried to use cross-correlation (xcorr in Matlab). The 2nd (reference)
signal for correlation looks like
http://postimg.org/image/8pq93yzyr/
It has 2nd form.
The results are presented on the lower part of pictures. It is useful in
most cases. But sometimes it is wrong. For example
http://postimg.org/image/f1kg2px7r/
On this waveform marked place have 2nd form, same as reference. So positive
value of correlation must be higner than negative. But it is not.

Does anyone have any suggestion how to make algoritm that always work
correct? It can be something different than correlation or maybe improvment
of this.

	 

_____________________________		
Posted through www.DSPRelated.com
LVitya wrote:
> I have a signal from sensor. It look like upper part of this pictures > [snip]
I think you should give a hint as to signal source. Your plot reminds me somewhat of signal inside servo amp of a malfunctioning dual beam UV or Visible spectrometer from 50 years ago.
>LVitya wrote: >> I have a signal from sensor. It look like upper part of this pictures >> [snip] > >I think you should give a hint as to signal source. >Your plot reminds me somewhat of signal inside servo amp of a >malfunctioning dual beam UV or Visible spectrometer from 50 years >ago. >
The source of the signal is infrared sensor. First it comes into analog filter, then gains in PGA and digitizes by ADC. _____________________________ Posted through www.DSPRelated.com
On Wednesday, September 11, 2013 8:16:54 AM UTC-4, LVitya wrote:
> I have a signal from sensor. It look like upper part of this pictures > > http://postimg.org/image/l51neenup/ > > http://postimg.org/image/ddkxfujpd/ > > > > I need to recognize two oposite forms of signal: 1) when it goes up then > > down; 2) when it goes down then up. For example > > http://postimg.org/image/vxuhwk611/ > > On this picture 1st forms are marked, 2nd is unmarked. > > > > I tried to use cross-correlation (xcorr in Matlab). The 2nd (reference) > > signal for correlation looks like > > http://postimg.org/image/8pq93yzyr/ > > It has 2nd form. > > The results are presented on the lower part of pictures. It is useful in > > most cases. But sometimes it is wrong. For example > > http://postimg.org/image/f1kg2px7r/ > > On this waveform marked place have 2nd form, same as reference. So positive > > value of correlation must be higner than negative. But it is not. > > > > Does anyone have any suggestion how to make algoritm that always work > > correct? It can be something different than correlation or maybe improvment > > of this. > > > > > > > > _____________________________ > > Posted through www.DSPRelated.com
Have you tried finding the slope for a bunch of points along the graph and then seeing if you have more "ups" than "downs" or vice versa? Finding the slope is pretty easy via slope filtering. IHTH, Clay
On Wed, 11 Sep 2013 07:16:54 -0500, LVitya wrote:

> I have a signal from sensor. It look like upper part of this pictures > http://postimg.org/image/l51neenup/ > http://postimg.org/image/ddkxfujpd/ > > I need to recognize two oposite forms of signal: 1) when it goes up then > down; 2) when it goes down then up. For example > http://postimg.org/image/vxuhwk611/ > On this picture 1st forms are marked, 2nd is unmarked. > > I tried to use cross-correlation (xcorr in Matlab). The 2nd (reference) > signal for correlation looks like http://postimg.org/image/8pq93yzyr/ > It has 2nd form. > The results are presented on the lower part of pictures. It is useful in > most cases. But sometimes it is wrong. For example > http://postimg.org/image/f1kg2px7r/ > On this waveform marked place have 2nd form, same as reference. So > positive value of correlation must be higner than negative. But it is > not. > > Does anyone have any suggestion how to make algoritm that always work > correct? It can be something different than correlation or maybe > improvment of this.
Try low-passing it, with a filter that has a time constant between 20 and 100 counts (or whatever you're using for your x-axis in your third picture). That may help -- or, maybe not. An alternative, if the timing of a peak is always about the same, is to capture three points, and look for "zero-ish, high, zero-ish". Remember that whatever you're doing, you're trying to find something unique about the desired signal that lets you distinguish it from noise. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
On Thursday, September 12, 2013 12:16:54 AM UTC+12, LVitya wrote:
> I have a signal from sensor. It look like upper part of this pictures > > http://postimg.org/image/l51neenup/ > > http://postimg.org/image/ddkxfujpd/ > > > > I need to recognize two oposite forms of signal: 1) when it goes up then > > down; 2) when it goes down then up. For example > > http://postimg.org/image/vxuhwk611/ > > On this picture 1st forms are marked, 2nd is unmarked. > > > > I tried to use cross-correlation (xcorr in Matlab). The 2nd (reference) > > signal for correlation looks like > > http://postimg.org/image/8pq93yzyr/ > > It has 2nd form. > > The results are presented on the lower part of pictures. It is useful in > > most cases. But sometimes it is wrong. For example > > http://postimg.org/image/f1kg2px7r/ > > On this waveform marked place have 2nd form, same as reference. So positive > > value of correlation must be higner than negative. But it is not. > > > > Does anyone have any suggestion how to make algoritm that always work > > correct? It can be something different than correlation or maybe improvment > > of this. > > > > > > > > _____________________________ > > Posted through www.DSPRelated.com
If I see a signal like that I normally think something is faulty!
LVitya wrote:
>> LVitya wrote: >>> I have a signal from sensor. It look like upper part of this pictures >>> [snip] >> >> I think you should give a hint as to signal source. >> Your plot reminds me somewhat of signal inside servo amp of a >> malfunctioning dual beam UV or Visible spectrometer from 50 years >> ago. >> > > The source of the signal is infrared sensor. First it comes into analog > filter, then gains in PGA and digitizes by ADC. >
But what is sensor sensing? To paraphrase an old saying "the leaves on the trees are obscuring the forest".
>> The source of the signal is infrared sensor. First it comes into analog >> filter, then gains in PGA and digitizes by ADC. >> > >But what is sensor sensing? >To paraphrase an old saying "the leaves on the trees are >obscuring the forest". >
Sensor senses direction of human movement. _____________________________ Posted through www.DSPRelated.com
On Wednesday, September 11, 2013 11:21:17 AM UTC-4, LVitya wrote:
> >LVitya wrote: > > >> I have a signal from sensor. It look like upper part of this pictures > > >> [snip] > > > > > >I think you should give a hint as to signal source. > > >Your plot reminds me somewhat of signal inside servo amp of a > > >malfunctioning dual beam UV or Visible spectrometer from 50 years > > >ago. > > > > > > > The source of the signal is infrared sensor. First it comes into analog > > filter, then gains in PGA and digitizes by ADC. > > > > _____________________________ > > Posted through www.DSPRelated.com
Run your signal through a slope filter See: http://www.claysturner.com/dsp/FIR_Regression.pdf Eqn 8 gives you the coefs for your filter. IHTH, Clay
>Run your signal through a slope filter > >See: > >http://www.claysturner.com/dsp/FIR_Regression.pdf > >Eqn 8 gives you the coefs for your filter. > >IHTH, > >Clay > >
I will try to do it in Matlab. But first I need to understand how to do it. I'm not familiar with slope filtering. _____________________________ Posted through www.DSPRelated.com