Counting peaks within one minute intervals and outputting with time stamp

I'm currently working on my senior design project for biomedical engineering. We are creating a piezoelectric sensor in order to measure respiration on a bed non-invasively. The sensor lays on bed under subject and records movement due to respiration. We currently have figured out how to detect peaks. However, now we want to count number of peaks detected within a 1 min time period and output that result with a 'timestamp'. We would like the output to be into excel as two columns, rate(number peaks in 1 min) and time. Time in minutes and not actual time is fine. Sampling rate was 500Hz.
My current VI has peak detection criteria and can output total number of peaks and their locations.
Any help would be greatly appreciated as this is our last step before verification and have been stuck on it for awhile. 
It won't allow me to attach a tdms file in which our data is stored as, so I can't upload the data currently.
Also attached is our current VI for peak detection labeled 3.26.Resp.PeakDetect.
Thanks for any and all help!!
Attachments:
3.26.Resp.PeakDetect.vi ‏146 KB

I see no need for a case structure.  Or did you set up a state machine that I missed?
I recommend making a VI that does nothing but read your 30,000 samples and process it (counting the peaks and what not).  From there, you create the array for the number of peaks and the time (in minutes).  Then you can call that VI inside of a loop to build up the array of data points.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • Satellite L20-182: fan doesn't work properly - one minute intervals

    When I turn on the computer about twenty minutes is quiet. Than fan starts like a hurricane, slows down and stops. It lasts few seconds. The fan works in this way regularly with one minute intervals.
    Is there any possibility to switch the fan on continuous work in slow motion?

    Hi.
    I think that your notebook works fine. I have L20-101 which has Pentium M processor and it does the same. Usually after some period when it turns the fan on and off the fan starts to work at one slow speed. If you really want to have quieter machine and you really want that you can change settings in Bios (Thermal mode control - silent or perfomance). In performance mode processor runs at maximum possible speeds when it needs so fan behaves like yours. In silent mode, fan turns only when it really needs and for very short time. I got used to use silent mode when I do something else in the moment than sitting before my computer and I need my laptop as great calculator (MS-Excel, Rm-Win, MS - Word or 2D drawing in AutoCAD). If you need your computer for aplications that doesn't need very fast machine you can use silent mode. If you really need all power then you can switch to performance mode before booting.
    I need performance mode only for watching Divx movies or converting files to PDF format (it is too slow at silent mode to convert 100 pages of text and drawings to PDF for me)
    If you have any other questions that's my mail:
    [email protected]

  • Can we produce a newsletter in one CS4 application and output it to both print and the web?

    Can we produce a newsletter in one CS4 application and output it to both print and the web?
    If so what do you suggest that we use?
    Message was edited by: [email protected]

    A very cautious "yes". It mainly depends on what you expect.
    It has always been possible to just export to PDF and post that on your site. You can also export your ID file as one comprehensive SWF file and immediately put that onto the site -- it comes with a few handy browse functions, snazzy page flipping (when required); and it looks exactly like your ID document.
    Hard-core techies can use the Export To XHTML/DreamWeaver function, but that will only export the very bare bones -- plain text, with just the commands for text formatting in place. You have to re-do layout and styling in HTML code. Bear in mind ID is designed, top to bottom, as a document layout program, and this export is "extra", not really a basic feature.

  • I have two macs in my house.  One is newer and came with the os x mountain lion software and the other one needs to be upgraded.  I was wondering if there is a way to take upgrade from one to the other?  Should not have to buy this software again.

    I have two macs in my house.  One is newer and came with the os x mountain lion software and the other one needs to be upgraded.  I was wondering if there is a way to take upgrade from one to the other?  Should not have to buy this software again.

    Welcome to Apple Support Communities
    Buy it for the other computer. Mountain Lion is preinstalled on the new Mac, but you can only use it in the new one

  • My wife and I had one iCloud account and now with our multiple devices, we want to separate our clouds, how do I do that?

    My wife and I had one iCloud account and now with our multiple devices, we want to separate our clouds, how do I do that?

    As quicksilver8 says, that's difficult.
    See Transferring files from one User Account to another for some suggestions.

  • Digital Output With Timer (Simulation)

    Hello everyone, I just learned how to make LabVIEW program a week ago. I try to make a simulation of Digital Output by LabVIEW (my attachment). In this simulation I have a slider as an input (0-10 V), two numeric control (upper limit and bottom limit), a waveform chart that plot those 3 value, and two boolean LED (P0.0 and P0.1) as an indicator. In this simulation you can fill any number (between 0-10) in the numeric control as a limit for your slider input. If the input from a slider exceed those upper and bottom limit then the boolean LED will turn on, P0.0 if exceed upper limit and P0.1 if exceed bottom limit. The problem is I don't know how to make timer for those boolean LED. As example:
    1) Make an input from slider,
    2) If input (1) exceed the upper limit,P0.0 will turn on for 5 second,then turn of for 10 second,
    3) If in that 10 second you change the input back to normal (between upper and bottom limit) then P0.0 will stay turn of until the input from slider exceed the upper limit again,
    4)If in that 10 second you didn't change the input (stay exceed the upper limit) then P0.0 will repeat the process (2) until you the input from slider back to normal.
    (Same process for input that exceed the bottom limit).
    Can you help me to make this timer? Thank You (I'm sorry I made a double post):newbie
    Regards
    Juventom
    Attachments:
    Digital Output With Timer.vi ‏16 KB

    Hello Juventom,
    As I understand it you want to be continuously checking the value of the sliding bar and comparing that to the upper and lower limit controls whilest also chaning the LED booleans to true for 5 seconds then false for 10 seconds if the sliding bar value is outside of the limits.
    To do this you would probably be best using a parallel loop design, where you have 3 while loops in place of the one you have currently. Each one of these while loops would be responsible for a part of your program (e.g. the top one would display your values on the graph and the second one who check the sliding bar value against the upper limit and then turn on the LED, etc)
    I've found this tutorial about multiple loop programs and I think you should look at the section entitled "Parallel Execution"
    http://zone.ni.com/devzone/cda/tut/p/id/3749
    This way you can use normal delay VIs but when they run they only pause that loop rather than the whole program.
    Please let me know how you get on with this, and ask me if you need further help.
    James W
    Controls Systems Engineer
    STFC

  • Save the file and give date & time stamp

    1. Reading the Excel file from the selection screen as a parameter.
    2. Using F.M. ALSM_EXCEL_TO_INTERNAL_TABLE reading Excel file into
        Internal table.
    3. Implementing the Business Logic.
    4. Move output to Final Internal table.
    5. Final internal table should generate a Flat file. By using GUI_DOWNLOAD.
    6. That flat file should be saved with the name and location given in the Excel.
    7. When ever I run the program output file will generate in the same location but with date and time stamp. Because I’m running the program for range of employees say initially I run for 1 – 10,000 employees next 10,001- 20,000 like that.
    Whenever I run for 2nd time it will overwrite the previous output, that’s the reason I’m using date and time stamp.
    Eg:
    PERSONAL Numbers              Name                                         Location
    00000001                 xxxxx-24.04.2007-10.30          C:\        
    00000002                 xxxxx-24.04.2007-10.35
    00000003                 xxxxx-25.04.2007-10.40
    00000004                                  xxxxx-25.04.2007-10.30
    Can any one help me how to save the file and give date & time stamp through hardcode?
    please help me in this issue.

    I am not clear with your problem. Based on the understanding of your question,
    there  can be two cases.
    1- U want to insert time stamp in the output file.
    2- Time stamp is already there, u just have to solve the overwriting issue.
    If your question goes with option 2, You can make use of import parameters
    <b>CONFIRM_OVERWRITE</b> : Which will ask for confirmation before overwriting.
    <b>APPEND</b> : which you can choose either to append the data to the existing file or overwrite it.
    Please inform if the issue is not resolved.
    Message was edited by:
            BINU RAJ BINU

  • Reading from a .txt and displaying in XY graph with time stamp

    Hi,
    I am a newbie to LAbView. I need to read from a text file having two columns, one carrying the temp value and other the time stamp. I need to plot this in XY graph on a real time basis. Please help as how can I do this..
    I am attaching my files for your reference.
    Thanks in advance
    Ratnesh

    Shidla wrote:
    So what is the question about... I have to use XY graph in my program. It is used in Loop while cycle. It shows the statistic of a variable. I am using cursors in this graph to check the actual value of a variable in different period of time. But there are 7 variables and it is extremely hard for user to check each value independently. So I tried to make them moving on the X axis (TIME) together using the property node (cursors reading the position (only X axis, Y axis status lock to plot) of the major cursor and follow it... Everything looks great? But it did not work when I am trying to move the major cursor manually on graph... It works only when I am using the cursor movement buttons... But they work very slowly when there is a lot of data in graph.
    I want to find out is it possible to make seven coursers mouthing together By the X axe and be Locked each at its plot by Y axe manually (Using mouse moving on a graph). Is it possible? If it is than how to do it?
    Hello Shidla,
    The attached VI should help give you an idea of how to create a VI that allows all cursors to move together. The main idea is to keep track of the current location of all cursors and move all of them when you see a change in one's position.
    Good luck with your development.
    -Matt F
    Keep up to date on the latest PXI news at twitter.com/pxi
    Attachments:
    cursors.vi ‏164 KB

  • In range and coerce on time stamps

    Is there any reason why I shouldn't be able to use in range and coerce on time stamps?  In this VI the value is not being coerced, but the output for in-range is false.  With values out of range, it DOES coerce the output. 
    Jim
    LV 2013
    Solved!
    Go to Solution.

    lmtis wrote:
    What a NOOB mistake!
    Thank you nathand
    LOL The next noob minstake is forgetting to mark the person's post that solved the issue for you as the solution. 
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Problems with Timer, counts 60000 as one minute but need it to be 60

    Hello All.
    I have an application that i have working although i need to change it slightly, the way that it uses a number to be exact,
    It includes a countdown HSlider and timer, and is used as an interview kinda thing.  so the user only gets a small period of pre determined time to make their answer.  It all works fine but i need to change one part of it.
    At the moment the timer works if i feed in the number 60000 as the maximum value,  this equals one minute, but i need to be able to enter 60 instead of 60000.  I need to use seconds rather than miliseconds.
    Here is my code.
                protected function addtoArray():void {   
                    if(userArray.getItemAt(0).q1 != '') questionArray.addItem({question:userArray.getItemAt(0).q1, time:'60000', tt:'2'});
                    if(userArray.getItemAt(0).q2 != '') questionArray.addItem({question:userArray.getItemAt(0).q2, time:'60000', tt:'3'});
                    if(userArray.getItemAt(0).q3 != '') questionArray.addItem({question:userArray.getItemAt(0).q3, time:'30000', tt:'4'});
                    if(userArray.getItemAt(0).q4 != '') questionArray.addItem({question:userArray.getItemAt(0).q4, time:'60000', tt:'2'});
                private function init():void {
                    t = new Timer(1000);
                    t.addEventListener(TimerEvent.TIMER, updateTimer);
                    startInterview();
                private function updateTimer(evt:TimerEvent):void {
                    var d:Date = new Date(getTimer() - baseTimer);
                    counter.text = "Time Remaining - " + dateFormatter.format(d);
                    timerCount = getTimer() -baseTimer;
                    TimerSlider.value = timerCount;
                    if (skip == true)
                        stopTimer();
                        startInterview();
                        skip = false;
                    else if (timerCount >= totaltime)
                        stopTimer();
                        startInterview();
                private function startInterview():void {
                    if(i==0)
                        questionArray.addItem({question:"End"});
                    timeLabel.text = questionArray.getItemAt(i).time;
                    totaltime = parseInt(timeLabel.text);
                    QuestionText.text = questionArray.getItemAt(i).question;
                    ThinkTime = questionArray.getItemAt(i).tt;
                    if (QuestionText.text=="End")
                        QuestionText.text = "Thanks, thats the end";
                    else
                        createComplete();
                        var QcountVar:int = questionArray.length -1;
                        var Qpos:int = i+1;
                        hp.status ="Question: " + Qpos.toString() + " / " + QcountVar.toString();
                        i = i + 1;
    The init function is called by a button click
    If anyone could help me change it so it runs in seconds rather than miliseconds that would be great !
    Thanks in advance

    Multiply the number you type in by 1,000

  • Formatting code and output with Courier font

    Hi,
    I have several problem in inserting code and output for SQL and PL/SQL.
    I.e.:
    If I insert the code below formatting usin Syntax highlight as SQL:
    SELECT empno, sal
      FROM emp
    WHERE sal > ALL (2000, 3000, 4000);
    Is there a way to have Courier as font to retain the correct indentation?
    Another problem. Suppose that I run the query below:
    SELECT *
      FROM emp
    WHERE deptno = 10;
    and I want to paste the output as Courier:
    If I copy and paste the output from SQL Plus:
    EMPNO ENAME 
    JOB         
    MGR HIREDATE    
    SAL  
    COMM
    DEPTNO
    7782 CLARK 
    MANAGER    
    7839 09-JUN-81  
    2450               
    10
    7839 KING  
    PRESIDENT       
    17-NOV-81  
    5000               
    10
    7934 MILLER
    CLERK      
    7782 23-JAN-82  
    1300               
    10
    It is pasted as a table. Even changing the font is not helping to have a good formatted code (note the header not aligned with data columns).
    I can use HTML code to paste it. I.e.:
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
          7839 KING       PRESIDENT            17-NOV-81       5000                    10
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
    But it is taking quite a lot to paste the code.
    Any suggestion?
    Regards.
    Al
    Message was edited by: AlbertoFaenza

    BluShadow wrote:
    Well, I hope they get around to using fixed space fonts on the Syntax Highlighting options, as I quite like the fact it creates line numbers for the code, as that will be useful when discussing issues.
    I agree Blu. The line number is useful. If they only can use a fixed space font would be perfect.
    I also have the problem that randomly my output is pasted as a HTML table and still could not understand why it happens.
    This one i.e.:
    EMPNO ENAME
    JOB        
    MGR HIREDATE   
    SAL 
    COMM
    DEPTNO
    7369 SMITH
    CLERK     
    7902 17-DEC-80  
    800              
    20
    7566 JONES
    MANAGER   
    7839 02-APR-81 
    2975              
    20
    7788 SCOTT
    ANALYST   
    7566 19-APR-87 
    3000              
    20
    7876 ADAMS
    CLERK     
    7788 23-MAY-87 
    1100              
    20
    7902 FORD 
    ANALYST   
    7566 03-DEC-81 
    3000              
    20
    I notice that just adding a blank line as first line solve the issue.Regards.
    Al

  • Continuous in- and output with PCI-6229

    Hi All,
    I'm currently evaluating a PCI-6229 card on RTX (and maybe InTime later on). The main goal of the evaluation is to prove we can get hard real-time, deterministic behaviour from this system in order to use it to replace our current DSP-based solution.
    To do so, I'm setting up a rather simple program that should
    - continuously acquire 1 channel @ 20kHz
    - have a processing loop of 5mSec, ie 100 samples; this loop should be entered every 5mSec as exactly as possible
    - do some simple processing in the loop (thresholding the signal)
    - bring out the result on an analog output (low signal if signal is under threshold, high signal for all samples above the threshold)
    I could get the basics working pretty quickly: continuous input, continous output, continuous input with dma, input using interrupts.
    Trying to combine everything isn't really working out however.. Normally I'd try and try until knowing the device inside-out but now I have a rather strict timeframe so hopefully someone here can provide some insight.
    Questions:
    1. For the input, I can get an SC_TC interrupt each time one frame is scanned. I measured this on a scope by toggling a digital output on the card, and there's no noticable jitter on the squarewave which is a good sign.
    However I'd like to combine this with DMA, but the DMA is lagging a bit on the interrupt so I end up having to poll the DMA after all in the ISR, so there's no use using the interrupt in the first place.
    Is there a way to set up continuous DMA servicing and get an interrupt from the DMA system itself after 100 samples are transferred?
    2. For the output, I cannot get continuous mode working with DMA, only by writing to the FIFO manually. I can preload a couple of frames with the dma, but after calling aoStart(), tDMAChannel::write() works once, but all calls afterwards return kBufferUnderflow. Any ideas?
    I probably have to check when exactly to write to the DMA, but I have no idea which of the many status functions to use. Tried with AO_Status_1.readAO_FIFO_Half_Full_St() but that's not it. tried to write it on each UC_TC interrupt but that didn't work either.
    3. DMA is, to my understanding, a more performant way of getting samples into the host and doesn't require to call AI_FIFO_Data.readRegister() in a loop and vice-versa for the output side. But are there really benefits in using DMA?
    4. I made a basic program to bring everything together the simplest way possible: preload 100 samples in the output FIFO, start analog input, start analog output, have the ISR copy all values directly from input to output FIFO.
    Putting both analog signals on a scope, I expected to see the input and about (see question5) 5mSec later the same signal on the output, with no jitter.
    However what I see is the output is just floating around, in other words there is no fixed delay between output and input! How is this possible? I use the same divisor for in-and output. Is there any sample code available that achieves what I want?
    5. Is there a way to start both input and output at the exact same time, eg at the same edge of a certain clock pulse? How are input and output synchronized? Can I be sure they never go out of sync?
    Solved!
    Go to Solution.

    update: looking at the DAQmx control samples, it seems some of them set the start trigger for the AO to the AI start trigger. I mimicked this using kAO_START1_SelectAI_START_1 with the aoTrigger method, and the sync seems better now: the output starts exactly 10mSec after the input (or 5, if I preload only one frame) and stays in sync for about 25mSec. That it goes wrong.
    At the moment I'm using no DMA, just one simple interrupt routine that basically does
    board->Interrupt_A_Ack.writeAI_SC_TC_Interrupt_Ack( 1 );
    board->Interrupt_A_Ack.flush();
    toggle ^= 1;
    board->Static_Digital_Output.writeRegister( toggle ? 0x00 : 0xff );
    for( u32 i = 0 ; i < numSamples ; ++i )
      const u32 val = board->AI_FIFO_Data.readRegister();
      board->AO_FIFO_Data.writeRegister( val );
    In the screenshot in the attachment you can see this goes wrong: cursor A shows the position of the input signal (=AI 0, yellow) that should be shown 10mSec later at the output (blue line=AO). Cursor B shows this 10mSec later position, and you can see there's some garbage right after the cursor. This is the data that was written to the AO FIFO in the fifth interrupt (interrupt position show in purple).
    Trying to figure out where that comes from, I put board->AI_Status_1.readAI_FIFO_Empty_St() in the interrupt loop. And effectively, when trying to read the 500th sample, it reports that the FIFO is empty. Consequently the data written to the AO FIFO does not make sense anymore. But I do not understand how can this ever happen? The SC_TC interrupt is fired whenever 100 samples are read from the input. So after this interrupt occurs, the FIFO should always contain at least 100 samples, no?
    Attachments:
    tek00000.png ‏22 KB

  • PR-PO material with one material group and GRN with another material group

    Dear friends,
    If PR is made for 40W Philips Bulb , PO is made 40W Philips bulb and at the time of GRN it is noticed that 40W Wipro bulbs are coming then how to map this in sap?
    Regards,
    Mahesh.

    Hi
    In SAP  movement type 101 and 161 for the Auto PO at the time if Receipt,
    configuration
    1. Material Master- Auto PO enable mark this tick in purchasing view
    2.Vandor Master- Auto PO enable mark this tick in purchasing tab of vendor master
    3. Material should be valuated maetrial
    4. P oran shoud be a STD p organ and it has to be assigned with the plant,,
    5 Info record has to be maintained with the Value/price with the Validity and tax code
    6 you can not post into GR blocked stock for auto po
    check following link
    [Automatic Po creation With MB01 i am getting Error;
    [http://www.sap-img.com/materials/steps-to-create-auto-po.htm]
    Regards
    Kailas Ugale

  • MacBook Air and problems with Time Capsule in 5GHz Radio Mode

    We have our Time Capsule configured to 802.11n only (5 GHz). We've done this to work more efficiently in a particularly noisy wireless area. The problem is that the MacBook Air can't maintain a connection to it and when it loses the connection, the wireless interface seems to disappear from the Mac altogether - the wireless status indicator just shows an empty cone. The only solution is a restart. Sometimes it loses the connection after a couple of hours, sometimes within minutes, though it always goes eventually. All other machines on the network are fine, and switching the Time Capsule to 802.11n only (2.4 GHz) solves the problem, though there's a lot of noise at that frequency and our network performance as a whole suffers.
    I know there's similar threads around dealing with the MBA and wireless issues (I've tried all the solutions vaguely related, e.g. deleting and recreating the wireless interface), though none that deal with this specific problem, which I'm convinced is caused by the radio mode of the Time Capsule.
    All software / firmware is the latest:
    MacBook Air 10.5.2 Wireless Card Firmware Veriosn Broadcom BCM43xx 1.0 (4.170.46.5)
    Time Capsule Version 7.3.1
    I was hoping the recent firmware updates would sort this... any one else running a Time Capsule in 5GHz mode with a MacBook Air?

    I'm running my TC in 5ghz mode with my MBA. My original problem was the lack of signal strength coming from my AEBS caused the MBA to have a slow connection. There are a number of pipes in the wall that separates the two rooms where my MBA lives and the AEBS is.
    So, I hard wired the TC to the AEBS and placed the TC in the room where my MBA lives most of the time. Now that the signal strength is really good I'm not having any issues.

  • Formatting a string with time stamp and double precision numbers

    %s\t%f\r%f
    This is a format string that I have in old code that I've decided to change.  Problem is I cannot make sense of the string codes in my own old code! Let me explain what I want, and hopefully someone can explain how to do it.
    I am using the format into string subvi to merge a time stamp (formatted as %m%d%Y%H%M%S%5u) and two different double precision numbers.  This string is then wired into the Write Characters to File subvi so that I can record data as a .txt file, and open it in either Matlab or Excel.  There is a minor problem with the string format above because in excel the first time stamp entry is blank, and the first loop only gives the two double precision numbers withouth the time stamp - the time stamp appears in the next loop (probably a looping issue and not due to the string format, but if you see differently please let me know).  Now what I want to do is 1. potentially fix that problem and 2. add some more doubles. 
    1. Is there a string format issue that is evident that I am not seeing that causes the time stamp to be formatted into the string after a carriage return?  Or should I be looking at looping issues?
    2. How do I add another one - three floating point numbers (double precision)?  Are the \'s marking different numbers in this string constant?  Or is it the %?  I can't find any information about the \'s, but I see that % begins the format specifier. 
    Ideally, I want these data in the following columns:  Date, Time(absolute), FP, FP, FP, carriage return for the next loop (FP is floating point double precision number).
    Thanks,
    Brad

    Hi JonN,
    Here there is no need of string concordinate function (in your code), the same result you can find if you connect the output of the format string to shift register, and shift register in data to initialize string connector in format into string function.
    <<KUDOS ARE WELCOME>>
    ELECTRO SAM
    For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life.
    - John 3:16

Maybe you are looking for

  • How can I use screen share of my mac mini?  Problems validating

    I recently purchased a mac mini to act as my home media server for audio as my airport express was not playing nicely with my Peachtree DAC.  Anyway, I have set up sharing on the mac mini and can't figure out how to connect from my wife's Macbook, or

  • Doubt on ALV report

    Hi gurus,      For all of your support , I written the ALV report.Now the field is editable. But the problem is I need to save that field value what we edited.        Actual requirment is we have some materials list.of vehicles... Those vechicles wil

  • DVD drives no show.

    I just finished rebuilding a system using the K9N4-F Ultra motherboard. When I first booted the machine the computer kept rebooting during the post screen. I was not even able to get into the bios.Since one of the reasons for rebuilding the machine w

  • Subject Line

    Ok, i have been trying to figure out how to add a couple of text fields within the ?subject line of an outlook email. I have the mailto address and i also want to incorporate 3 textfields that the user submits upon completing the form. Everything is

  • Java3D: 2D co-ords to 3D co-ords

    Hi I'm new to Java3D and am writing a program where it displays a cylinder at specified points. I have also implemented MouseListener for mouse control. The problem is the MouseListener is on different co-ordinates from what the Canvas3D is using, To