LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Savinsky-Golay ptbypt.vi in labVIEW 7

Hi
 
I am having a problem with the Savinsky-Golay ptbypt vi in labView 7.  It does not  appear to smooth data as expected. 
 
I attach an example vi I am put together which demonstrates the problem.  The data is reversed in sign, greatly reduced in amplitude and is not smoothed at all. 
 
I have used this filter in Microcal Origin and found it to work very well on my data.  The LabVIEW vi requests the same input paramers i.e. smooth window nR=(-nL)and ploynomial order.  I can only think there is a bug in the vi.  Has anybody elce encountered this problem?
 
Many thanks
 
Ash
0 Kudos
Message 1 of 4
(2,696 Views)
Hi Ashley,

you initialize the filter on each data point, just remove the true constant. The VI itself will do the initilization (with a firstcall? node)
Then the data looks good.

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 4
(2,692 Views)

Hi Ton

Removing the true constant does indeed ensure the data is smoothed.

However I am seeing a phase shift proportional to the width of the filter window which moves the position of my peak.  When I run the same S-G filter in Microcal Origin this phase shift does not occur.

Is there something elce I have missed?

Many thanks

Ash

 

 

0 Kudos
Message 3 of 4
(2,689 Views)
Needed to edit the array to remove phase shift.
 
(Could oversample to compensate for data  points lost)
 
See vi attached.
 
Works nicely.
 
Ash
 
 
0 Kudos
Message 4 of 4
(2,665 Views)