How can I make a simple 1D array filter.

When I aquire my data I get a 1D array with anywhere from 10 - 30 data points. There are always ten good data points the rest are noise or false triggeres. a good data point is in the range of .1-.2 a bad point is .001-.01 how can I filter out thse bad points? Im using labview 8.6. also I think this program will work if it could be backconverted from 9 to 8.6.
Attachments:
InRange[1].vi ‏11 KB

Dan K wrote: 1 - get "array size" and connect that to the N of the for loop.
2 - "index array" so you can compare values one at a time.
3 - "in range and coerce" - (note: you need to wire values above and below the orange line shown for the range you'd like)
4 - case structure: if "in range" is true, then take the value and put it into a new array (this new array only has the good values you want) (false case is blank)
 NOOOOOO!!!!
Step 1 and 2 are not necessary. Simply autoindex the original array at the loop boundary. Voila!
(an "index array" with the index wired to [i] is never needed. Autoindexing does the same thing and automatically determines the number of iteration, eliminating step 1). 
The second array is not initialized, meaning it will grow without bounds of you run the VI many times. Every time the loop runs, the array is resized, requiring a new buffer allocation. The original code is much better, because it preallocates the output array, replaces elements, then strips the extra length at the end. For large datasets, the original code will be orders of magnitude faster.
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • How can i make a simple app?

    Hi,  i just became an apple develiper,  Im wondering how to make a simple app like a "flashlight" like app,  Can anybody help me out?  would i have to start from scratch or could i use someone else's start??

    Use your logon to the iOS Dev Center and see this links:
    iOS Human Interface Guidelines
    iOS Starting Point
    Start Developing iOS Apps Today
    App Development Overview
    App Store Review Guidelines for iOS Apps
    Your First iOS App

  • How can I make a simple 1 channel I/O with RS232?

    Hy all,
    I just want make a simple 1/0 output over RS232. How can I programme it in LabView? Noemaly we send datas over RS232, but I want just a High or a Low on the TxD (or may on DSR or CTS).
    Thanks
    Petric

    You are lucky, here is a 6.0 version ... I hope it works
    CC
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    DTR control 2.vi ‏10 KB

  • How can I make a simple slideshow on iDVD?

    As opposed to the majority of Apple apps that are "user-friendly" I find using iDVD a very awkward, un-friendly application. It offers "drop zones" without me understanding what I should "drop" into them.
    I just want to make a simple DVD of a slideshow with some background music ... nothing fancy. I don't need any theme and I don't need to add any movies.

    To simply create a slide show in iDVD 7 onwards from images in iPhoto or stored in other places on your hard disk or a connected server, look here:
    http://support.apple.com/kb/HT1089
    If you want something a bit more sophisticated:
    There are many ways to produce slide shows using iPhoto, iMovie or iDVD and some limit the number of photos you can use (iDVD has a 99 chapter (slide) limitation).
    If what you want is what I want, namely to be able to use high resolution photos (even 300 dpi tiff files), to pan and zoom individual photos, use a variety of transitions, to add and edit music or commentary, place text exactly where you want it, and to end up with a DVD that looks good on both your Mac and a TV - in other words end up with and end result that does not look like an old fashioned slide show from a projector - you may be interested in how I do it. You don't have to do it my way, but the following may be food for thought!
    Firstly you need proper software to assemble the photos, decide on the duration of each, the transitions you want to use, and how to pan and zoom individual photos where required, and add proper titles. For this I use Photo to Movie. You can read about what it can do on their website:
    http://www.lqgraphics.com/software/phototomovie.php
    (Other users here use the alternative FotoMagico:  http://www.boinx.com/fotomagico/homevspro/ which you may prefer - I have no experience with it.)
    Neither of these are freeware, but are worth the investment if you are going to do a lot of slide shows. Read about them in detail, then decide which one you feel is best suited to your needs.
    Once you have timed and arranged and manipulated the photos to your liking in Photo to Movie, it exports the file to iMovie  as a DV stream. You can add music in Photo to Movie, but I prefer doing this in iMovie where it is easier to edit. You can now further edit the slide show in iMovie just as you would a movie, including adding other video clips, then send it to iDVD 7, or Toast,  for burning.
    You will be pleasantly surprised at how professional the results can be!

  • How can I make a simple Pendulum movement

    Hi,
    I am quite new to motion and at the moment I am thinking that I am tiring to run before I can walk this idea of mine.
    I am trying to make a repeating pendulum movement, like the movement of the Newtons cradle with the 4 balls, the energy of the swinging outer left ball is transferred to the outer right ball on contact etc. Each ball will show a short looping video footage.
    Is there a simple way of creating an arced motion path (upwards and outwards) for the first ball and then reversing it along the same motion path, but then copying this path to the opposite side, mirroring the complete movement?
    I have tried converting to a simple motion path to keyframes but I get into a bit of a mess.
    Any ideas?
    Thanks in advance.
    PowerMac 2x2.5GHz   Mac OS X (10.3.8)  

    I actually just did an animation based on that desk decor thing... it was easy once i figured out what to do...
    Now, i tought myself motion, so my way may not be the "best" or quickest but it worked. First...import the object/make the object or whatever. second, go to behaviors and take basic motion path. After that, take the bezier curve adjustment and arc the line. That will get you the object going up in a swing or down...depending on where you put the start point on the curve. After that, copy the actual motion curve, but put the new end point to where the old start point was...basically invert the motion (if there is a simpler way to do this please tell me). that will get the object to go up/down then down/up.
    So that gets the basic motion of a half swing.
    If your object hits another object (like in the desk thing) make sure your snap lines are on because youll need them to line up the motion. Do the same thing to the second object as you did to the first, but going the oposite way. The snap lines will help guide you to make sure the second object goes as high as the first. To make it look correct i pretty much eyeballed the connection of one object to the next going frame by frame. I also added the "ease at end" motion to the rising motion path to add a realistic touch.
    If this is confusing i'm sorry...

  • How can i make a simple image viewer in JAVA?

    i know this is a silly doubt...but 'm new to java
    i have to make an image viewer which can also zoom the image
    please help me
    advance thanx

    Create an java.awt.Image object
    Display it in a java.awt.Panel object
    using java.awt.Graphics.drawImage
    some of the drawImage methods let you scale, clip, and flip the image.
    That's AWT. It may be easier in Swing.
    I think this could be written in under 50 lines of code. Maybe under 25.
    Read the tutorials and the API. All will become clear.
    If you're new to java, you might be better off posting to the New To Java forum.

  • How can I make a simple DVD in iDvd?

    I have 17 video segments that I would like to autoplay in order and then have a simple titled menu come up at the end and so all 17 segments as thumbnails in case a reply of one of the segments is required.
    THx for any thoughts...
    Mike

    You won't be able to get all 17 on one menu page. It will require a sub menu/s also. Most themes range from 6-12 buttons. But the good news is once you have compiled your iDvd project, you can drag and drop said movie to the first box while in map view within iDvd and it will play the dvd once inserted into most dvd players. The menu will indeed pop up at the end provided you do Not select the loop function also.
    Hope this info helps but if not just come on back.

  • How can I make a simple voice recording with no instrumentals?

    I just want to record a song or two, save them individually and then burn to a cd.  I don't need all of Garageband whistles and bells.  I'm intimidated at the new 'event/project' start menu.  I don't want to select a key or timing.  I just want to sing the song using the mic on my iMac. This is not going to be posted for the general public and I don't want or need fancy.  Suggestions? Guidance?
    I mistakenly posted this first to the podcasts site.

    Ann Shore wrote:
    I'm intimidated at the new 'event/project' start menu.
    there's nothing to fear there, pick "Acoustic Instrument" for a simple "no bells" recording track
    Ann Shore wrote:
    I don't want to select a key or timing.
    then don't.
    if you don't intend to use any of GB's tools, then the key and tempo don't matter

  • How can I make a simple circle in html5/css3?

    I have cs5 and the html5 pack installed. I draw a circle on a new document. Now what?

    You are right canvas can be used to render rastar graphics, however we don't generate the canvas code directly from Illustrator. Instead this pack lets you mark some elements within a design as Cavnas,  when the SVG output is generated those elemented would be treated as canvas within SVG so that you can have pixel level control on those elements.
    Please refer to http://download.macromedia.com/pub/labs/illustrator_html5/illustrator_html5_userguide.pdf for details on this and other features of the pack.

  • How do i make a simple title in fcpx?

    okay stupid question, how can I make a simple title without any preadjusted parameters/animation/etc..?

    Use the Custom title.

  • How can I make an invalid dynamic disk Array available to the OS again

    Hello Storage Pros
    The setup
    I have a Promise VTrak E610f head unit with 2 VTrak 610j expansion units attached to it together giving me over 27 TB of usable storage space.
    At the hardware level I slip the storage into 6 parts containing 7
     1TB disks and had the parts  configured into 6 RAID 6 arrays. In the end; each of the 6 arrays gives me 4.6TB of usable storage space.
    On the OS level, I have the storage attached to 2 servers: Windows server 2008 and windows server 2008 R2 over a Qlogic fiber channel switch. Each of the 6 arrays are viewable as basic disks of 4,6Tb which I went on to configure as a single RAID 0
    spanned volume of 27TB and for that all the disks had to be converted to dynamic.
    The problem
    Now comes the problem: On my first attempt to do a firmware update on the VTrak E610f storage; all the volumes were rendered foreign and I had to import them to be able to use them. Although the import was successful, I lost all the set NTFS permissions
    and SMB share and I had to manually reconfigure them. Upon doing so The OS registered some inconsistencies in the storage and recommended that I ran chkdsk. Since the storage is that big I reluctantly complied and restarted the server.
    The first server was restarted BUT chkdsk did not commence as scheduled, the server powered right up. After logging in to inspect; I discovered - to my surprise, that the disks were now shown as invalid in Disk Manager and were no longer visible to
    the OS. Assuming that maybe a restart of the other server and the storage would set things right, I went ahead to do so but to no avail. After rebooting the entire system (including the storage), the other server also displayed the disks as invalid and were
    no longer visible to the OS as well.
    My question is; how can I make the disk available again from this ‘invalid’ state without losing data?
    What I tried but did not help:
    Taking the disks offline and then online again did not work, after the disks were online again, they still appeared as invalid.
    Reactivating the disks threw an error “operation not allowed on an invalid disk pack”
    Calling support of the storage manufacturer: they did not find anything wrong with the system, after 5 hours we had to stop.
    I fear converting the array from dynamic to basic will destroy all the data.
    HxD is showing no errors in the disks
    If there is any expert out there with helpful tips; your assistance will be greatly appreciate.
    Cheers
    John

    Hello  Shoan
    Thanks a lot for your response and tips. Sorry I could not get back to you in good time for I had to run some of the tests you provided, it took some time to
    thoroughly re-test the system.
    The summary
    The initial firmware upgrade attempt forced 3 disks offline and the other 3 became foreign. I had to re-import them to have access again. after re-importing
    the disks I realized  all NTFS permissions and SMB shares of the folders on the disks had disappeared, but at least the disk was visible and accessible at that point - but not fault free. It was recommened that I let chkdsk run. However rebooting the
    system to allow chkdsk to run did not result in chkdsk running, instead chkdsk did not run and after restart, the OS showed the disks as invalid. And that is still the case now.
    Response to your questions:
    Yes the storage array was (and is still) connected to another server 2008 R2 server when the problem occurred. The second server is also displaying the same problem: the disks are shown as invalid.
    The loss of SMB shares and NTFS permissions occurred after the initial firmware upgrade attempt, some disks (3 out of 6 of them) were forcibly offlined and the other 3 were, suddenly, marked as foreign. In the end, and to have access to the disks
    I had to online the offlined 3 disks and then reimport the rest of them. From the way I understand it, if the upgrade was not the cause, then at least it was the trigger.
    In as far as converting disks from dynamic to basic, I was not in luck so far:
    Three of the companies I have contacted (recommended by promise Technology technician) so far only work with smaller disks like 2TB, 27 TB like I have is so
    far too big.
    I’m not sure converting the disks to basic will help much though, since that would break the single 27 TB volume which the OS was working with into 6 individual
    disks of 4.6 TB. Will I be able to get the data back that was written to just one volume from those 6 individual and unrelated disks?
     Above all, I have connected the RAID storage system to a newly installed Server 2008 R2, the disks are also shown as invalid.
    I have spent more than 17 hours in remote sessions with a Promise Technology technician trying the resolve the issue. From the technician’s side all seems in place with the exception
    that the disks are invalid in the OS.
    I have contacted Microsoft Customer Support service with the issue. Given that Microsoft did not manufacture the storage unit, can they help at this point – or am I better off
    putting my hopes else?
    Your help is always appreciated and again, thanks for your response and advice.
    JohnV

  • How can i make simple program to match colors ?(photos taken by camera)

    how can i make simple program to match colors ?(photos taken by camera)

    Hi khaledyr,
    use a "random number" and compare for ">0.5" to get a (1 or 0) signal
    What exactly are you searching for?
    - Hints for choosing hardware?
    - How to output voltage or relais signals?
    - Help on using DAQ(mx)?
    - Help on generating (boolean) waveforms?
    Message Edited by GerdW on 04-16-2010 08:15 AM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How can I make the combo box turn to the value of black.

    When the show button is pressed (and not before), a filled black square should be
    displayed in the display area. The combo box (or drop down list) that enables the user to choose the colour of
    the displayed shape and the altering should take effect immediately.When the show button is pressed,
    the image should immediately revert to the black square, the combo box should show the value that
    correspond to the black.
    Now ,the problem is: after I pressed show button, the image is reverted to the black square,but I don't know
    how can I make the combo box turn to the value of black.
    Any help or hint?Thanks a lot!
    coding 1.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class test extends JFrame {
         private JPanel buttonPanel;
         private DrawPanel myPanel;
         private JButton showButton;
         private JComboBox colorComboBox;
    private boolean isShow;
         private int shape;
         private boolean isFill=true;
    private String colorNames[] = {"black", "blue", "cyan", "darkGray", "gray",
    "green", "lightgray", "magenta", "orange",
    "pink", "red", "white", "yellow"}; // color names list in ComboBox
    private Color colors[] = {Color.black, Color.blue, Color.cyan, Color.darkGray,
                              Color.gray, Color.green, Color.lightGray, Color.magenta,
                              Color.orange, Color.pink, Color.red, Color.white, Color.yellow};
         public test() {
         super("Draw Shapes");
         // creat custom drawing panel
    myPanel = new DrawPanel(); // instantiate a DrawPanel object
    myPanel.setBackground(Color.white);
         // set up showButton
    // register an event handler for showButton's ActionEvent
    showButton = new JButton ("show");
         showButton.addActionListener(
              // anonymous inner class to handle showButton events
         new ActionListener() {
                   // draw a black filled square shape after clicking showButton
         public void actionPerformed (ActionEvent event) {
                             // call DrawPanel method setShowStatus and pass an parameter
              // to decide if show the shape
         myPanel.setShowStatus(true);
                   isShow = myPanel.getShowStatus();
                                            shape = DrawPanel.SQUARE;
                        // call DrawPanel method setShape to indicate shape to draw
                                            myPanel.setShape(shape);
                        // call DrawPanel method setFill to indicate to draw a filled shape
                                            myPanel.setFill(true);
                        // call DrawPanel method draw
                                            myPanel.draw();
                             myPanel.setFill(true);
                             myPanel.setForeground(Color.black);
                   }// end anonymous inner class
         );// end call to addActionListener
    // set up colorComboBox
    // register event handlers for colorComboBox's ItemEvent
    colorComboBox = new JComboBox(colorNames);
    colorComboBox.setMaximumRowCount(5);
    colorComboBox.addItemListener(
         // anonymous inner class to handle colorComboBox events
         new ItemListener() {
         // select shape's color
         public void itemStateChanged(ItemEvent event) {
         if(event.getStateChange() == ItemEvent.SELECTED)
         // call DrawPanel method setForeground
         // and pass an element value of colors array
         myPanel.setForeground(colors[colorComboBox.getSelectedIndex()]);
    myPanel.draw();
    }// end anonymous inner class
    ); // end call to addItemListener
    // set up panel containing buttons
         buttonPanel = new JPanel();
    buttonPanel.setLayout(new GridLayout(4, 1, 0, 50));
         buttonPanel.add(showButton);
    buttonPanel.add(colorComboBox);
    JPanel radioButtonPanel = new JPanel();
    radioButtonPanel.setLayout(new GridLayout(2, 1, 0, 20));
    Container container = getContentPane();
    container.setLayout(new BorderLayout(10,10));
    container.add(myPanel, BorderLayout.CENTER);
         container.add(buttonPanel, BorderLayout.EAST);
    setSize(500, 400);
         setVisible(true);
         public static void main(String args[]) {
         test application = new test();
         application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    coding 2
    import java.awt.*;
    import javax.swing.*;
    public class DrawPanel extends JPanel {
         public final static int CIRCLE = 1, SQUARE = 2;
         private int shape;
         private boolean fill;
         private boolean showStatus;
    private int shapeSize = 100;
    private Color foreground;
         // draw a specified shape
    public void paintComponent (Graphics g){
              super.paintComponent(g);
              // find center
    int x=(getSize().width-shapeSize)/2;
              int y=(getSize().height-shapeSize)/2;
              if (shape == CIRCLE) {
         if (fill == true){
         g.setColor(foreground);
              g.fillOval(x, y, shapeSize, shapeSize);
    else{
                   g.setColor(foreground);
    g.drawOval(x, y, shapeSize, shapeSize);
              else if (shape == SQUARE){
         if (fill == true){
         g.setColor(foreground);
                        g.fillRect(x, y, shapeSize, shapeSize);
    else{
                        g.setColor(foreground);
    g.drawRect(x, y, shapeSize, shapeSize);
    // set showStatus value
    public void setShowStatus (boolean s) {
              showStatus = s;
         // return showstatus value
    public boolean getShowStatus () {
              return showStatus;
         // set fill value
    public void setFill(boolean isFill) {
              fill = isFill;
         // set shape value
    public void setShape(int shapeToDraw) {
              shape = shapeToDraw;
    // set shapeSize value
    public void setShapeSize(int newShapeSize) {
              shapeSize = newShapeSize;
    // set foreground value
    public void setForeground(Color newColor) {
              foreground = newColor;
         // repaint DrawPanel
    public void draw (){
              if(showStatus == true)
              repaint();

    Hello,
    does setSelectedIndex(int anIndex)
    do what you need?
    See Java Doc for JComboBox.

  • How can I make a server differ between two or more clients?

    How can I make a server differ between two or more clients?
    The clients can connect and talk to the server fine, but how can I make the server talk to one, two or all clients? i.e. what would be a good way to implement this?
    Currently, the server listens for connections like this:
    while (listening) {
    try {
    new ServerThread(this, serverSocket.accept()).start();
    I guess one way would be to add the ServerThreads to a Hashtable with the client ID as key, and then get the ServerThread with the proper client ID, but this seems unnecessary complicated. Any ideas?

    Complicated was perhaps the wrong word, I should have
    written something like it doesn't "feel" right. Or is
    this a common and good way to solve communication
    between a server and multiple clients?Thats pretty much how I do it. I normally use an array or ArrayList of Sockets instead of HashTable, with [0] being the first player etc.... Then you can communicate with exactly who you want. If you want to send bytes to all of them, just send the same thing to each socket individually (or is there a better way to do this?).

  • How can I make Use of PS and Ai (offer) in spite of running Windows Vista ?

    How can I make Use of PS and Ai (offer) in spite of running Windows Vista ?

    Once you have signed up, you could - in theory - choose "other version" under the icon on the CC website and install CS6, but I'm not sure if that works for this special offer or only for "full" CC. Anyway, it seems simple enough to upgrade to Win 7 or Win 8 and perhaps you were planning on starting fresh, anyway...
    Mylenium

Maybe you are looking for