フィルターのクリア

How to perform a proper interpolation with only few data points

9 ビュー (過去 30 日間)
Luki
Luki 2017 年 1 月 17 日
コメント済み: Star Strider 2017 年 1 月 17 日
I want to interpolate the following data:
I was trying:
interpolation = interp1(frequency,linear scaling,'spline')
But this doesn't work well at all! Is there a better way?

採用された回答

Star Strider
Star Strider 2017 年 1 月 17 日
You need a vector of independent values to interpolate. Note that the variable name ‘linear scaling’ (with the included space) is not a valid MATLAB variable name, and with the space would throw an error because there is no required comma (,) to separate the arguments. I added the underscore to rename it ‘linear_scaling’.
See if this improves your results:
freq_intrp = linspace(min(frequency), max(frequency), 50);
interpolation = interp1(frequency, linear_scaling, freq_intrp, 'spline');
I chose 50 points (third argument to linspace) between the frequency limits. Use as many points as you like.
  2 件のコメント
Luki
Luki 2017 年 1 月 17 日
works like a charm! thank you so much!
Star Strider
Star Strider 2017 年 1 月 17 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by