How to use interp1()?

2 visualizaciones (últimos 30 días)
ftftft
ftftft el 24 de Jul. de 2015
Respondida: Walter Roberson el 24 de Jul. de 2015
I'm trying to interpolate an array of size nearly 2000. The step size I want is 'frequency'(size 101) and the array is 'ref_fft'. I'm unsure of the last argument. I want the interpolated array to be of size 101 but want to select a particular section from the original array (the corresponding values of 0 to 1 THz). Could someone please help me out with this?
i
%The resulting step size
xq = ((2*230)^-1).*frequency;
ref_fft = abs(fft(ref_ampl));
interpolated = interp1(frequency, ref_fft, xq);
plot(interpolated)
end
Thanks in advance

Respuestas (1)

Walter Roberson
Walter Roberson el 24 de Jul. de 2015
I suggest you construct xq using linspace()

Categorías

Más información sobre Interpolation en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by