簡體   English   中英

在matlab中恢復正弦函數的參數

[英]recovering the argument of a sinusoidal function in matlab

我有一個實驗測量值,看起來像一個正弦曲線,因此該函數可以建模為sin(x) 如果我將asin函數應用於數據, asin得到一個三角函數。 我想知道是否有一種形式可以像解開那樣獲得對應於x的直線。 任何意見將不勝感激。

unwrap僅適用於功能跳躍的鋸齒模式。 所以我的想法是從您的函數中創建這樣的鋸齒圖案,然后應用展開。

%example function
x=0:.1:10;
y=sin(x);
%invert
x1=asin(y);
%detect rising and falling
s=[true,diff(x1)>0];
%continue falling segments rising, using the negative slope
x2=x1.*s+(pi-x1).*(1-s);
%finally use unwrap
x3=unwrap(x2);

%code for the plot
%plot(x,y,x,x1,x,s,x,x2)
%legend({'y','x1','s','x2'})

在此處輸入圖片說明

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM