function Y=upresample(X,P,Q,N) % RESAMPLE Change the sampling rate of a signal. % Y = RESAMPLE(X,P,Q,N) uses a weighted sum of 2*N*max(1,Q/P) samples of X % to compute each sample of Y. The length of the FIR filter RESAMPLE applies % is proportional to N; by increasing N you will get better accuracy at the % expense of a longer computation time. If you don't specify N, RESAMPLE uses % N = 10 by default. If you let N = 0, RESAMPLE performs a nearest % neighbor interpolation; that is, the output Y(n) is X(round((n-1)*Q/P)+1) % ( Y(n) = 0 if round((n-1)*Q/P)+1 > length(X) ). % % Author(s): F. Patanč, 2000 Af=appendmirror(X); Y=resample(Af,P,Q,10); r=size(Y,1)/3; Y=Y((r+1):(2*r),:);