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

Similar Messages

  • 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

  • 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

    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?

  • 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

  • QUERY FOR FINDING SECOND HIGEST SALARY IN EACH DEPARTMENT...?

    Hi ,
    if anyone know query..please mail to my id ...[email protected]

    Hi,
    (a) Use the analytic DENSE_RANK function (or ROW_NUMBER, depending on how you want to treat ties) to number every row, showing how each one ranks within its deparment.
    (b) Then choose the ones that were assigned 2 as their rank.
    Step (a) will have to be done in a sub-query and step (b) in the main query, since analytic functions are computed after the WHERE-clause is done.

  • Where can I find a 17" desktop anti-glare filter for my iMac?

    I checked a couple of sites that sell anti-glare filters. I'm trying to find one to fit my widescreen 17" iMac, however, both sites charged exorbitant prices, one $80, another $100. I remember ten years ago I was able to buy an anti-glare filter for my old Windows PC, but for some reason, neither the Apple Store, nor Best Buy sell them today. I need one because for the second time in two years, I had to get new glasses as the glare from my iMac is hurting my eyesight.

    As I said, I don't think the result from putting a filter over the glass will be satisfactory, regardless of cost.
    You may want to find an external matte screen digital (DVI) LCD that you find comfortable to look at, and connect it to your iMac as a second display. Then set System Preferences Displays pane so that it is your primary display (with the menu bar and dock on it). Put that display in front of you, with the iMac off the right as the secondary display. You can still use it (as you desktop extension); hopefully the "glare" will be less of a problem if you are not staring at it constantly. You can go up to 1920x1200 resolution for an external digital display, which is a typical 23 or 24-inch (measured diagonally) widescreen LCD display. I use my iMac that way, with an external display (that I really like) as my primary display and the iMac to the right as the secondary display. Note: It's to the right because putting it to the left blocks the optical drive.
    Alternately, if the iMac is in good shape, you can sell it and put the proceeds toward a new Mac mini, and get a display that is comfortable for you.

  • Recording AVI for 30 seconds with compression filter

    Hi there,
    It seems to me that I have a problem. The problem contains to film a movie for 30 seconds with 30 fps. Without compression filter everything goes quite right. But with a compression filter the record time is a disaster.
    If I read this page http://digital.ni.com/public.nsf/allkb/0A4D5BF47FD3FF0186256E9A004FD671 it's quite obvious to me what the problem is: The average write time.
    After reading this I adjust the frame rate. So the play time (when you play the avi) and the the recorded time (time that you actually filmed) are the same. But I believe this is not the right solution.
    Could anyone help me with this problem?
    I use Labview 2009 with Vision Acquisition
    Thank you in advance

    Hi there,
    When you use a compression filter, your PC have to process every frame that you acquire.
    Depending on your image size, image type (color or mono) and your CPU performance, you will increase time needed between each acquired frame.
    Try different codec. But keep in mind that some only work on color images and some on mono images or both.
    You will find a VI that list all the codec installed on your computer.
    The frame rate you mentionned when you create an AVI is only an indication for the playback. It doesn't help.
    Hope this helps

  • My Ipod Touch will only search for available Wifi networks for a second then stop, and it will never find any networks anywhere.

    OK I own the 1st generation Ipod touch and granted I bought it used and its pretty old, but the Wifi doesnt work at all. When I click on the checkmark box it turns on and it looks like its trying to find a connection, but it only tries for one second (literally) and then stops trying to look for a connection. It wont bring up any connection to choose from no matter where I go, it wont find one connection. Please help me this thing is driving me insane. I was told it could be a bad IP address, and that there is a way to get a new one. But How? I already reset it and restored it and nothing seems to fix it. So now I dont know what to do with it now.

    So you also rebooted your router correct?  Does the iPod still connect okay to other networks? 
    B-rock

  • The sound effects volume is all the way down. It pops on for a second, then disappears. I can't find it in settings.   How do I get the sound back?

    The sound effects volume is all the way down.  It pops up for a second once in awhile and then disappears. I can't find it in the Setting.  Music sound plays fine, but no sound on my apps.  Any idea how to fix it?

    If you lose sounds for keyboard clicks, games or other apps, email notifications and other notifications, system sounds have been muted.
    System sounds can be muted and controlled two different ways. The screen lock rotation can be controlled in the same manner as well.
    Settings>General>Use Side Switch to: Mute System sounds. If this option is selected, the switch on the side of the iPad above the volume rocker will mute system sounds.
    If you choose Lock Screen Rotation, then the switch locks the screen. If the screen is locked, you will see a lock icon in the upper right corner next to the battery indicator gauge.
    If you have the side switch set to lock screen rotation then the system sound control is in the task bar. Double tap the home button and in the task bar at the bottom, swipe all the way to the right. The speaker icon is all the way to the left. Tap on it and system sounds will return.
    If you have the side switch set to mute system sounds, then the screen lock rotation can be accessed via the task bar in the same manner as described above.
    This support article from Apple explains how the side switch works.
    http://support.apple.com/kb/HT4085

  • I am using apple iPod-suffle model and I am unable to upload music into iPod and 3 lights(green,orange and red) keeps blinking for few seconds when I connect my iPod to my PC and after few seconds its turn to unresponce mode,Plz help to find out solution

    I am using apple iPod-suffle model,I am unable to upload music into iPod and 3 lights(green,orange and red) keeps blinking for few seconds when I connect my iPod to my PC and after few seconds its turn to unresponce mode,Plz help to find out solution.

    Try:                                               
    - iOS: Not responding or does not turn on           
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try another cable       
    - Try on another computer                                                       
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
      Apple Retail Store - Genius Bar

  • Is there a FIND search filter for SHARED folders?

    I believe Archiving will only archive the users emails not any messages displayed in a shared folder.
    But when I do a FIND search by date, I still see all those messages from shared folders that other users own.
    Is there a FIND search filter for SHARED folders?
    Further is there a way to differentiate or filter in a FIND search for shared folders that only I own, or shared folders that are owned by other people?

    condor wrote:
    > The Archiving process knows not to move messages from folders that are owned
    > by other people. How does it know?
    The archiving process isn't "allowed" to move messages from folders that are
    owned by others. This is a different matter altogether. Archiving systems
    typically use either IMAP or SOAP for their access, and cannot access folders
    shared by other users (Nexic Discovery is different in this if you use the API
    version of it, because it can see shared folders, and will archive if you
    request it).
    You are comparing apples and oranges unfortunately, and the client was built to
    be able to manage shared folders unlike the archiving program.
    As Michael says, you can choose to not "look in" shared folders if you do not
    want them to show up in a find results.
    Danita
    Novell Knowledge Partner
    Moving GroupWise to Linux?
    http://www.caledonia.net/gwmove.html

  • Where can I find OIL PAINT filter for CC 2014?

    Does anyone know if there's a downloadable OIL PAINT filter for Photoshop CC2014 since they took away that filter from the 2014 version? Is there a way to get the filter without going back to the previous version?

    It was removed, you can only use it in the previous version: Photoshop: Spring Cleaning | PHOTOSHOP.COM BLOG

  • How do you filter for photos with develop adjustments?

    I wanted to put this information out there, because it was difficult for me to find an answer to the question of "how do you quickly filter for photos that have develop adjustments?"
    Some earlier posts in this forum observe that a smart collection has the ability to filter files wherein "has adjustments" is "true." Yes, it can do that. And it can also add in a "date" parameter for more specific targeting. But it cannot simply say, "in the current folder," or "in the selected folder." And frankly, that's the exact situation when I need to filter down to the files I want: I'm in a folder—typically the current folder that I've just imported—and I've done a smattering of develop adjustments. Now, I want to quickly select just those images for export. Can't be done, not with a Smart Collection, anyway.
    But Lightroom is nothing if not deep, and if you approach the problem from a filtering standpoint, it will eventually get you there—but the solution is very non-obvious. Expose the filter bar, with your favorite preset: camera info, default columns... it doesn't really matter. Hover over the header bar and to the far right will become visible the "add column" widget. Add a column. From the pop-up menu on the name will come a long list of options, the second-to-last of which is "develop preset." Once that's in place, click on "custom." Save your current settings as a new preset and give it a descriptive name like "adjusted images."
    Now, when you're in your current—or any—folder, just click on "metadata" in the filter bar, and your custom preset will be in effect: any images that you've worked on will be selected. It's a fast, one-click selection.
    If there's another way of doing this (keep in mind it's for the selected or current folder only), let me know. It's such a seemingly desirable action that I'm kind of astounded there's no built-in or easy or obvious way to do it... or that no photographer has requested it.

    I am honored to have a response from Rikk "MVP" Flohr, and I do readily agree that your approach is one way to approach the issue. It puts the relevant images in a discrete area that is easy to access. However (this is where I look a gift horse in the mouth) I find "sorts" a bit underwhelming in comparison to "filtering." Two problems: first, the sort still does not 'clear your deck' of unwanted images. You still have to squint at the badges and carefully select the range at the top (or bottom). Mistakes can be made (and I would be the first to make them). Second, the sort command is "sticky," meaning that folder will always have that sort unless you undo it. In general, I think most photographers want to see a folder's images sorted by capture time, so they can easily glance to the beginning, middle, and end of the shoot. With my method, once you click out of the folder, the filter is taken away and you're back to normal.
    I do understand that Lightroom wants me to flag my images with rankings or stars or colors or dancing beavers or what-have-you. But in this particular situation, that's an extra step. If I've applied development adjustments, it's already done. Why shouldn't I be able to choose "Select Developed Photos" from the Edit menu, right under "Select Flagged Photos"?

  • Cascade Filter for Hierarchy dimension

    Hi experts, I try to develop a design Studio Dashboard with BW DS. I would like to create a cascade filter for the same dimension but in different levels from hierarchy. First filter would have upper level node of the dimension that will filter same dimension but in lower level values. First selector has manually added Items corresponding the Hierarchy nodes from Level 2. I didn't find how to get specific level of dimension node with function getMemberList(). I created a DS with Level 2 of hierarchy but when I get the values with DS.getMemberList("ZREP", MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, "ALL")) I get all final values from last level node. There is a way to get specific values from hierarchy level with getMemberList() ? Once I get all list values from a level on REP_SELECTOR on click on the selector has the following script: DS_1.setFilter("ZREP", REP_SELECTOR.getSelectedValue()); SHOP_SELECTOR.setItems(DS_1.getMemberList("ZREP", MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, "ALL")); Unfortunately shop_selector is showing all values from ZREP without any previous filter. Do you know what is wrong on it? Thank you very much

    Hi Oscar,
    So let me explain a solution that will hopefully meet your needs.  A couple of comments before we begin.  Since you need to cascade through a hierarchy, for your first list selector it is not possible to use the standard Dropdown Box or List Box components because as you know, these must be populated with the getMemberList() method and this method does not return the hierarchy structure but only the member values (excluding hierarchy nodes).  So my proposed solution relies on using a CrossTab component as a selection list.  The benefit of this approach is that the hierarchy structure is preserved.
    The application layout is as follows:
    This example assumes that the selection in the first filter list populates (cascades) the second filter list and the second filter list selection filters the chart.  The first filter list selection does not also filter the chart but this functionality can easily be added if necessary.
    The steps are as follows:
    1.  The hierarchy has been set up as per your example, with a topmost root node and one level of text nodes below that.  The final level is represented by characteristics.  A screenshot is shown below:
    2.  Define two global script variables to represent the key value of the root node of the hierarchy as well as the standard member selection value for all members, as shown below:
    3.  Add 3 data sources to the application, all based on the same BEx Query, which includes the dimension (characteristic) that has the hierarchy, as shown below:
    4.  Add two CrossTab components and one Chart component as shown above.
    5.  Activate the hierarchy for the first data source DS_1 and set the default level to 2 as shown below:
    6.  Activate the hierarchy for the second data source DS_2 and set the default level to 2 as shown below:
    7.  Set the default members of the second data source DS_2 to represent the first level 1 group in the hierarchy as shown below.  This is required to ensure that the second list is populated with a default selection on startup.
    7.  Define the initial view of the third data source DS_3 in accordance with the requirements of the chart, as follows:
    8.  Assign data source DS_1 to the first CrossTab, assign data source DS_2 to the second CrossTab and assign the third data source DS_3 to the Chart.
    9.  Define the script for the On Select event of the first CrossTab as shown below.  The purpose of this script is to populate the second CrossTab based on the selection in the first one to cascade the filter.  Note that a selection of the root node is excluded to prevent duplication of the first level of the hierarchy in the second CrossTab list.
    10.  Define the script for the On Select event of the second CrossTab as shown below to filter the chart based on the selection:
    And that's it!  Let me know if this gets us closer to what you're looking for.  We can then refine the approach as needed.
    Regards,
    Mustafa.

Maybe you are looking for

  • Center an Iframe in a page

    Dear sirs I'd like to center an Iframe in a page. this is my examole IFrame code: <iframe src="bla.htm" name="MyFrame" width="250" height="400" align="center" id="MyFrame">This message is only visible to older browsers. Replace this with meaningful c

  • HT201210 how i can restore my iPhone which is in the recovery mode?

    i am also not know. i need for yours help to i restore my iphone.

  • Creating a single pdf from multiple pdfs - linking to original pdfs

    I have been asked to create a PDF document from other, smaller PDFs. The individual PDFs, which I am using to create the larger PDF, are maintained on a shared network drive. I am using Acrobat Pro XI and dragging the files onto the thumbnail navigat

  • Cisco camera and SB monitoring software compatibility

    Hi all, We are currently looking into Dome Day/Night Outdoor security cameras and the small business ones may not fit our needs.  I have done some research and found CIVS-IPC-2630V.  Would this camera be compatible with the small business monitoring

  • Garage Band 2.0.2 to 3

    I bought my G4 in December 05, and it came without iLife. It did come with Garage Band 2.0.2 I am interested in starting a podcast, and it looks fairly easy to do with 3.0.4 Did I miss an update, or do I need to get iLife? Can I just get Garage Band?