title: Adding echo to recorded audio
body: <p>I have recorded my own voice in Matlab and I intend to add some echo to it.I came up with one solution for getting the desired echo effect:</p>
  
  <ul>
  <li><strong>Delay the sampled audio in the time domain and adding it to the original sample</strong>.</li>
  </ul>
  
  <p>In order to do this I'm using Matlab and I have basically done the following:</p>
  
  <pre><code>recObj = audiorecorder(44100, 16, 2);%sampling rate of 44100Hz, stereo
  recordblocking(recObj,length);%record audio for a fixed length duration
  y = time_delay(getaudiodata(recObj) , 5000 );%set a delay of 5000 to original sampled audio data
  
  function [ y ]  = time_delay ( x , R )
  %this function sets a delay to x of R
  y = zeros(length(x) + R , 1);
  y(R + 1:length(y)) = x(1:length(x));
  </code></pre>
  
  <p>As you can see I have a recObj wich I can use for playing the recorded audio.In order to get a delayed version of the recorded audio I have used getaudiodata(recObj) and my own function time_delay.A problem that I have is that I don't know how to get a new delayed audiorecorder object from the delayed audio data retrieved by the time_delay function and I need an audiorecord object cause this is the only way of playing something.
  So, my question is:</p>
  
  <ul>
  <li>Is this a good approach to get the desired echo effect in an audio
  signal?</li>
  <li>If it is, then how do I set the delayed audio data to an<br>
  audiorecorder object?</li>
  </ul>