interp                package:signal                R Documentation

_I_n_t_e_r_p_o_l_a_t_e / _I_n_c_r_e_a_s_e _t_h_e _s_a_m_p_l_e _r_a_t_e

_D_e_s_c_r_i_p_t_i_o_n:

     Upsample a signal by a constant factor by using an FIR filter to
     interpolate between points.

_U_s_a_g_e:

     interp(x, q, n = 4, Wc = 0.5)

_A_r_g_u_m_e_n_t_s:

       x: the signal to be upsampled. 

       q: the integer factor to increase the sampling rate by. 

       n: the FIR filter length. 

      Wc: the FIR filter cutoff frequency. 

_D_e_t_a_i_l_s:

     It uses an order '2*q*n+1' FIR filter to interpolate between
     samples.

_V_a_l_u_e:

     The upsampled signal, an array of length 'q * length(x)'.

_A_u_t_h_o_r(_s):

     Original Octave version by Paul Kienzle pkienzle@user.sf.net.
     Conversion to R by Tom Short.

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://en.wikipedia.org/wiki/Upsampling>

     Octave Forge <URL: http://octave.sf.net>

_S_e_e _A_l_s_o:

     'fir1', 'resample', 'interp1', 'decimate'

_E_x_a_m_p_l_e_s:

     # The graph shows interpolated signal following through the
     # sample points of the original signal.
     t = seq(0, 2, by = 0.01)
     x = chirp(t,2,.5,10,'quadratic') + sin(2*pi*t*0.4)
     y = interp(x[seq(1, length(x), by = 4)],4,4,1)   # interpolate a sub-sample
     plot(t, x, type = "l")
     idx = seq(1,length(t),by = 4)
     lines(t, y[1:length(t)], col = "blue")
     points(t[idx], y[idx], col = "blue", pch = 19)

