How to add gaussian white noise to array of one's and negative one's ?

how to add gaussian white noise to array of one's and negative one's ?
Solved!
Go to Solution.

Is it this that your are trying to accomplish:
TO:
Here's the code to do that.
Michel

Similar Messages

  • How Do I generate a Filtered gaussian white noise

    Can someone please help me on how I can generate filtered gaussian white noise in LabVIEW.

    Actually in the moment you specify a sample rate for your Gaussian white noise data you apply a filter equal to F_sample/2. But anyway If you want to have 10 seconds with white noise sampled with Y Hz in sample frequency. Then you create an white noise array, with 10xY samples or elements. Then you apply your filter 
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • Histogram of Gaussian White Noise with NI5112

    I am digitizing some random gaussian white noise with a NI-PXI 5112. The problem is that even with very high number of samples (1 Mega sample) the distribution presents a lot of periodic pikes when making a voltage histogram (either with built in function or by postprocessing data with Mathematica).
    I am using two synchronized digitizers and they both have the same behaviour (pikes symmetric around 0 and with periodicity), but give different response from one another.
    I already tried to filter the data, change the vertical range of both aquisition and generation devices, but the pikes always appear at the same relative values, and with the same relative number of counts.
    How can I overcome this problem ?

    Could you post a screenshot of your histogram? How many bins do you have in your histogram?
    Remember that the 5112 is an 8-bit boards so you only have (in the order of) 256 possible values so unless you 'hit' the exact values your bins will have un-equal weights. This could result in the periodic behavior you are observing.

  • Gaussian White Noise - Seed

    Hi everybody,
    I want to call the "Gaussian White Noise.vi" several times (lets say, in a loop) and thereby, I want to fully control the state of the random generator which is used in the VI.
    I think, that the "seed" input somehow determines the state of internal random generator (which is unfortunately "hidden" in a DLL).
    So, what I would like to have is an output parameter that returns the last state of the random generator .
    The idea is, that I can call the VI several times setting the "seed" input parameter equal to the state of the random generator of the last call. By this, I could get a reproducible stream of random numbers by simply setting the "seed" input parameter of the first call to a user defined value.
    I hope, I was able to explain my wishes.
    Thanks for all replies
    Stefan

    Hi Kevin,
    thanks for your good idea. This works fine.
    If a guy from NI reads this message: It would be helpful anyway, if the state of the random generator would be returned by the VI "Gaussian White Noise.vi". Think about an extensive simulation with a many iterations and after a certain time, an interesting result occurs. If one wants to reinvestigate this interesting result, one has the re-run the complete simulation until one gets to the time instant where the result occurs. If the state of the random generator would be availabe, one could save this state in each iteration and re-running the complete simulation would not be neccessary anymore. One would reload the state of the generator for the interesting iteration and would have to re-run a singe iteration. Would be much faster.
    Thanks again
    Stefan

  • How to add Column to Adobe flex mx:DataGrid in mxml and/or actionsctpt?

    I have simple mxml code
    <mx:DataGrid id="DGG"
                 editable="true">
        <mx:dataProvider>
            <mx:Object scheduledDate="4/1/2006"/>
        </mx:dataProvider>
    </mx:DataGrid>
    <mx:Button id="SetBut"
               label="Set Array as Data Provider"
               click="SetDP(); AddBut.visible = true;"
               x="100.5"
               y="164"
               width="211"/>
    <mx:Button id="AddBut"
               label="Add a column!"
               click="AddCol();"
               x="100.5"
               y="194"
               width="211"
               visible="false"/>
    <mx:Script>
        <![CDATA[
            import mx.controls.dataGridClasses.DataGridColumn;
            import mx.collections.ArrayCollection;
            [Bindable]
            public var MyAC:ArrayCollection=new ArrayCollection([{scheduledDate: "4/1/2006", homeTeam: "Chester Bucks"}]);
            public function SetDP():void
                DGG.dataProvider=MyAC
            public function AddCol():void
                MyAC.addItem({scheduledDate: "4/5/2007", homeTeam: "Long Valley Hitters", Umpire: "Amanda Hugenkis"});
                DGG.columns.push(new DataGridColumn("Umpire"));
        ]]>
    </mx:Script>
    I want to add rows to my table datagrid how to do such thing?
    How to add Column to Adobe flex mx:DataGrid in mxml and/or actionsctpt?
    (You can put this code in Flash or AIR app - it will compile with no errors, but will not add any columns=( )

    Change this:
                 public function SetDP():void
                    DGG.dataProvider=MyAC
                    MyAC.addItem({scheduledDate: "4/5/2007", homeTeam: "Long Valley Hitters", Umpire: "Amanda Hugenkis"});
                public function AddCol():void
                    var dgc:DataGridColumn = new DataGridColumn("Umpire");
                    var ca:Array = DGG.columns;
                    ca.push(dgc);
                    DGG.columns = ca;
    Dany

  • How to add an element to an array, then be able to remove it specifically

    So i have a list of numbers. The user is able to then add numbers to that list. I have a button which allows the user to remove any number of their choice by typing that number in a textbox. For some reason the numbers that the user add to the list will not dissapear when chosen whereas the original numbers go away no problem.
    The name of the array itself is mesEntiers and the name of the texbox is : IntegersIn_txt
    Here is the code :
    function supprimer(event:MouseEvent):void
      var indiceChiffre:int;
      indiceChiffre =(mesEntiers.indexOf(IntegersIn_txt.text));
      // La méthode indexOf renvoie l'indice d'un élément ou -1 si non trouvé.
      trace("testBtn")
      if (indiceChiffre != -1)
      for (var i=indiceChiffre; i <mesEntiers.length; i++)
      mesEntiers[i] = mesEntiers[i+1];
      trace("test")
      mesEntiers.pop();
      } // Fin fonction supprimer.

    Two things I can think of (I ran a small test)...
    1) Make sure your textfield is a single line, not multiline...  multilines end up with extra stuff in them that you can't see.
    2) Convert the text into a number unless the array is holding strings...  indiceChiffre =(mesEntiers.indexOf(Number(IntegersIn_txt.text)));

  • How to add new elements in an array of Objects of Type Figure??

    I have a Figure class which has many attributes(variables). Then I create an array of Figures for example
    Figs[] figures = new Figure[18];
    Later I need to add new Figures to this array at different positions. In my case I have to use the same array.
    Is there any way so I can add new Figure elements to this array??
    If u have an answer to this question, please share with me.
    Thanks
    Amit

    There are many ways to solve this problem, including creating new arrays as needed, and using System.arraycopy() to move things around. However, the best way is to use ArrayList, as discussed above.
    What you cannot do is use toArray() and cast back to String[]. Object[] is not a subclass of String[], even if all of the objects in the Object[] are Strings!
    There are two ways to get around this. Create a String[] and copy the Object[] into it with System.arraycopy, or the easy way, which is to use the toArray(Object[]) method. It allows you to specify by example the array class you wish returned. If the array is large enough, it will populate the array directly, otherwise it will create a new one of the same base class. That means any of the following approaches will work, the final decision is mostly a matter of style:
        // create a zero length array to pass as an exemplar
        public final static String STRING_ARRAY_TYPE[]  new String[0];
        String s[] = (String[]) a.toArray(STRING_ARRAY_TYPE);Or:
        String t[] = new String[a.size()];
        a.toArray(t);Or:
        String t[] = a.toArray(new String[a.size()]);;I prefer the first approach generally, and it avoids any race conditions between the evaluation of the ArrayList size and the toArray; however, since ArrayList methods are not synchronized, you probably should do some synchronizing of your own.
    Hope this helps.

  • How to add a new Shared Variable programmatically to an existing and deployed library?

    Hi there!
    I am trying to accomplish this on both LabVIEW 8.6 and LabVIEW 2010 and seems like it's not any different in this situation.
    My case: A project has a library with 4 Shared Variables (SVs). The library and the variables are deployed (visible in Distributed System Manager 8.6/2010). I want to add 2 more variables into this library. It is possible to do this manually from Project Explorer window's options menu. But while running an application it has to be done programmatically. Can I provide the library reference to the one currently existing without creating a new one?
    "Create Or Add Library To Project" function in the Datalogging and Supervisory Control (DSC) toolkit does not help in this case. That function, as the name suggests, just tries to create a new library in the project.
    Two possible methods:
    The function "Add Shared Variable To Library" (DSC>EngineControl>Libraries & Processes) needs a library reference, which could be provided via "CreateOrAddLibraryToProject" function, but this function tries to create a new library, and if I provide the path of the existing library it throws an exception that the library already exists in the project (yes, as I wrote above, I need to add new variables to an existing and deployed library).
    OR
    The function "Create Shared Variable" (DSC>EngineControl>Variables & I/O Servers) will add Shared Variable in a process, and not physically in a library file, and the problem (limitation) with this approach is that it doesn't allow to add complex data type Shared Variables (for example in LabVIEW 8.6 it has only 4 datatype options in input parameter, and even in LV2010 it does not have "Image" datatype that I need).
    The scond method is my preferred method as it allows to work on Online Shared Variables and doesn't create them physically in libraries (and this is good as the variables' scope remains only till the Variable Engine is running). But it doesn't support advanced data types, and the first method is powerful in terms that it supports to virtually any datatype, it just seems tricky to get that reference to the library.
    Any tips?
    Thanks ahead!
    Vaibhav

       <<<<>>>>   
    As the above two images show, while a library does not exist, it is easy to use the "CreateOrAddLibraryToProject.vi" which will add a new library to the project (if it doesn't exist on file system, a new library will be created) and that way, using the reference (the green wire going out from the function and the Case Structure, can be used to add Shared Variables to the library. The problem was what to do when a library already exists in the project, how to add more variables to it. I was looking for a way to get a library reference, and somehow I could not see it inside a Project's property (VI Server functions). Hence I posted the question. And upon continuing my search, I found it on the Application's property list.
    I hope it was useful for someone else as well. And thanks for the replies. Please share a better idea if you have.
    Vaibhav

  • Office 2013 add-in - How to add custom button in existing tab/group at home and the same at individual message level?

    Hello Everyone,
    Currently, I'm developing an outlook add-in and would like to setup a custom ribbon button at one of the existing tabs at home screen and at message level too, when
    it is opened from home screen.
    Following are the helpful screen prints.
    Any help would be much appreciated.
    Thanks, <b>Ankit Shah</b> <hr> Inkey Solutions, India. <hr> Microsoft Certified Business Management Solutions Professionals <hr> http://ankit.inkeysolutions.com

    Hello Ankit,
    All you need is to specify the IdMso value of the built-tab where you want to place your controls. See
    How to: Customize a Built-in Tab for more information (TabMail and TabReadMessage).
    You can find the list of built-in controls in the following documents:
    Office 2010 Help Files: Office Fluent User Interface Control Identifiers
    Office 2013 Help Files: Office Fluent User Interface Control Identifiers
    The Fluent UI is described in depth in the following series of articles in MSDN:
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)

  • How to add elements into java string array?

    I open a file and want to put the contents in a string array. I tried as below.
    String[] names;
    s = new Scanner(new BufferedReader(new FileReader("outfile.txt")));
    while (s.hasNext()) {
                    String item = s.next();
                    item.trim();
                    email = item;
                    names = email;
                }But I know that this is a wrong way of adding elements into my string array names []. How do I do it? Thanks.

    Actually you cannot increase the size of a String array. But you can create a temp array with the lengt = lengthofarray+1 and use arraycopy method to copy all elements to new array, then you can assign the value of string at the end of the temp array
    I would use this one:
    String [] sArray = null;
    s = new Scanner(new BufferedReader(new FileReader("outfile.txt")));
    while (s.hasNext()) {
        String item = s.next();
        item.trim();
        email = item;
        sArray = addToStringArray(sArray, email);
    * Method for increasing the size of a String Array with the given string.
    * Given string will be added at the end of the String array.
    * @param sArray String array to be increased. If null, an array will be returned with one element: String s
    * @param s String to be added to the end of the array. If null, sArray will be returned.(No change)
    * @return sArray increased with String s
    public String[] addToStringArray (String[] sArray, String s){
         if (sArray == null){
              if (s!= null){
                   String[] temp = {s};
                   return temp;
              }else{
                   return null;
         }else{
              if (s!= null){
                   String[] temp = new String[sArray.length+1];
                   System.arraycopy(sArray,0,temp,0,sArray.length);
                   temp[temp.length-1] = s;
                   return temp;
              }else{
                   return sArray;
    }Edited by: mimdalli on May 4, 2009 8:22 AM
    Edited by: mimdalli on May 4, 2009 8:26 AM
    Edited by: mimdalli on May 4, 2009 8:27 AM

  • How to add new fields for FB01 transaction both at Header and Line item

    Hi Guys,
    I would like to add the new fields at header and item level in FB01 transaction. Can I acheive this by using transaction EEWB....please help me on this.
    Thanking you

    Hi,
    We are trying to copy a work flow objects from ECC6.0 to 4.6C...where we found the following Select statement.
    *Determine Top WorkItem Instance
      if im_top_wi_id is initial.
       select wi_id top_wi_id wi_rh_task into lw_top_id from sww_wi2obj
         up to 1 rows
         where wi_rh_task = im_wftask and
               catid      = 'BO'      and
               instid     = l_instid  and
               typeid     = 'FIPP'.
       endselect.
       endif
    As table sww_wi2obj can't be found in 4.6C, can any one help how to replace or implement the same logic as above statements.
    Thank you....

  • How can I do to share the array elements between "C" and "Java"

    Hi,all
    I want to implement the function about this: c and java between JNI can share the same data area. For example, when change the value of the array in java, i can get the same value in c.
    I use the function:Xxx* GetXxxArrayElements(JNIEnv env, jarray array, jboolean isCopy)
    But i find that the "isCopy" is JNI_TRUE which means that i get the pointer which point to a copy,so i can't get the change
    in Java later.
    How can I do?Can i set "isCopy" with JNI_FALSE??
    Thank u.

    No, you can't. isCopy is of type jboolean*, and the value is just set by the call to inform you whether the data was copied or not, but you cannot infulence that.
    In fact, the VM might store an array of primitives in a different way as C, and this routine has to convert between the two representations. In this case copying is always required.

  • How to add two sets of arraylists together into one?

    Hi there
    I am trying to finish my assignment for a car dealer..
    welll i have got two arrays in my Dealaership Class
    I did something like
    ArrayList customerSoldCars;
    ArrayList customerBotCars;
    I was wondering if it's possible to add them together as in something like
    ArrayList allCustomer = customerSoldCars + customerBotCars;
    so that i can just create a method something called listAllCustomers()
    which will be showing the list of both "customers who sold the their cars to the dealer" and "customers who bot the cars from the dealer"
    any help would b highly appriciated..
    cheerz

    You can use a Set (in order to avoid duplicates.)
    Then you simply add your lists' customers to the set using the addAll method.
    This way, you will obtain all your customers from the two lists merged into a single collection.
    Finally, if you really need a List, you can create one out of the Set.

  • How to add Footage to existing With different Pixel aspext ratios and/or frame rate?

    Can someone help me? I am working on a project. I shot footage with my Canon XA10 and with my DSLR. I want to put footage in my film from both. What is correct way to add both of these in one film so it looks correct. Aspect and frame rates are different for both.
    I have tried making a new sequence with correct aspect ratio and then adding that sequence to project but it is still not correct. Hope I am making sense!
    thank you!
    kim

    Don't bother. PR is fully capable of handling that for you. Take a look at PPBM5 Benchmark
    The test timelines contain PAL and NTSC material, DV, HDV, AVCHD and in the new version even XF 422 material, all in a single timeline.

  • How to add many bounded task flow just on one only .jspx page?

    Dear all
    I will explain you what I do and What I want to do.
    I created one jsf page template called "baseTemplate". It contains only one panelSpliter with horizontal layout . In the first face I created 10 commandLinks as a menu. the second facet contains the facet ref.
    My task is now to create 10 task flows.
    What i do is:
    1- create bounded task flow name it "taskFlow1" and add all the views and page navigations that I want.
    2- double click the views and create them as page fragment and design the layout.
    3- create .jspx page name "task1.jpx" based on "baseTemplate".
    4- dragging and dropping "taskFlow1" into "task1.jspx" as a region
    5- repeating steps from 1 to 4 with "task2.jspx" till "task10.jspx"
    in this way i created 10 "jspx" pages for each task flow
    What i want to do is:
    I want to create just one and only one ".jspx" page and drag all task flows on it. And when clicking on any command link from the menu , the corresponding task flow is invoke.
    Is this a way to do this.
    Thank you in advance.

    of course, there is.simply in the unbounded Task flow drag your task flow as task flow call and specify the outcome, and make the action of your command link
    the outcome you specify, of course you will navigate to the default activity of the bounded task flow also you could open your task flow as lightweight dialog
    as frank do in his example

Maybe you are looking for