Signal Conditioning

cancel
Showing results for 
Search instead for 
Did you mean: 

Savitzky-golay filter

Hi, I am doing a pulse oximeter project and need to do smoothing a signal that comes from the photo detector of the oximeter. For smoothing purpose I have taken raw signals from piezo plate as a trial.Now I am getting an output signal  and smotthing it using Savitzky-Golay filter. But smoothened outptut misses some data such as amplitude value goes down in a chart in comparing witht the original noisy data. When I try to increse the polynomial order in VI, smoothened signal somewhat look like as original data at peak points. My question is how to find a correct co-efficient for savitzky-golay filters. If any in depth information for understanding this behaviour of this filter is available, those are mostly welcomed? For details I have attached an image.

Best Regards,
Dhans 😉
Kudos are welcome 😉
Aspirant Labview Programmer (Labview 14) 😉
0 Kudos
Message 1 of 11
(5,013 Views)

Your raw signal looks saturated .. Maybe add a voltage divider or increase the range of the DAQ.

 

Post your code and a not saturated signal (if you have it in your diagram , right click , data operations, make current value default  and save)

 

The wikipages aren't that bad ...

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 2 of 11
(4,983 Views)

Hi Henrik, 

  I am not using DAQ instead using Arduino UNO + Piezo electric plate for raw signal generation. When I press the plate it will generate electrical signal that is the data you have seen in the image as raw signal and I process that signal to smooth it using  savitzky golay filter. Here I have attached my code. Take a look.

Best Regards,
Dhans 😉
Kudos are welcome 😉
Aspirant Labview Programmer (Labview 14) 😉
0 Kudos
Message 3 of 11
(4,967 Views)

Sorry, I still stuck with LV2012...

 

but again: looking at your raw signal in the picture: The 5V flat line indicate that your sensor output saturated the input range of 5V.  Beside of the saturation, the signal doesn't look noisy. What do you want to eliminate, why you need additional filtering?  What do you want to do with the signal?

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 4 of 11
(4,959 Views)

Hi Dhans,

I never heard about SGF, I just went through LV help. I believe that degree of polynomial and side points need to be selected according to the signal being fed.

Filtering generally affect the amplitude level of the signal.

However, why don't you consider zero phase filtering for this application?

You may try the attached example. 

0 Kudos
Message 5 of 11
(4,955 Views)

Haristhota,

Wikipedia article is a good start.

Another source I found very nice is: (Warning, math involved!! :D)

http://www.holoborodko.com/pavel/numerical-methods/

The big benefit of the SG filter is, that the amplitude is less affected than in other filters. Doesn't matter in this case since the peak is cut during sampling anyway , and we don't know what the thread starter actually need 😉

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 6 of 11
(4,951 Views)

Hi Henrik,

Thanks for the reply. I made you confused. The Raw signal I generated in the graph is by pressing piezo plate. So whenever you keep maximum pressure then the signal will be kept in high level say 5V in the chart which means  I can make noisy signal by constantly changing the input pressure I have been giving to the plate. The snap i have attached here is fall in the category of saturation state. That's all. 

Best Regards,
Dhans 😉
Kudos are welcome 😉
Aspirant Labview Programmer (Labview 14) 😉
0 Kudos
Message 7 of 11
(4,942 Views)

Volkers,

If the signal needs to be denoised/smoothened, I use wavelet denoising. Of course, the SGF is also equally performing.

Anything special in SGF? apart from denoising?

 

Dhans,

Can you share the details of your  PE plate?

 

 

0 Kudos
Message 8 of 11
(4,934 Views)

It's easy to make derivates if you have a polynome .. I use it to get noise robust acceleration from distance measurements.

 

Spoiler
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 9 of 11
(4,927 Views)

Dhans,

 

in your first post you wrote, you want to filter photodetector signals... than it's piezo signals...

 

Sorry, my crystall-ball needs a recalibration, it's still not clear to me what you want to do with what kind of signal.

 

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 10 of 11
(4,921 Views)