Looking for zero crossing point

Hello,
I have Amplitude vs. time data (wave).    
I need to find the zero crossing time. Now I am using "For loop"  to search the Amplitude array for the index of the neighbor to zero through point by point, and then by linear inerpolating to get the zero crossing time.  When the point number is large, say 60kpts, it gets slow because the for loop "point by point" searching method, I think.
I am wondering if there is any quick way to do that.
Thanks,
Wei Tong

Try something like this, maybe? See if it makes sense.
(It currently fails if a value is exactly zero and the function does not switch sign afterward. It just needs a bit more code to fix that. Modify as needed.)
Message Edited by altenbach on 04-13-2008 12:52 PM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
ZeroCrossings.png ‏33 KB
ZeroCrossings.vi ‏57 KB

Similar Messages

  • Looking for an Access Point with 2 Ethernet ports and powered via PoE

    Hi Gurus,
    I am looking for an Access Point with 2 Ethernet ports and the access point can be powered via PoE. I have been assigned with a requirement where the rooms need to have access point as well as an Ethernet Cable provided from the Access Point as a backup for connectivity.
    The room only has one data cable coming from the main IT room as well does not have a spare power socket to power the Access Point. Will be good if it can be centrally controlled or controller based.
    Any recommendations?
    Regards
    J

    For the backup plan, the cheapest solution may be to just run a couple new cat5e drops to the room(est cost $250). If not then purchase a small Cisco POE switch for the room(est cost $2k). For wireless I would purchase a POE enabled Cisco AP. But you will need to verify the POE switch/blade you will be connecting the AP to can power the AP you buy. I got burned by that issue when we purchased some Cisco 1251 AP's with dual radios and they needed more power than our 4500 POE blades could handle. We were told we would need to purchase new 48 port 10/100/1000 blades or power injectors. Our Cisco sales vendor took the heat for that mistake.
    Posted by WebUser Steven Kinney from Cisco Support Community App

  • Looking for a cross platform (Mac+Win) Photo+Movie organizer.

    Hello,
    I am not sure as to where to post this, but I am desperately looking for a program to organize my photos and movies on both platforms. iPhoto is great, but I can't use it on my win PC, Adobe Elements is perfect... on windows, but is gimped on a Mac (no organization features), Lightroom is ok... but doesn't organize my movies, and Aperture is mac only.
    I have my livrary of pictures on an external disc, and was hoping to be able to roganize, tag, modify, and add keywords via my Mac AND PC.
    Any ideas?
    Thanks in advance for you input and insight on this matter!

    Nah, you still get the points for the wonderful tip! What a life saver! Thanks so much! I think I agree with you as for the version to get, the non pro version will probably fit my needs fine... I still have 20 days to make up my mnd though.
    On the other hand, I was wondering about the organization capabilities of this software: I was thinking of organizing all my pictures with keywords, as in if a picture was taken in NY, I am on it, and it is at night, I was thinking of adding the following keywords: NY, me, night.
    The reason for that is that the keywords are written to the metadata of the picture file, and is permanent (as in not stored inside of iView's catalog).
    The real question is that iView seems to offer many other possibilites of filing my pictures: it has a People, Places, Events (...) fields also. Are those also written to the metadata of my picture files? Would they be read by any other program? I am asking, because, if ever I switch programs in the distant future, I don't want to have to resort my whole collection (which I have to do right now since I am migrating from the windows version of Adobe Elements which stored all of the tags in a proprietary format).
    Bah, I am sure this isn't the place to ask for these questions... but hey, you seem to know alot about this little gem of a program.
    Thanks!
    MB Pro 15" Mac OS X (10.4.7)

  • Looking for an Access Point with 2 Ethernet ports

    Hi,
         I am looking for an AP with two ethernet ports. Is there any model of Cisco is available with 2 ethernet ports?
    Regards,
    Noman

    pros:
    If an access swich/switch port failed then AP still forward traffic through other switch once power restored through other port.
    when PoE failed on its connected switch, it may still work via other port.
    Having two ethernet port on AP may require to talk to different switches/stack to achieve AP port redundancy through lag or stateful switch over when cable/switch/AP port failure.
    if one physical port become bad on AP, it can be still used with other.
    (However, AP/physical port failure can be takencare at RF level using self healing.)
    cons:
    require additional switch and its config maintanece
    currently, AP doesn't require 2 physical port for data transfer perspective.
    Require x2 PoE ports.
    Additional port increases the cost on AP.
    it is possible cisco may make it in future.

  • If anyone's looking for answered question points, here's your chance.

    I'm really sorry about this guys. This must be too easy to document. How do I add a stinking clip to the DVDSP4 Menu. All I want to do is play one clip on a DVD.
    I'm using a templet and I drag my FCP DV exported movie into the background of the Menu templet. The options come up to create button and add track. I've got that part down. I can see the asset in the timeline.
    Why is the Status light yellow? Also, when I go to the Graphical tab it doesn't have the two icons, one for the menu and the other for the movie?
    Honestly, I've read the manual for importing assets and I understand that part.
    What the heck am I missing?
    Also, does anyone know why my Encoder settings is grayed out?
    Sorry to bother you with this,
    Pete

    I gave you the points... I really spent time going through that manual. I also spent time searching past questions and going to the DVDSP help website. It was just such a basic thing. I don't know why the manual isn't somehow more forthcoming.
    What I did with FCP is I bought a couple... well about 4 books on it. I spent forever on that. I have a deadline coming up for this film and I just needed to get a 16:9 clip on a DVD. That shouldn't be very hard. I can do it in iDVD but I read that you can't do widescreen without iDVD HD.
    The manual really should have that better put together. The FCP manual is much more methodical then that. I'll get some books on DVD SP. I know it ****** you off, but it's the only way I can get into the business. I spent a crapload to Apple already on the dual 2 Ghz G5 and all the other stuff you need.

  • Record time of zero crossing

    I am trying to record the time for zero crossing in order to get the phase angle and inevitably get the power facto . soi was trying out a few ideas to  see if this is achievable and i came up with this . can someone tell me where i am wrong . or what to do  get the right values .. 
    Solved!
    Go to Solution.
    Attachments:
    zero crossing in waveform.vi ‏17 KB
    Zero Crossing.PNG ‏21 KB

    1. You need to pass the waveform into the Get Waveform Time Array.
    2. No need to wire up the N on the FOR loop since you are using Autoindexing tunnels.
    3. The Conditional Indexing tunnel is your friend here.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    zero crossing in waveform_BD.png ‏20 KB

  • Check for zero

    I am looking for a way to check input fields for zero values in my action listener and bring up a message dialog if it finds one. I can get it to look for null or alpha characters but I can't figure out how to look for zero. Any suggestion would be appreciated. My action listener code is below...
    public class MyActionListener1 implements ActionListener
        double newAmount;
        double newRate;
        double newTerm;
        // Tell the JButton (calcButton) what to do when clicked.
        public void actionPerformed(ActionEvent evt)
            try
                AbstractButton calcButton = (AbstractButton)evt.getSource();
                newAmount = Double.parseDouble(principleValueText.getText());
                newRate = Double.parseDouble(rateAPRText.getText());
                newTerm = Double.parseDouble(termYearsText.getText());
                pmtText.setText(nf.format(getMortgagePmt(newAmount, newTerm, newRate)));
                pmtText.setForeground(Color.red);
                principleValueText.setText(nf.format(newAmount));
                rateAPRText.setText(np.format(newRate/100));
                termYearsText.setText(ni.format(newTerm));
            // Privide error handeling to check for valid input.
            catch(NumberFormatException nfe)
                JOptionPane.showMessageDialog(null, "The value must only contain digits",
                                                          "Input Error", JOptionPane.WARNING_MESSAGE);
    }

    I don't quite understand your problem, but I think what you're saying is that if any of the parsed numbers are 0, you want to show a dialog box that says you can't have "0" values?
    There are two ways to do this: after parsing each number, you can just simply use the block:
    if(number == 0){
        JOptionPane.showMessageDialog(null,"...","...",...);
    }You can call the JOptionPane methods whenever you want to in your program.
    Now, another way of doing this, though kind of like over kill, you can use a block like this:
    if(number == 0)
        throw new IllegalArgumentException("Number cannot be 0!");and then after your catch(NumberFormatException) block put:
    catch(IllegalArgumentException iae){
        JOptionPane.showMessageDialog(null,iae.getCause(),"Error",JOptionPane.ERROR_MESSAGE);
    }or something to that effect. once again, second solution is kind of overkill, but it would work (and stop the execution of the rest of the method)
    If I completely understood your problem, I'm sorry =D
    Alex

  • How do I reset Mountain Lion to an earlier state? I'm looking for a PC-style restore point.

    I upgraded my MacBook Pro to Mountain Lion about a week ago. Soon after, I noticed a problem with Zinio Reader (I could not view my magazines any longer). I found instructions on Zinio's Web site to remove the reader and Adobe Air, then re-download and install the reader. Things seemed to go smoothly for a short while, but then my MacBook slowed to a crawl. It takes about five minutes just to log into my machine. I'm getting a lot of the beach ball action. Every action—even resizing a window—has become an agonizing chore. So now I'm looking for a way to set my machine back to an earlier state—something like Windows restore points.

    To answer your Carbonite vs Time Machine (you should probably ask this in a new thread .)
    I prefer Time Machine because it backs my system preferences, user account (if you have more than one), apps, and files.  It's also fast to restore.  4 hours max from reinstall of my osx (from Leopard to Lion) to Time Machine Restore.
    Carbonite just back up your files.
    I tried the free version of Carbonite once (5 gigs of storage), and didn't like it.
    I also know people have a hard time restoring from Carbonite because it is so slow.  You should probably test that out sometimes. 
    One last problem I have with Carbonite is that if you delete a file on your mac, it will be deteled on the Carbonite within 7 day (something like that).  With Time Machine, as long as the drive is big enough, the file will be there (until the drive is full, than the oldest Time Machine backup will be deleted).
    The advantage of Carbonite is that the files are not in your house.

  • I am sort of new to MAC's and I love them so far.  I am looking for a software or app to convert power point presentations to flash much like Ipring for PC Can anyone recommend something?

    I am looking for a software or app to convert power point presentations to flash much like Ipring for PC Can anyone recommend something?

    This article has 6 ways to do it.

  • Pointer on what to look for (NullPointerException in FontManager.getFont2D)

    I have a screen that we are trying to display remotely (via an RMI bridge). On the local application it displays properly everytime, but when displayed remotely It displays properly once. From then on it comes up blank with a null pointer exception (Posted below). Right now I'm thinking there is something in the set-up for the local applicateion that is not happening on the remote one. But I didn't write either and my brute force investigation hasn't trned up anything.
    Since I only have to disconnect and close the remote application and restart to get it to display again this could also be a problem cleaning up resources on a window close. I'm hoping that someonw might have an idea of what causes this Exception. Moste references I've found to it appear to be listed as fixed (And aren't the same thing since they happen all the time) or are in threads that just stopped with no resolution. I'm hoping that if I find out what it means I might have a better idea what to look for.
    java.lang.NullPointerException
         at sun.font.FontManager.getFont2D(Native Method)
         at sun.font.FontDesignMetrics.initMatrixAndMetrics(FontDesignMetrics.java:343)
         at sun.font.FontDesignMetrics.<init>(FontDesignMetrics.java:336)
         at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:284)
         at sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:943)
         at javax.swing.JComponent.getFontMetrics(JComponent.java:1599)
         at javax.swing.plaf.basic.BasicTabbedPaneUI.getFontMetrics(BasicTabbedPaneUI.java:1801)
         at javax.swing.plaf.basic.BasicTabbedPaneUI.calculateMaxTabWidth(BasicTabbedPaneUI.java:1754)
         at javax.swing.plaf.basic.BasicTabbedPaneUI$TabbedPaneLayout.calculateSize(BasicTabbedPaneUI.java:2314)
         at javax.swing.plaf.basic.BasicTabbedPaneUI$TabbedPaneLayout.preferredLayoutSize(BasicTabbedPaneUI.java:2261)
         at java.awt.Container.preferredSize(Container.java:1599)
         at java.awt.Container.getPreferredSize(Container.java:1584)
         at javax.swing.JComponent.getPreferredSize(JComponent.java:1636)
         at psip.gui.util.UIDelegate.defineComponentSizes(UIDelegate.java:927)
         at psip.gui.util.UIDelegate.applyAllResources(UIDelegate.java:865)
         at psip.gui.jfc.panel.AbstractContainer.applyAllResources(AbstractContainer.java:254)
         at psip.gui.jfc.panel.AGDTabbedPane.applyAllResources(AGDTabbedPane.java:471)
         at psip.gui.jfc.panel.AGDTabbedPane.<init>(AGDTabbedPane.java:101)
         at psip.gui.jfc.panel.ControlPanelFactory.getUIDelegate(ControlPanelFactory.java:167)
         at psip.gui.uiDelegate.UIDelegateDirector.getUIDelegate(UIDelegateDirector.java:124)
         at psip.gui.viewMap.GUIComponentFactory.createUIDelegate(GUIComponentFactory.java:593)

    Anna:
    Yes, rule no. 1, Firewire or FW/USB
    2. Largest HDD you can afford (having more space than you need it not a problem; needing more space than you have, is.)
    3. 7200 rpms. (Most of them are, but not all)
    Here is a list of some of the best buys already sorted for 200-300 GB.
    Different folks like different manufacturers. I have had my LaCie for 2 years. No problems. I like it for it's compact size and elegance.
    Here are some good hints from Dr. Smoke on Backup and Recovery. Instead of Retropect, which I could never quite figure out, I use Carbon Copy Cloner or SuperDuper.
    Post back with further questions or comments.
    Good luck.
    cornelius
    Message was edited by: cornelius

  • Stacked 100% bar chart - Problem with datatips for zero value data points

    I have a stacked 100% bar chart that shows datatips in Flex 4.   However, I don't want it to show datatips for
    data points with zero values.   Flex 4 shows the datatip for a zero value data point on the left side of a bar if the data point is not the first in the series.
    Here's the code that illustrates this problem.    Of particular concern is the July bar.    Because of the zero value data point problem, it's not possible to see the datatip for "aaa".
    Any ideas on how we can hide/remove the datatips for zero value data points ?        Thanks.
    <?xml version="1.0"?>
    <s:Application
    xmlns:fx="
    http://ns.adobe.com/mxml/2009"xmlns:mx="
    library://ns.adobe.com/flex/mx"xmlns:s="
    library://ns.adobe.com/flex/spark"creationComplete="initApp()"
    height="
    1050" width="600">
    <s:layout>
    <s:VerticalLayout/>
    </s:layout>
    <fx:Script><![CDATA[ 
    import mx.collections.ArrayCollection;[
    Bindable] 
    private var yearlyData:ArrayCollection = new ArrayCollection([{month:
    "Aug", a:1, b:10, c:1, d:10, e:0},{month:
    "July", a:1, b:10, c:10, d:10, e:0},{month:
    "June", a:10, b:10, c:10, d:10, e:0},{month:
    "May", a:10, b:10, c:10, d:0, e:10},{month:
    "April", a:10, b:10, c:0, d:10, e:10},{month:
    "March", a:10, b:0, c:10, d:10, e:10},{month:
    "February", a:0, b:10, c:10, d:10, e:10},{month:
    "January", a:10, b:10, c:10, d:10, e:10}]);
    private function initApp():void {}
    ]]>
    </fx:Script>
    <s:Panel title="Stacked Bar Chart - Problems with DataTips for Zero Value Items" id="panel1">
    <s:layout>
    <s:HorizontalLayout/>
    </s:layout>
    <mx:BarChart id="myChart" type="stacked"dataProvider="
    {yearlyData}" showDataTips="true">
    <mx:verticalAxis>
     <mx:CategoryAxis categoryField="month"/>
     </mx:verticalAxis>
     <mx:series>
     <mx:BarSeries
    xField="a"displayName="
    aaa"/>
     <mx:BarSeries
    xField="b"displayName="
    bbb"/>
     <mx:BarSeries
    xField="c"displayName="
    ccc"/>
     <mx:BarSeries
    xField="d"displayName="
    ddd"/>
     <mx:BarSeries
    xField="e"displayName="
    eee"/>
     </mx:series>
     </mx:BarChart>
     <mx:Legend dataProvider="{myChart}"/>
     </s:Panel>
     <s:RichText width="700">
     <s:br></s:br>
     <s:p fontWeight="bold">The problem:</s:p>
     <s:p>Datatips for zero value data points appear on left side of bar (if data point is not the first point in series).</s:p>
     <s:br></s:br>
     <s:p fontWeight="bold">For example:</s:p>
     <s:p>1) For "June", eee = 0, mouse over the left side of the bar to see a datatip for "eee". Not good.</s:p>
     <s:br></s:br>
     <s:p>2) For "July", eee = 0 and aaa = 1, can't see the datatip for "aaa", instead "eee" shows. Real bad.</s:p>
     <s:br></s:br>
     <s:p>3) For "Feb", aaa = 0, datatip for "aaa" (first point) does not show. This is good.</s:p>
     <s:br></s:br>
     <s:p>4) For "Mar", bbb = 0, datatip for "bbb" shows on the left side of the bar. Not good.</s:p>
     <s:br></s:br>
     <s:p fontWeight="bold">Challenge:</s:p>
     <s:p>How can we hide/remove datatips for zero value data points?</s:p>
     <s:br></s:br>
     </s:RichText></s:Application>

    FYI.
    Still have the issue after upgrading to the latest Flex Builder 4.0.1 with SDK 4.1.0 build 16076.   
    Posted this as a bug in the Adobe Flex Bug and Issue Management system.     JIRA
    http://bugs.adobe.com/jira/browse/FLEXDMV-2478
    Which is a clone of a similar issue with Flex 3 ...
    http://bugs.adobe.com/jira/browse/FLEXDMV-1984

  • Looking for a script to connect bodytext to footnote and cross-references

    Hi,
    Need to do the following:
    I was provided with separate (tagged-text) files: bodytext, (foot)notes and cross-references. Now I am looking for a solution (script?) that can do the following:
    to restore the connection between the body-text, the footnotes and te cross-references after placing these in a document in Indesign.
    The cross-references should appear (in anchored text-frames) in the margin and the notes in a separate frame at the bottom of the page. If possible in the same way as footnotes in Indesign appear, but in a separate frame to be able to do some more formatting than native footnotes would accept.
    I have tested the plugin: Side Heads from InTools, and tis works well with Indesign files tthat contain footnotes. But this doesn't work with separately placed footnotes from a tagged-text-file, as they re not knotted together.
    I can't do any scripting myself.
    I would appreciate any help, and I am looking forward to your response...
    Regards,
    kkingg

    The first thing to do is:
    regexp "match regexp = ([0-9]+)" $_cli_result match count
    if $count eq 0
    exit 0
    end
    The second is a bit more challenging.  I think this will work:
    cli command "show call active voice br"
    foreach line $_cli_result "\n"
    regexp "^([0-9a-zA-Z]+) : " $line match callid
    if $_regexp_result eq 1
      continue
    end
    regexp "^dur 1d" $line
    if $_regexp_result eq 1
      cli command "show call active voice br | section $callid"
      syslog msg "$_cli_result"
    end
    end

  • What is the best way to follow the scenario for Out look integration with share point using SAP Gateway?

    1)what is the best way to follow the scenario for Out look integration with share point using SAP Gateway?
    2)workflow concepts for Purchase order?
    3)Email triggering from out look for an approval process of PO? how these scenario can be best implemented with updated functions in Duet Enterprise.

    Hi,
    I do not have much idea on gateway integration with outlook but found out this document GWPAM Workflow Template which can be helpful for you to start with.
    also you may want to post your question in SAP Microsoft Interoperability forum
    Regards,
    Chandra

  • I wanted a zero crossing detector for a a acquired wave form.

    it shoul detect the zero crossing of a wave

    The technique for finding a zero crossing is basically to detect a change in sign between two consecutive numbers. You need to evaluate the previous number sign with the current number.
    A common way to do so is by multiplying the previous number and the current number. If the product is positive, both has the same sign and thus there was no zero crossing. If the product is negative, there was a zero crossing.
    Make sure you are sampling you signal fast enough to accurately detect when the zero crossing occur. If you know your signal, you may easily calculate the exact moment based on your aqcuired information.
    Best regards;
    Enrique Vargas
    www.vartortech.com

  • Pointing FCE to Look for Data at New Location

    FCE is in my laptop, but original clips (within an iMovie project) were taken from an External Disk ("ED"). When I opened the finished FCE project, I still had to be connected to the ED in order to keep all the files intact.
    I copied the iMovie file into the laptop, and then Set the Preference to look for data in the new location in the laptop, but it is not working. Only upon re-connecting to the ED can all the files be found and viewed again.
    Any suggestions would be greatly appreciated; thank you for your time and efforts.

    Piero, thank you for the reply. Reconnecting individual clip to the corresponding clip in the new location will be difficult as the clips are in iMovie, which (unlike in the old iMovie) does not actually show us all the individual clips.
    I suppose I will just have to start over, OR a good lesson for next time, to make sure where everything should be.

Maybe you are looking for