Santiago Barreda
Assistant Professor, Department of Linguistics, UC Davis

Main Research Vignettes CV phonTools Statistics Links


resample [phonTools]


Resample a signal using sinc interpolation. the interpolation can be made as precise (or not) as desired. In the example below, a signal has been downsampled and then sampled back to its original rate. The three versions of the signal are compared.



Code used to generate examples:

data (sound) # downsample and then upsample the sound back to # its original sampling frequency downsamped = resample (sound, 11025) upsamped = resample (downsamped, 22050) # compare a part of the waveforms for all three sounds par (mfrow = c(3,1), mar = c(4,4,1,1)) plot (sound$sound[1:14000], type = 'l') plot (upsamped$sound[1:14000], type = 'l', col = 2) plot (downsamped$sound[1:7000], type = 'l', col = 4)