Apologies if this makes no sense or seems rather simple, I'm a Matlab newbie.
Basically, I've got a .wav audio waveform which I am resampling to various different frequencies and then trimming the length to a second (44100 samples). However, when resampling to certain tones, such as the note C3 or A5, I'm not left with enough samples to trim the note to an acceptable length.
Obviously this means that the sample needs extending, which I've worked out can be done taking a sample period
s2 and adding that onto the end as many times as is necessary.
extendedSignal = x(1:s1-1); for i = 1:4 extendedSignal = vertcat(extendedSignal, x(s1:s2)); end extendedSignal = vertcat(extendedSignal, x(s2:44100));
However, when it comes to finding a continuous period in which to sample, I cannot seem to find one for any note which does not sound like it is being repeated. Am I missing something really obvious?