How to Generate Smooth Transitional Trapezoidal Signal in Simulink

63 ビュー (過去 30 日間)
Chuguang Pan
Chuguang Pan 2024 年 6 月 3 日
コメント済み: Mathieu NOE 2024 年 6 月 5 日
Hi, everyone. I want to generate a custom signal demonstrated as follow image in Simulink, I have tried the Signal Editor Block, but the generated trapezoidal signal does not have smooth transition as showed in the attached image.
I would be appreciated that someone could give me some suggestions.
  2 件のコメント
Sam Chak
Sam Chak 2024 年 6 月 3 日
If you are looking for a one-line math equation for describing the smooth trapezoid, consider the Generalized Gaussian Distribution (GGD) other one-hump functions. However, it is probably easier to achieve that with the piecewise S-curve continuous function.
Chuguang Pan
Chuguang Pan 2024 年 6 月 3 日
@Sam Chak Thanks for your suggestion, I will try it.

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

採用された回答

Mathieu NOE
Mathieu NOE 2024 年 6 月 3 日
hello
whatever code you use to create the trapezoidal wave , you can simply then smooth it out, for example with smoothdata
a = 10; %Amplitude
m = 2; %Time Period
l = 5; %Horizontal Spread
c = 2; %Vertical Spread
x = 0:.01:10; %Sample Points
Trapezoidal_Wave = a/pi*(asin(sin((pi/m)*x+l))+acos(cos((pi/m)*x+l)))-a/2+c;
Trapezoidal_Wave_S = smoothdata(Trapezoidal_Wave,'gaussian',50);
plot(x,Trapezoidal_Wave,x,Trapezoidal_Wave_S);
  2 件のコメント
Chuguang Pan
Chuguang Pan 2024 年 6 月 5 日
@Mathieu NOE Thanks for your answer, it is helpful.
Mathieu NOE
Mathieu NOE 2024 年 6 月 5 日
my pleasure !!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatched Filter and Ambiguity Function についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by