Stretching data to fit a specific window

4 ビュー (過去 30 日間)
Brig
Brig 2012 年 6 月 11 日
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 件)

カテゴリ

Help Center および File ExchangeCurve Fitting Toolbox についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by