i need a Matlab function to generate a sinusoidal sequence,

<pre>

15 件のコメント

Aash
Aash 2017 年 10 月 16 日

KSSV
KSSV 2017 年 10 月 16 日
Read about sin. What exactly is your question?
Aash
Aash 2017 年 10 月 16 日
x[n] = Asin(w0n + phi) The function should accept the desired length N, amplitude A, angular frequency W0, and phase phi, where 0 ≤ W0 ≤ pi and 0 < phi ≤ pi.
Aash
Aash 2017 年 10 月 16 日
this is my question. I hope someone can answer
KSSV
KSSV 2017 年 10 月 16 日
Read about Sin.it is a striaght forward attempt.
Walter Roberson
Walter Roberson 2017 年 10 月 16 日
Do you mean
x = A * sin(W0 + phi)
But what is the length N affecting? You kind of imply that it is affecting the length of the angular frequency, but you also say that angular frequency is given. Is it a starting angular frequency? If so then how far apart should the other angular frequencies be?
Aash
Aash 2017 年 10 月 16 日
編集済み: Walter Roberson 2017 年 10 月 16 日
this is what i want. x = A* sin(w0 n +phi).
The function should accept the desired length n, amplitude A, angular frequency W0, and phase phi, where 0 ≤ W0 ≤ pi and 0 < phi ≤ pi.
Walter Roberson
Walter Roberson 2017 年 10 月 16 日
Is that an implied multiplication between the w0 and the n?
A * sin(w0 * n + phi)
? If so then how is the n there intended to relate to "the desired length n" ?
What is supposed to be length n? n is the number of full cycles to show? n is to be the number of samples? n is to be the length in centimeters of the display on the graph??
Aash
Aash 2017 年 10 月 16 日
x[n] = A* (w0 * n + phi)
yes there is a multiplication between them
Walter Roberson
Walter Roberson 2017 年 10 月 16 日
What is supposed to be length n? n is the number of full cycles to show? n is to be the number of samples? n is to be the length in centimeters of the display on the graph??
Aash
Aash 2017 年 10 月 16 日
n is the time index in x axis of graph. attached is the graph I need to create
Walter Roberson
Walter Roberson 2017 年 10 月 16 日
That example plot violates the constraints given in the equation. In the equation, 0 < W0 < pi, but the example plot has W0 = 1.2 * pi
Aash
Aash 2017 年 10 月 16 日

(a) Write a Matlab function to generate a sinusoidal sequence, x[n] = A sin(w0 * n+ phi) . The function should accept the desired length N, amplitude A, angular frequency w0, and phase phi, where 0 <

Aash
Aash 2017 年 10 月 16 日
This is the whole question
Walter Roberson
Walter Roberson 2017 年 10 月 16 日
I am not sure what you need me to do about this. Do you need me to call the person who set the assignment for you and point out to them that the question is wrong, that it clearly requires that w0 be less than pi, but also requires that w0 be 1.2 pi? If so then I will need to know their name and phone number and the times I can expect to reach them (and the time zone.) (Also, if I will need an interpreter, I will need to know that.)

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

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 10 月 16 日

0 投票

stem(0:40,sqrt(3)*sin(1.2*pi*(0:40)+.3))

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

質問済み:

2017 年 10 月 16 日

コメント済み:

2017 年 10 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by