Sinusoidal signal wave plotting

5 ビュー (過去 30 日間)
Steph surry
Steph surry 2020 年 11 月 11 日
編集済み: VBBV 2025 年 6 月 23 日
a script creating a sine wave with 3 units amplitude and length of 50?
% Generation of a sinusoidal sequence n = 0:40; f = 0.1; phase = 0; A = 1.5; arg = 2*pi*f*n - phase; x = A*cos(arg); clf; % Clear old graph stem(n,x); % Plot the generated sequence axis([0 40 -2 2]); grid; title(’Sinusoidal Sequence’); xlabel(’Time index n’); ylabel(’Amplitude’);

回答 (2 件)

Mario Malic
Mario Malic 2020 年 11 月 11 日
One of these will solve your issue:

VBBV
VBBV 2025 年 6 月 23 日
編集済み: VBBV 2025 年 6 月 23 日
@Steph surry To get a sinusoidal signal, use a sutable frequency for input signal.
n = 0:0.5:50;
f = 5; % use a suitable frequency
phase = 0; A = 3;
arg = 2*pi*f*n - phase;
x = A*cosd(arg);
% Clear old graph
stem(n,x); % Plot the generated sequence
axis([0 40 -3 3]); grid; title('Sinusoidal Sequence'); xlabel('Time index n'); ylabel('Amplitude');

カテゴリ

Help Center および File ExchangeSignal Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by