title: How to calculate SNR of signals in MATLAB?
body: <p>I've encountered a very simple, yet fundamental problem on calculating the SNR:</p>
  
  <p>There are several signals :</p>
  
  <ul>
  <li><p>S1 = original and pure clean signal without noise.</p></li>
  <li><p>N1 = white Gaussian noise which is going to be added to S1.</p></li>
  <li><p>S2 = S1 + N1 (the noisy signal before performing the noise-reduction algorithm)</p></li>
  <li><p>S3 = noise-reduced signal (after performing noise reduction algorithm)</p></li>
  <li><p>N2 = S3 - S1 (the amount of noise after performing the noise-reduction algorithm)</p></li>
  </ul>
  
  <p>Now I want to compare the SNR before and after performing the noise-reduction algorithm.</p>
  
  <ol>
  <li><p>Which signals should I consider for SNR_before!? <strong>S1/N1</strong> or <strong>S2/N1</strong> ?</p></li>
  <li><p>Which signals should I consider for SNR_after!? <strong>S3/N1</strong> or <strong>S3/N2</strong> ?</p></li>
  <li><p>Which commands or functions should I use in MATLAB in order to compute SNR_before and SNR_after?</p></li>
  </ol>
  
  <p>Thanks a billion for putting your time on helping me.</p>