title: Increasing frequency of signal
body: <p>Greetings All</p>
  
  <p>I went back and used <a href="http://www.mathworks.com/help/toolbox/signal/resample.html" rel="nofollow noreferrer">resample</a> (from the signal processing toolbox) and repmat, but I'm noticing that on some of the values the rows aren't the same as the sample rate, see image link below.  notice the top image value for rows says 1000 and the bottom image says rows = 1008.  This happens when I change the values of resample and repmat (freq_new) but only for certain values.  How can I fix this correctly?  I could just delete everything after 1000 but I'm not sure if this is a bug or just the way resample/repmat works. PS: using matlab/octave</p>
  
  <p><img src="https://i.stack.imgur.com/0USR5.png" alt="http://dl.dropbox.com/u/6576402/questions/rows_different.png"></p>
  
  <p>Here's the test code I used to test this</p>
  
  <pre><code>%resample_repmat signal
  clear all, clf
  Fs = 1000; % Sampling rate
  Ts = 1/Fs; %sampling interval
  t=0:Ts:1-Ts; %sampling period
  
  freq_orig=1;
  y=sin(2*pi*t*freq_orig)'; %gives a short wave
  
  freq_new=9;
  y2=resample(y,1,freq_new); %resample matrix
  y3=repmat (y2,freq_new,1); %replicate matrix
  
  [r_orig,c_orig] = size(y) %get orig number of rows and cols
  [r_new,c_new] = size(y3) %get new number of rows and cols
  
  subplot(2,1,1),plot(y),title('Orginal signal')
  title(['rows=',num2str(r_orig),' cols=',num2str(c_orig)])
  subplot(2,1,2),plot(y3),title('New signal')
  title(['rows=',num2str(r_new),' cols=',num2str(c_new)])
  </code></pre>