Samples per second in a row vector in Matlab? I wrote two functions in MATLAB, function called half that removes every other element from an arbitrary length vector, creating a shorter vector made of only the odd-numbered elements of the original vector; and a MATLAB function double that creates a longer vector by adding an additional element between neighboring elements in the original vector (Each new
element should equal the average of its neighboring elements).  
If you sample a $100\textrm{ Hz}$ tone at $8000$ samples per second, and store the samples as a row vector, what will be the effect of half and double on the pitch and duration of the tone if the playback rate is identical to the sampling rate? In other words, what is the new pitch in Hertz, and duration in seconds of the new sample in each case?
Duration is just the length of the signal. half makes the duration half, and double makes it double!
Pitch is the auditory sensation of the frequency. If you double the length of a signal (given the rate of playback remains the rate of sampling) then it will sound like a lower frequency. Similarly, when you make it half, it will sound like a higher frequency.


The code you can use to hear it:

fs = 8000;  % sampling frequency
duration = 1; % seconds
f0=100; % frequency
t=0:1/fs:duration; %time axis
wave = 10*sin(2*pi*f0*t);
sound(wave,fs) % original tone
pause
half_wave = wave(1:2:end);
sound(half_wave,fs) % half duraton, double pitch
pause
double_wave = interp1(linspace(0,1,numel(wave)),wave ,linspace(0,1,numel(wave)*2-1));
sound(double_wave,fs) % double duration, half pitch