title: Filtering signal with white gaussian noise in MATLAB
body: <p>I have a signal/vector with high amplitude white gaussian noise and I'm trying to get a binary signal (0 or 1). The sampling frequency is 10Hz.</p>
  
  <p>I applied a simple 2nd order Butterworth filter in MATLAB as follows;</p>
  
  <pre><code>   x=sig_bruit_BB1;
     [b,a]=butter(2,0.1,'low');
     y = filter(b,a,x);
     plot(x)
     subplot(3,1,2)
     plot(y)
     for i=1:1:1820
         x=y(1,i);
         if (x&lt;0.5)
             code(1,i)=0;
         else
             code(1,i)=1;
         end
     end
     subplot(3,1,3);
     plot(code)
  </code></pre>
  
  <p>As you can see, I did a <em>for</em> loop assuming that any signals smaller than 0.5 is equal to 0 and greater equals to 1. </p>
  
  <p>Can somebody verify if this method is applicable to obtain a binary signal ? </p>
  
  <p>Thanks.</p>