Savitzky golay filter

I was searching for a VI a week ago (for which I thank the respondents). Monday I was at a LabView seminar and noticed that the 6.1 version of LabView loaded on the NI laptop had a Savitzky-Golay filter included. I have 2 emails into NI for confirmation that this filter is indeed included in the full version of LabView 6.1 but have not received a reply. Can anyone out there with the full version of 6.1 confirm that this filter is included (otherwise it must be part of some other additional package). I plan to upgrade to 6.1, just trying to find out if I should look for the other package too. Many thanks.

Thanks for the reply. The problem was that I had not updated to version
6.1. I was using 6.0. It is not included with 6.0.
Thanks again.
"iainhp" wrote in message
news:[email protected]..
> Well it ain't obvious, that's for sure.
>
> 1. In the "diagram" window click on "Window" then "Show Functions
> Palette".
>
> 2. On the palette that pops up click on the large magniying glass at
> the top.
>
> 3. On the index line type "savitzky" and that should bring up the
> filter. Double click on that and that opens a graphic. You want to
> select the one at the bottome right (it should tell you what it is
> when you move the mouse cursor over it).
>
> Well hidden, Ehhh?

Similar Messages

  • Point by Point p-th order derivative using Savitzky Golay filter coefficien​ts

    I am trying to implement a Point by Point p-th order derivative using Savitzky Golay filter coefficients.  The  point by point available in LV doesn't use the Differential Filter coefficients.  I tried converting it so it could but it didn't differentiate for me, it just gave hte original signal (probably smoothed).  Refer to my attachment.  So I then took a look at another method partly documented in the NI help file.
    In prior posts Damien (DFGray) has described the Savitzky Golay derivative filter as"essentially a convolution filter".    The latest LV help file example shows this by using the dot product to calculate the p'th order derivative using such a filter.  So my plan now is to convert that NI help example below (from here) into a point by point version (sorry no LV code existed that I could find, just a pic).  Before I try this out, will this work with just one shift register or do I need a shift register history that is 2k+1 deep ?
    thanks
    Peter Badcock
    Product Development
    ResMed Ltd.
    Attachments:
    Savitzky Golay Differentiator PtByPt.vi ‏21 KB

    I replied a tad too soon.  I discovered that the amplitude output from the derivative had been scaled down by (100/2xPI) for some reason I don't understand, so I updated both the test harness and the point by point vi and attached them.
    I added a sine wave input for one test signal and my example volume input (without the glitches I'm trying to remove though) for another test signal.  Both derivative outputs show discontinuities at the input as expected,  additionally each are delayed by the number of Side Points (currently constants on the BD)
    BTW, thanks for adding in the dx/dt text into the icon, I was going to but was too lazy !!
    Peter Badcock
    Product Development
    ResMed Ltd.
    Attachments:
    TestSVDerivPntByPnt.vi ‏42 KB
    Savitzky Golay Differentiator PtByPt.vi ‏21 KB

  • Savitzky golay filter start plotting above zero

    Hi,
    Im using a savitzky golay filter to filter data that starts at 930 mmHg. But when I plot the output of the filter on an XY graph, the plot starts from zero and moves up to 930. How do I configure the VI to start plotting the Savizky Golay filter output at 930?
    Thanks and regards.

    I can't see anything wrong with your implementation of the SG filter (except that you should consider using the "Savitzky Golay Filter PtByPt.vi" which is intended for this kind of real-time use), but I wonder if SG is the best for your application.  The velocity you get from your VI is an estimate of the velocity at the middle of your 2k+1 data-point array (ie. k intervals in the past), rather than the best estimate of velocity at the time of most recent reading.  With very noisy data you will have to use quite a large value of k to get a meaningful value, and thus will be controlling your vehicle with outdated velocity values.  You might be better off with a filter that is designed to provide an estimate of current velocity, such as an exponentially-weighted moving average.
    -- James

  • Savitzky golay filter for finding second derivative

    Hello friends,
     I want to find second derivative using Savitzky golay filter for the data as shown in image.
    Three different spacings are used.
    Region AB and EF= ∆f1
    Region  BC and DE=∆f2
    Region  CD=∆f3
    Can some one help me to understand to to decide side points and polynomial order for my input data.?
    Thanks in advance.

    The polynomial order must be at least one larger than the highest derivative. So a third order polynomial is required for a second deriviative. In general it is better to keep the polynomial order as low as possible while getting a good fit to the data.
    The number of side points is somewhat arbitrary and depends on how much smoothing is needed. Often some experimentation and judgement is required.
    Have you considered resampling the data to create a new dataset with uniform sampling throughout? That might be easier than trying to match derivatives at the transition points.There are several resampling VIs available.
    How many data points do you have in each segment?
    Lynn

  • Implementing Savitzky-Golay Filter on the fly

    Hi;
    In my controller implementation for a remotely-operated undrerwater vehicle for an academic research,  I am trying to implement Savitzky-Golay filter to take the derivative of fairly noisy position data coming from a depth sensor(see the example graph of data coming in) in order to obtain the velocities ON THE FLY. To do that, first, I initiliaze an array of size 2k+1, and then each time depth data double value arrives, I am deleting the zero-indexed element from this array and put the new data point to the end of the array to move the data window for the Savitzk-Golay block. The final array is carried over to the next iteration through the shift register.
    However, when I implement this filter,  I am obtaining positive velocity values when I expect negative values or vice versa. Given this, I am wondering if  there is anyone out there who could be kind enough to tell me if I am using the Savitzky-Golay derivatives correctly. Also is my method to move the data window correct?  I attached the picture of the LabVIEW code that does the on the fy filtering.
    Kind Regards, 
    Attachments:
    Savitzky-Golan Derivatives2.jpg ‏56 KB
    PD_DEPTH.jpg ‏96 KB

    I can't see anything wrong with your implementation of the SG filter (except that you should consider using the "Savitzky Golay Filter PtByPt.vi" which is intended for this kind of real-time use), but I wonder if SG is the best for your application.  The velocity you get from your VI is an estimate of the velocity at the middle of your 2k+1 data-point array (ie. k intervals in the past), rather than the best estimate of velocity at the time of most recent reading.  With very noisy data you will have to use quite a large value of k to get a meaningful value, and thus will be controlling your vehicle with outdated velocity values.  You might be better off with a filter that is designed to provide an estimate of current velocity, such as an exponentially-weighted moving average.
    -- James

  • Savitzky filter: problem writing to file

    Hi,
    I have a very weird problem. I m using a Savitzky Golay filter to smooth some data and I can see the correct filtered data on the graph on the front panel. Now, I want to write this filtered data to a file. So I wired the output of the SG filter to a spreadsheet file. On replotting the file, I notice that the graph that I obtain is identical to the input that I gave to the filter. I have attached some screenshots of the front panels and the replotted graph.
    Figure one: Is the input to the SG filter
    Figure two: Is the output of the SG filter.
    Figure three: Is the waveform that I obtained from replotting the output that I wrote to a file.
    Figure four: Is the SG filter and write to file VI screenshot.
    Can someone please help me out. Its driving me crazy.
    Thanks and regards.
    Attachments:
    sgfilter_writetofile.doc ‏314 KB

    You index the output-array of the filter VI before you save it to file. So on the frontpanel you see the whole waveform, but you save only the first value to the file. Another evidendence for this is the messed up x-Axis (time) in the data loaded from your file. The data you see in the file is neither the data before, nor the data after the filter function. You see only the first value of each measurement. YOu have to put a for-loop arround your save to spreadsheet, or better would be to not index the array at all and write the whole array to file. You can use probes to see what I mean.
    Hope this helps!
    Andre

  • Butterworth filter is not filtering data properly

    Hello,
    I am trying to use a low-level Butterworth filter to filter some data.  I am sampling the data at 100 samples per second so I have been using this as the sampling frequency.  I have also initialized the filter so that it will theoretically work continuously.  After playing around with different cut off levels, to no success, I wanted to see if my data was simply passing through the filter correctly... which it isn't.  I have read related postings on "High Pass Filter Settings [NEW]" and I am thinking that my sample rate is not passing correctly to my filter.
    Does anyone have any idea why this would be the case... or how to fix my problem.  Eventually I would like to differentiate this data...
    I've included my LabView VI (the filter is in the first while loop).  I am using LabView 7.1 with PC-CARD DAS16/16AO
    Thanks
    Jenna
    Attachments:
    ALL CHANNELS AND AOUT - instantaneous voltage change.vi ‏249 KB

    Hi Lynn,
    The purpose of my LabView program is to read in a variable sine wave (which represents a swinging leg), measure the torque, position and angles over time and be able to adjust a motor on the fly.  My purpose in filtering is to allow for a smoothly differentiated signal.  If I differentiate without a filter… my signal is a mess.  The nominal waveshape is a sine wave and the frequencies and magnitudes of the signal vary with each trial.   Generally though, the frequency of the signal is 1.5 Hz or less.  The peak to peak amplitude for the analog out channel from an optical encoder (which measures the leg angle) is approximately 70 degrees (1.94V).  It is necessary to have the differentiated and filtered “angular velocity” in sync with the other channels to know the effect of the change in the motor speed at different points in the cycle.  I will be analyzing this data mainly after it has been collected, so the precision on the charts while it is running is not too important.
    I’ve tried modifying my VI so that you will be able to see it, but since my signal is continuous “making the current values default” freezes my VI at one point in time... so my simplified VI doesn’t run as the more complete one did.
    I have also briefly looked into a Savitzky Golay filter that differentiates and filters simultaneously, but I haven’t had much luck getting it to work.
    Any suggestions?
    Thanks
    Jenna

  • Differentiating an analog signal.

    Hello Guys,
    Please I am having issue differentiating an analog signal.The signal output from the time domain math function(dx/dt) fluctuates indiscriminately.My sampling rate is 10k and samples to read is 10k.Please i need help in resolving this issue.Thanks.
    Attachments:
    force measurement.vi ‏330 KB

    Would have been best if you had saved the vi with data in the graph , but I think I know what problems you have.
    Take a look at the Savitzky-Golay filter, that filter actually does a fit and can do a differentiantion more robust to noise. (Use the advanced FIR SG coeff vi and the help .... more theorie here)
    Some of your problems might also come from filterartifacs, so capture some more data and cut the ends to avoid that.
    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 ǝɥʇ'

  • Stepped signal analysis

    how to count the number of steps(red signal on graph) on the diagram below?
    number of steps should be counted in the rising and falling signal and make a comparison between them.
    how this can be done?
    Attachments:
    diag.jpg ‏55 KB

    There are probably lots of ways.  Your diagram has a hint for one of them.  Here are a couple of options:
    Use a Savitzky-Golay filter to take the derivative of the waveform.  You will end up with a bunch of peaks and valleys.  Find the peaks with a peak finder and count them.  You can figure out up/down by looking at the area between the peaks and get an average level or by looking at the direction of the peaks (up is up, down is down).  You data is fairly noisy, so you will have to experiment with how wide you want the S-G filter to be and how much averaging you want to do between the peaks.
    Use a single cycle square wave as a convolution filter and run it.  The end result will be similar to the Savitzky-Golay filter and can be analyzed the same way.  This is probably easier and faster on some targets, such as an FPGA.
    Good luck.  Let us know if you need more help.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • Resonance peaks in frequency vs. amplitude spectrum

    Hello all,
    I am struggling to find a way to analyze some data.  My data is frequency vs. amplitude spectrum plot.  There are resonance peaks in the spectrum.  When the data is clean I use peak detection to measure the frequency spacing of the peaks (the FSR).  When the peaks either have very low contrast, or are noisy, the peak detection doesn't work well.  I am thinking that I should be able to use one of the math functions like an FFT, but I haven't a clue as to which function to use or how.  Any help is greatly appreciated.
    Jim
    Jim
    LV 2013

    Noisy data is always difficult to deal with, even for experts, but don't let that stop you.  Your analysis technique will vary depending upon how much information you have at the beginning.  However, trying to remove noise before analysis is somewhat dangerous.  The noise removal can often distort or remove data you want.  Instead, analyse the basic data with techniques which tend to "ignore" the noise.  Some examples are in order.
    If you know the approximate locations of your peaks, some sort of non-linear fit to a subset of the data for each peak would probably work.  This assumes you know the peak shape and can model it.  The noisier your data, the more robust your fit will need to be.  A Levenberg-Marquardt is fast and easy, but a downhill simplex is more reliable.
    If you know exactly what the peaks will look like, and their exact location when they are there, a singular-value decomposition is fast and efficient and fairly noise immune.
    If you have no clue where the peaks are, but have some idea of their width, try a Savitzky-Golay first derivative filter with a convolution width set by the known width of the peaks.  This will screen out the high frequency noise and give you a zero crossing for every peak and valley in your data.  You can tell which is which by the direction they cross zero.
    Without some data, we can't help you much more.  Since you are new to this, I would highly recommend Numerical Recipes in C by Press et. al.  You will want the second edition (the first does not have Savitzky-Golay algorithms in it).  It gives a very clear explanation of most of the common numerical algorithms and why you would want to use them.  Most of the algorithms are already implemented in LabVIEW.  The building blocks are there for the rest (e.g. matrix multiply and invert, downhill simplex optimization).  Check your local university library.  Most have it.  I have even found it in municipal libraries.
    Good luck.  Let us know if you have further questions.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • I am trying to get rid of spikes of noise in a sinusoidal signal...

    See attached picture (a snipet of the signal) to see what I am talking about.
    I would like to get the index of the maximum and minimum points for every second, but these random spikes are interfering with the measurement.
    I tried using the median filter vi with ranks of 5 for right and left (I tried values from 1-10, and 5 worked the best), but this has caused problems with the index calculation (the index is higher than it should be based on the graph).
    Any ideas on a different filter I should be using? Or am I making an error with the median filter vi?
    Attachments:
    signal with noise.JPG ‏57 KB

    Okay, Lynn, you made me look it up.
    For a low pass filter (analog), the phase shift is:
    , where w is the filter center frequency and w(0) is the signal frequency (can't do omegas here, I guess).
    So, for a 50 Hz filter on a 1 Hz signal (pretty much what the picture shows), the phase shift is 1.14 degrees or 3.18 milliseconds, whatever number of data points that comes out to in the sampling rate Laura121 is using.
    I thought about a Savitsky-Golay filter, but it looked like the amount of calculating it would take would not be worth any possible advantages. YMMV.
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ

  • Averaging with ni scope

    I am using a NI-PXI-5124 and am trying to take a running average of a signal.  I would like the running average to be independent of the while loop I am using to do all the signal analysis. I tried using the example provided by ni "moving average" but this is dependent upon the operating speed of the while loop. I found a way that i think might work but need a conformation. Attached is a picture of a method i thought might work, but i need to know if the NI Scope Read cluster.vi continuously reads a signal into memory. I am running the for loop inside of my main while loop.
    Thanks
    Mark Mutton
    Electrical Engineer
    Attachments:
    Avg.JPG ‏21 KB

    You probably want some way to move waveforms efficiently from one loop to another.  The tutorial Managing Large Data Sets in LabVIEW should give you some ideas you can use.  You can then analyze your data in one loop and average in another.  You may want to use the decimation algorithms in the tutorial to speed things up for display.
    Another thing to watch out for is that simply averaging your waveforms as you are doing will tend to smear you data over a one sample time width.  This is because the trigger position is more or less randomly distributed in time between two samples.  If this is OK, you can continue as you are.  If not, you can get the exact trigger position from the wfm info cluster of the cluster fetch or the t0 value in the waveform of the waveform fetch, provided you set the timestamp type to relative.  You can then use the resample VIs to shift your waveform in time a subsample amount before doing your averaging.  If your version of LabVIEW does not have the resample VIs, you can use Fourier transforms or Savitzky-Golay filters to do this fairly quickly and easily.  Both techniques are explained in the latest copy of Numerical Recipes in C, by Press et. al.
    Good luck.  Let us know if you need more help.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • In the filter scheme driver, how to i get the filename in open() or handleOpen ()

    I want to implement filter scheme driver to monitor and prevent file open or read calls based on certain rules. For this I would need file name, user name and application process name. I did not find a way to extract this information. Any hint would be of great help.

    If the reset doe not work, connect tot he comouter and try to restore via iTunes.
    If the logo is still showing, let the battery fully drain. After charging for an hour, try the reset and restore again.

  • AND/OR + some nulls in filter

    I'm running into another problem with the AND/OR filter.
    The filter for selecting from object "a" and joining to objects b, c & d
    is:
    (b.theid==2 || c.theid==2 || d.theid==3) && active=="Y"
    The SQL that gets generated is:
    SELECT <...>
    FROM b t1, d t3, a t0, c t2
    WHERE ((((t1.theid = 2 AND t0.bid = t1.id) OR (t2.theid = 2 AND t0.cid
    = t2.id)) OR (t3.theid = 3 AND t0.did = t3.id)) AND t0.active = 'Y')
    This returns a number of instances of the same a object when some of the
    OR clauses do not match. For example, if there's no record
    with d.theid=3, then it will do a full join on table d.
    Do I need to specify something else to flag these as potentially null
    fields so that the filter parser adds that check in? The following SQL
    query works
    ok if I add some checks for NULL on those join fields:
    SELECT <...>
    FROM b t1, d t3, a t0, c t2
    WHERE ((((t1.theid = 2 AND t0.bid = t1.id OR t0.bid IS NULL) OR
    (t2.theid = 2 AND t0.cid = t2.id OR t0.cid IS NULL)) OR (t3.theid = 3
    AND t0.did = t3.id OR t0.did IS NULL)) AND t0.active = 'Y')
    Thanks,
    -Mike
    Mike Bridge

    Hi D,
    Thank you for your answer.
    I have seriously thought about that solution; but I don't think it's a smart way to do it.
    If i do it like that, i need to copy the whole table and paste it inside the if statements.
    I have two xml elements that I need to make the decisions on. POH_PO_TYPE & CP_RELEASE_NUM.
    POH_PO_TYPE can be: STANDARD, RELEASE or BLANKET.
    CP_RELEASE_NUM can be: '' or N
    If POH_PO_TYPE is RELEASE AND CP_RELEASE_NUM is not ''
    OR POH_PO_TYPE is STANDARD
    OR POH_PO_TYPE is BLANKET AND CP_RELEASE_NUM is ''
    THEN show table (which contains the whole PO).
    It shall show the content of the PO in any of these cases.
    BR Kenneth

  • Jabber Windows - no phone control with LDAP Custom filter

    I am unable to control the desktop phone from the Jabber 9.1 Windows client when the CallManager LDAP Directory uses a Custom Filter.
    Has anyone else experienced this?
    If I set the LDAP Custom Filter to <none> and save, then Desktop Phone control works great.
    If I set it to use my custom filter, then trying to enable Desktop control just gives me the spinning circle, then times out to the Red X symbol.
    I do not need to resync the LDAP Directory to get the error, just enable/disable the custom filter and save.
    In both cases calling from the Computer works great.
    This is an On-Prem deployment with full MS-AD LDAP integration.
    Versions are:
    Jabber - 9.1.0 build 12296
    CUPC - 8.6.4.11900-1
    CUCM - 8.6.2.22900-9
    I upgraded to CUCM 8.6.2 SU2 last night hoping that would fix the problem, but no luck.
    The LDAP filter is one I have used in numerous other clusters with no CTI issues.
    It allows me to sync to the root directory, but only import active user accounts with an entry in the ipPhone AD attribute:
    (&((objectclass=user)(ipPhone=*))(!(objectclass=Computer))(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))
    Thanks, Randy

    Hi Randy,
    Have you specified this base filter in jabber-config.xml file? As per Admin Guide:
    "In some cases, base filters do not return query results if you specify a closing bracket in your Cisco Jabber for Windows  configuration file. For example, this issue might occur if you specify  the following base filter: (&(memberOf=CN=UCFilterGroup,OU=DN))
    To resolve this issue, remove the closing bracket; for example, (&(memberOf=CN=UCFilterGroup,OU=DN)"
    Thanks,
    Maqsood

Maybe you are looking for