How to resample unequally spaced data in Array form?

I have an array of unequally spaced time data and corresponding signal data taken at these times.
I would like to resample the signal data to be equally spaced in time (constant dt).
How do I introduce the time data into the signal, then resample?
I have tried the "Align and Resample" express vi using constant dt resample and reference signal resample, both with my time signal as the reference and with a constantly spaced array as the reference (none worked).
I have tried to create a waveform using the data, but it seems waveform type assumes constant dt.  There is a waveform to XY Pairs vi, but not one for going the other way.
I have tried to build a 2D array and convert to DDT, but it seems DDT assumes 2D array as multiple channels.
How can I resample unequally spaced data?  I'm sure there is a simple answer that I am missing.
I am attaching a simple vi to illustrate my point.
Thank you.
Laine
Attachments:
Laine_resample.vi ‏244 KB

Hi Sarci1,
thank you for the reply! I have already tried the Align and Resample Express VI, tweaked it and everything but it doesnt seem to carry out the functionality I really need. 
Wiring a true value to the Resample Waveforms (single shot).vi input seems to help getting rid of the trailing zeros at the end of the array, although it did make the final resampled array smaller in size too, so now I have the same problem again (I wanted the resampled array to be of fixed length, but now its smaller by a couple of elements). However, this method might work, if I simply chop off those zeros, plus I reduce the size of the other array with which I want to compare the interpoalted one (even if this means losing a tiny bit of information this might be the only working option I seem to have right now, to properly interpolate an array to a cahnging size). Unfortunately I still have some other issues with my task; to summarize my problem I describe it in a different way now:
the orginal task is to compare to 'graphical signals', two spirals; one is a template, a perfect spiral genereted previously by a different program, the other is a hand-drwan figure
(these are different in size: the template is a fixed-size array, but
the hand-drawn array is completely random sized). To make matter worse,
the problem is that this hand-drawn array of X,Y points is that they are
not sampled equally in time. I have a timestamp for each, but they are
not equally spaced. My goal is to somehow make it possible to compare
these two signals first coordinate-wise, then in a polar system and
eventuially in the frequency domain.
My approach right now is to somehow interpolate the timestamp vector
first, and then resample/interpolate the X and Y vectors of the
hand-drawn figure to the same size as the previously interpolated time
vector. this way I could get an equally spaced time/X/Y set of vectors
of a certain length. Then I should interpolate the template signal to
the size of the previously interpolated set of vectors of the hand-drawn
figure so I could compare the two signal at the same positions in time
and frequency.
Unfortuanetly I've still haven't solved the first part, where I want
to create the equally spaced time/X/Y vectors, so if anyone has any
suggestions please share it here!
Thank you again for your continuous help!
Attila

Similar Messages

  • How do I enter a data to B1 form via windows form?

    I'm trying to add the data from a windows form, to the SAP B1 form (e.g. Sales order), now i'm just trying 1 component only which is the CustCode.
    I've been thinking about this but i can't figure it out like how's the structure of the class I should create...
    In my VBproj (VS_2005), i have a simple form (just "TextBox1" and "Button1"), then I have a class "appending.vb":
    Option Strict Off
    Option Explicit On
    Public Class appending
        Public oItem As SAPbouiCOM.Item
        Public oTextbox As SAPbouiCOM.EditText
        Private WithEvents SBO_Application As SAPbouiCOM.Application
        Private Sub SetApplication()
            Dim SboGuiApi As New SAPbouiCOM.SboGuiApi
            Dim sConnectionString As String
            sConnectionString = Environment.GetCommandLineArgs.GetValue(1)
            SboGuiApi.Connect(sConnectionString)
            SBO_Application = SboGuiApi.GetApplication()
        End Sub
        Public Sub New()
            MyBase.New()
            SetApplication()
        End Sub
    End Class
    and also Form1.vb class:
    Public Class Form1
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim oappend As New appending
            If oappend.oitem.UniqueID = 4 Then
                oappend.oitem.String = TextBox1.Text
            End If
        End Sub
    End Class
    Note that unique ID 4 is because i searched in the system information (CtrlSfihtD) that the customerID in the sales order form has the Item = 4, which is the unique ID, but this property is readonly prop, so that I can't directly instruct to append the data from textbox1 to the item where unique ID is 4 (..UniqueID = 4..)
    I know my code just wont work at all, but i'm really have no more idea about this....
    critics, comment and idea please...
    Thanks,
    Martin

    Dear Martin,
    I think String property is on EditText object not Item object.
    Please use Item.Specific to get the coresponding EditText and then set String.
    Regards,
    Jay.

  • How do I submit xml data from a form to live cycle

    Hi
    This is my first post, so I'm not sure if this is the right forum.
    I have a flex app, which calls a pdf. You enter the info on the pdf and then click submit. Now I need to know what i have to do to submit the information (not via email)to a live cycle process and which live cycle process I must submit it to?
    I'm assuming I must using some sort of servlet to submit the info?
    Any help would be greatly appreciated.
    Thanks
    Ross

    Hello Ross,
    Yes, you need a servlet that gets the submitted info from PDF, and then that servlet internally need to invoke your process.
    There are couple of ways you can submit the data to your servlet, either as PDF/XML/XDP. If you are looking for submitting PDF/XDP, then one need to have either Acrobat S.W (Standard or Professional) or you need to apply ReaderExtensions on those PDFs.
    Hope I answered your questions.
    Regards
    Sivajee

  • How do I change the date format in Forms Central from mm/dd/yyy to dd/mm/yyy?

    I'm using Forms Central on a Mac and need to convert the US date format to the one used in Australia ie from mm/dd/yyyy to dd/mm/yyyy. I've tried Field properties and can't see any other options. Is there a quick fix somewhere?

    This is covered in the free documentation provided by Adobe for Acrobat JavaScript.
    Acrobat JavaScript documentation
    Use date objects
    Convert the date string to the date object, then use the util.printd method to reformat the date object as needed.

  • How do you calculate a date on a form?

    I am working on a form for our customers and our staff to use and I needfor it to calculate a date from another date. We are currently using an Excel spreadsheet that is working very well, but we are starting to run into customers who do not have access to Excel. Having the form in Adobe would give us more flexibility.
    Here is an example of exactly what I need:
    Last Read Date: 01/01/00
    Approximate Due Date_1: 01/26/00  (this is the Last Read Date + 26 days)
    Approximate Due Date_2: 02/26/00  (this is the Last Read Date + 56 days)
    Approximate Due Date_3: 03/26/00  (this is the Last Read Date + 85 days)
    Thank you

    Check out this previous topic: http://forums.adobe.com/thread/836872

  • Pass the data from a form in workflow to z table

    Hi all,
    How can I pass the data from a form in workflow to z table?

    Thanks for your answer, I tried the solution 2, I create "Submit" button, and ser the mapping scope to  be "All data rows", it only works when I select at least one row, otherwise the data would not be passed.
    Another question is I have serveral imported table parameter, for each table I have one "submit" event, I want these tables to be submitted at the same time, but if I click the submit button in one table toolbar, I can only submit the table data which has a submit button clicked, for other tables, the data is not passed, how can I achieve it?
    Thanks.

  • Date fromat in Forms 5.0

    Hi !!
    Can anyone guide me as to how do I insert the data through the
    forms 5.0 to oracle data base in the dd-mon-yyyy hh24:mi:ss
    format.
    The problem is that I need to pass the value of the sysdate to
    the last_update_date form variable in the pre-insert trigger.
    Now when the form variable accepts the value, it only accepts in
    the dd-mon-yyyy format, although the format mask specified for
    this variable is DD-MON-YYYY HH24:MI:SS only.
    I tried to do a work around in a way of selecting the value in
    a local variable using to_char and in the required format
    like this (this does give the required details of hrs, min,
    secs):
    SELECT TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS') INTO
    lv_date_var FROM dual;
    and then passing this value as the to_date to the form variable.
    like this:
    :xx.date_last_modified := TO_DATE(lv_date_var,'DD-MON-YYYY
    HH24:MI:SS');
    But still it is accepting as dd-mon-yyyy only. And when I view
    the value through the form it shows 00:00:00 in the time format.
    Any suggestion is welcome,
    Shobhit
    null

    Hi Shobhit,
    Check whether the field data type which holds the date value is
    of type datetime. I think it won't be. If it is not change it to
    datetime and the problem will get solved. Let me know if it gets
    resolved.
    Regards,
    Srini.
    George Salloum (guest) wrote:
    : Dear Shobhit Kumar
    : Try changing nls_date_format in init.ora file.
    : regards
    : george salloum
    : Shobhit Kumar (guest) wrote:
    : : Hi !!
    : : Can anyone guide me as to how do I insert the data through
    the
    : : forms 5.0 to oracle data base in the dd-mon-yyyy hh24:mi:ss
    : : format.
    : : The problem is that I need to pass the value of the sysdate
    : to
    : : the last_update_date form variable in the pre-insert trigger.
    : : Now when the form variable accepts the value, it only accepts
    : in
    : : the dd-mon-yyyy format, although the format mask specified
    for
    : : this variable is DD-MON-YYYY HH24:MI:SS only.
    : : I tried to do a work around in a way of selecting the value
    : in
    : : a local variable using to_char and in the required format
    : : like this (this does give the required details of hrs, min,
    : : secs):
    : : SELECT TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS') INTO
    : : lv_date_var FROM dual;
    : : and then passing this value as the to_date to the form
    : variable.
    : : like this:
    : : :xx.date_last_modified := TO_DATE(lv_date_var,'DD-MON-YYYY
    : : HH24:MI:SS');
    : : But still it is accepting as dd-mon-yyyy only. And when I
    : view
    : : the value through the form it shows 00:00:00 in the time
    : format.
    : : Any suggestion is welcome,
    : : Shobhit
    null

  • How do I convert a 1-D array of cluster of 5 elements into a 2-D array of numbers? (history data from a chart)

    Hello,
    in my vi I have a chart with 5 Plots displaying measurement data.
    The user should be able to save all the history data from the chart at anytime. (e.g. the user watches the chart and some event happens, then he presses a "save"-button)
    I know, that I can read out the history data with a property node. That is not the problem. The problem is, how do I handle the data? The type of the history data is a 1-D array of cluster of 5 elements.
    I have to convert that data somehow into a 2 D-array of numbers or strings, so that I can easily save it in a text-file.
    How do I convert a 1-D array of cluster of 5 elements into a 2-D array of numbers?
    I use LabVIEW 7.1
    Johannes
    Greetings Johannes
    Using LabVIEW 7.1 and 2009 recently
    Solved!
    Go to Solution.

    Gerd,
    thank you for the quick response and the easy solution.
    Look what I did in the meantime. I solved the problem too, but muuuch more complicate :-)
    And I have converted the numbers to strings, so that I can easily write them into a spreasheet file.
    Johannes
    Message Edited by johanneshoer on 04-28-2009 10:39 AM
    Greetings Johannes
    Using LabVIEW 7.1 and 2009 recently
    Attachments:
    SaveChartHistory.JPG ‏57 KB
    SaveChartHistory.JPG ‏57 KB

  • How can I display the data in table in separate column?

    I have a vi reading data one by one in the same column.
    How can I display the data with separate column?
    like this:
    data 1 | read | read
    data 2 | read | read
    data 3 | read | read
    (would you mind if I will ask for an example
    because it is much easier for me to work
    with an example)
    THANK YOU.

    If you're reading your data in as a 1D array, this is as simple as using the Reshape Array to make a 2D array. I've attached an example in LabVIEW 6.1 format. The example rearranges a single column of data fill several columns horizontally, but you can easily modify this code to fill the columns downward instead.
    Attachments:
    Data_Column_Example.vi ‏18 KB

  • I want to use Get Panel Image in Labview 5.0.1 and need details on how to save the BMP data generated

    I am trying to generate an application that saves a copy of its front panel on completion. This is easy to do using an invoke node with Print VI to HTML but this does not work in an .exe format. I have seen elsewhere that you have to use the Get Panel Image method, but no details are supplied in LV 5.0.1 documentation of how to use the "image" data (1-D Unsigned Byte array) that is generated. I want to save this in a format that can then be read as a bitmap in any standard graphics package. Any assistance?

    Hi,
    If you'd upgrade to LV5.1 or 6 you could use the 'standard' vi's for this.
    You need a VI called "Write BMP File.vi". It's not shipped with LV5.0.1.
    This vi only uses 3 subVI's, so perhaps someone at NI can convert it and
    send it to you (sorry, I won't, it's copywrited).
    If you cannot get this VI anywhere, you'll need to figure out the BMP file
    format yourself. It's not too complicated, but still could take some days.
    Perhaps someone figured it out before LV5.1 was released.
    Regards,
    Wiebe.
    "RDK" wrote in message
    news:[email protected]..
    > I want to use Get Panel Image in Labview 5.0.1 and need details on how
    > to save the BMP data generated
    >
    > I am trying to generate an application that saves a copy
    of its front
    > panel on completion. This is easy to do using an invoke node with
    > Print VI to HTML but this does not work in an .exe format. I have seen
    > elsewhere that you have to use the Get Panel Image method, but no
    > details are supplied in LV 5.0.1 documentation of how to use the
    > "image" data (1-D Unsigned Byte array) that is generated. I want to
    > save this in a format that can then be read as a bitmap in any
    > standard graphics package. Any assistance?

  • Writing data from array to file

    May i know how to write string from a array into a file.
    I have use string tokenizer to extract every line from a file using readline and use stringtokenizer to spilt the line using tab delimiter for processing.
    But if i want to write data from array to file with tab as a delimiter and how to go to the next line. How do i do that. Below is the task and i have state a simple example on a array i have and the file output that i want.
    Pls advice.. Thanks
    eg of a array
    array[0] = Data
    array[1] = One
    array[2] = Data
    array[3] = Two
    array[4] = Final
    array[5] = Data
    From the above array, i want to write to a file so that it will appear something as below
    Eg textfile.txt
    Data One
    Data Two
    Final Data
    PLs attached a simple code as a example as i am only begining to start useing the IO feature in java. Thanks

    Really thanks for your help,
    but u are mentioning that i have already know the number of countters in advance , that is to say the 2 * counters.
    But is there a way to solve this problem which i mean if i dun know the number of predefined counters. Maybe i should say, there is more than 2 counters and in another situation, the counters will only be defined during runtime. Actually the solution u give will work nicely with 2 counters. but wat if the counter is more than 4, i wll have to concatenate the string a lot of time. so is there any solution around this problem. That why i am wandering if tere is any solution to write to the file when the counters can be only determined in runtime
    Pls advice on the above with a code samples if possible.

  • How do i dynamically add data to a JTabel?

    Hey
    How do i add the data to a JTabel dynamically from a HashMap?
    I tried the following:
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package test;
    import java.util.HashMap;
    import java.util.ArrayList;
    import java.util.Set;
    import javax.swing.JTable;
    * @author Jesper
    public class Players {
        HashMap<String, Stats> players;
        public Players(){
            players = new HashMap<String, Stats>();
            addPlayer();
        public void addPlayer(){
            players.put("Martin ?rnskov", new Stats(19, 3, 1));
            players.put("Thomas Raun", new Stats(23, 6, 0));
            players.put("Jimmy Mayasi", new Stats(26, 26, 3));
            players.put("Lasse J?rgensen", new Stats(33, 0, 0));
        public JTable showPlayers(){
            String[] columnames = {"Spiller", "Kampe", "M?l", "R?de kort"};
            Object[][] data;
            Set<String> key = players.keySet();
            for(String player : key){
               data = {{player, players.get(player).getMatches(), players.get(player).getGoals(), players.get(player).getRedCards()}};          
            final JTable table = new JTable(data, columnames);
            return table;
    but on this line Netbeans says that variable is allready defined:
       data = {{player, players.get(player).getMatches(), players.get(player).getGoals(), players.get(player).getRedCards()}};          
    I can see the problem is this, but when it cant be done this way, how can i do it then?

    Instead of creating the table directly with data values, use a DefaultTableModel whose constructor is very similar. But DefaultTableModel has interesting method as addRow, removeRow... for dynamically handling data (and visually to table).
    Set<String> keys = players.keySet();
    Object[][] data = new Object[keys.size()][columNames.length];
    for(i=0; i<keys.size(); i++) {
       String key = keys.next();
       data[0] = player;
    data[i][[1] = players.get(player).getMatches();
    data[i][[2] = players.get(player).getGoals();
    data[i][[3] = players.get(player).getRedCards();
    DefaultTableModel model = new DefaultTableModel(data, columNames );
    JTable table = new JTable(model);
    Later in your code, as you want to dynamically update the table, work with the model instead of the table to add , remove, change cell values of the table.
    +PS : your code loop is probably wrong. You are setting data variable for each value of the set. I suppose you want to add a row to data array. data is a two dimension array+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Flat File with unequal spacing as delimiter

    I am trying to import multiple flat files with unequal spacing as delimiter in sql server using SSIS 2012, however when I import the file, all the data in the file is imported into only one column. None of the predefined delimiters in SSIS works with the
    way the flat file was configured. I read that I can use the script component in SSIS 2012 to create the additional columns and somehow manipulate the file using the spacing to assign a new delimiter, such as a common, but I can't find any resources on it.
    Anyone have any experience/knowledge of this situation can provide me with an example or some resources that can help me to solve this situation?
    Example of file format:
    26   SM FRIES         0      1     0       0.00        0.0
    30   PEPSI               0    22     0       0.00        0.0

    Looks like a fixed width file to me seeing the data posted
    If you can determine the width of the columns then you can use fixed width (or ragged right) option in flat file connection manager and identify the lengths of the individual fields to get values out.
    See this example
    http://gaurangpatel.net/importing-fixed-width-file-into-database-using-ssis-package
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to acces and display datas storaged in cache for a SUP 2.0 workflow?

    HI to all.
    I have an application with a item menu which obtains data thought a online request. the result is shown is a listview.
    My problem is when my BlackBerry has no conection ( offline scenario). When I select the menu item, I obtain an error.
    How to acces and display datas storaged in cache for my MBO? I have read that I can use getMessageValueCollection in custom.js to access to my datas but once I get the datas, How can associate those datas to a Listview like a online request?? Do i have to develop my own screen in html or how?
    Thanks.

    I'm not entirely clear on what you mean by "cache" in this context.  I'm going to assume that what you are really referring to is the contents of the workflow message, so correct me if I'm wrong.  There is, in later releases, the ability to set an device-side request cache time so that if you issue an online request it'll store the results in an on-device cache and if you subsequently reissue the same online request with the same parameter values within that timeout period it'll get the data from the cache rather than going to the server, but my gut instinct is that this is not what you are referring to.
    To access the data in the workflow message, you are correct, you would call getMessageValueCollection().  It will return an object hierarchy with objects defined in WorkflowMessage.js.  Note that if your online request fails, the data won't magically appear in your workflow message.
    To use the data in the workflow message to update a listview, feel free to examine the code in the listview widgets and in API.js.  You can also create a custom listview as follows:
    function customBeforeNavigateForward(screenKey, destScreenKey) {
         // In this example, we only want to replace the listview on the "My Approvals" screen    
         if (destScreenKey == 'My_Approvals'){
              // First, we get the MessageValueCollection that we are currently operating on
              var message = getCurrentMessageValueCollection();
              // Next, we'll get the list MessageValue from that MessageValueCollection
              var itemList = message.getData("LeaveApprovalItem3");
              // Because its a list, the Value of the MessageValue will be an array
              var items = itemList.getValue();
              // Figure out how many items are in the list
              var numOfItems = items.length;
              // Iterate through the results and build our list
              var i = 0;
              var htmlOutput = '<div><ul data-role="listview" data-theme="k" data-filter="true">';
              var firstChar = '';
              while ( i < numOfItems ){
                   // Get the current item. This will be a MessageValueCollection.
                   var currItem= items<i>;
                   // Get the properties of the current item.
                   var owner = currItem.getData("LeaveApprovalItem_owner_attribKey").getValue();
                   var type = currItem.getData("LeaveApprovalItem_itemType_attribKey").getValue();
                   var status = currItem.getData("LeaveApprovalItem_itemStatus_attribKey").getValue();
                   var startDate = currItem.getData("LeaveApprovalItem_startDate_attribKey").getValue();
                   var endDate = currItem.getData("LeaveApprovalItem_endDate_attribKey").getValue();
                   // Format the data in a specific presentation
                   var formatStartDate = Date.parse(startDate).toString('MMM/d/yyyy');
                   var formatEndDate = Date.parse(endDate).toString('MMM/d/yyyy');
                   // Decide which thumbnail image to use
                   var imageToUse = ''
                        if (status == 'Pending'){
                             imageToUse = 'pending.png';
                        else if (status == 'Rejected'){
                             imageToUse = 'rejected.png';
                        else {
                             imageToUse = 'approved.png';
                   // Add a new line to the listview for this item
                   htmlOutput += '<li><a id ="' + currItem.getKey() + '" class="listClick">';
                   htmlOutput += '<img src="./images/' + imageToUse + '" class="ui-li-thumb">';
                   htmlOutput += '<h3 class = "listTitle">' + type;
                   htmlOutput +=  ' ( ' + owner + ' ) ';
                   htmlOutput += '</h3>';
                   htmlOutput += '<p>' + formatStartDate + ' : ' + formatEndDate + '</p>';
                   htmlOutput += '</a></li>';
                   i++;
              htmlOutput += '</ul></div>';
              // Remove the old listview and add in the new one.  Note: this is suboptimal and should be fixed if you want to use it in production.
              $('#My_ApprovalsForm').children().eq(2).hide();
              $('#My_ApprovalsForm').children().eq(1).after(htmlOutput);
              // Add in a handler so that when a line is clicked on, it'll go to the right details screen
              $(".listClick").click(function(){
                   currListDivID = $(this).parent().parent();
                   $(this).parent().parent().addClass("ui-btn-active");
                   navigateForward("Request_Details",  this.id );
                   if (isBlackBerry()) {
                        return;
         // All done.
         return true;

  • How to recive game save data form ipad

    i loss my game save data in my ipad mini 2 , and how to recive games save data
                please help

    Sure you can save arrays also
    var mySo:SharedObject;
    mySo = SharedObject.getLocal("application-name");
    trace("loaded value: " + mySo.data.savedValue + "\n\n");
    var testArray:Array = new Array(1,2,3,4,5,6,7,8);
    saveValue(testArray);
    function saveValue(testArray):void {
        mySo.data.savedValue = testArray;
        var flushStatus:String = null;
        try {
            flushStatus = mySo.flush(10000);
        } catch (error:Error) {
            trace("Error...Could not write SharedObject to disk\n");
        if (flushStatus != null) {
            switch (flushStatus) {
                case SharedObjectFlushStatus.PENDING :
                    trace("Requesting permission to save object...\n");
                    mySo.addEventListener(NetStatusEvent.NET_STATUS, onFlushStatus);
                    break;
                case SharedObjectFlushStatus.FLUSHED :
                    trace("Value flushed to disk.\n");
                    break;
    //to clear the cookie call this function
    //clearValue();
    function clearValue():void {
        trace("Cleared saved value...Reload SWF and the value should be \"undefined\".\n\n");
        delete mySo.data.savedValue;
    function onFlushStatus(event:NetStatusEvent):void {
        trace("User closed permission dialog...\n");
        switch (event.info.code) {
            case "SharedObject.Flush.Success" :
                trace("User granted permission -- value saved.\n");
                break;
            case "SharedObject.Flush.Failed" :
                trace("User denied permission -- value not saved.\n");
                break;
        mySo.removeEventListener(NetStatusEvent.NET_STATUS, onFlushStatus);

Maybe you are looking for