Stretching data to fit a specific window
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi all,
I have large amounts of data that are sampling at incorrect intervals. I want to compare the signals, but they don't properly line up because of the sampling rate. I want to be able to stretch or shrink the data to a specific number of samples, but maintain overall shape.
x = linspace(0,2*pi,110);
Y = sin(x);
xi = linspace(0,10);
yi = interp1(x,Y,xi);
plot(xi,yi)
What I want out of this is one full cycle of a sin wave, but stretched from a period of 2*pi and 110 samples to a period of 10 with 100 samples even.
I'm sure there is an easy way to do this, but I've been racking my brain and can't seem to find a solution.
0 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Curve Fitting Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!