Inject noise signals to LTP

We can inject any type of signal in to the simulations. In the previous section we injected sinusoidal siganls. Here we inject noise.

Let's start by making some random noise time-series data:

      % Create a noise time-series analysis object to inject
      fs    = 1/ltp.timestep;
      nsecs = 1000;
      noise = ao.randn(nsecs, fs);     
      % Generate a list of outputs we want from the simulator      
      outputs = ltp.getPortNamesForBlocks(plist('blocks', {'DELAY_IFO', 'IS'}, 'type', 'outputs'));
      % Create the plist to configure simulate      
      sim_pl = plist('AOS', noise, 'AOS Variable Names', 'TESTSIGNAL.tm1_x', 'return outputs', outputs)
      % Run the simulation      
      out = simulate(ltp, sim_pl);
You can then plot the output signals by doing the following:
      % Create a plist to configure iplot to plot with subplots
      plot_pl = plist('arrangement', 'subplots');
      % First extract the internal AOs we want and then plot
      o1  = out.getObjectAtIndex(1);
      o12 = out.getObjectAtIndex(4);
      IS_tm1_x = out.getObjectAtIndex(7);
      IS_tm2_x = out.getObjectAtIndex(13);
      % Then plot the IFO and IS signals together
      iplot(o1, o12, plot_pl);
      iplot(IS_tm1_x, IS_tm2_x, plot_pl);

©LTP Team