Mean and effective value of a function over one period

3 ビュー (過去 30 日間)
Randy Marsh
Randy Marsh 2017 年 4 月 25 日
コメント済み: Star Strider 2017 年 4 月 25 日
How to compute mean and effective value of a function s(t)=2cos(2pi*f*t) for f=5Hz over one period, with discretization step 0.001?
Code for plotting discrete function:
t=0:.001:.25; %random interval
x=2*cos(2*pi*5*t);
stem(x);

採用された回答

Star Strider
Star Strider 2017 年 4 月 25 日
The ‘mean’ value is just that:
mean_x = mean(x);
I don’t know what you intend by ‘effective value’. If you mean RMS, it’s the square root of the mean of the squared value of the signal:
RMS_x = sqrt(mean(x.^2));
  4 件のコメント
Randy Marsh
Randy Marsh 2017 年 4 月 25 日
This code doesn't compute mean value and effective value (magnitude):
t=0:.001:.25; %random interval
x=2*cos(2*pi*5*t);
stem(x);
mean_x=mean(x);
RMS_x = sqrt(mean(x.^2));
dsp(mean_x);
dsp(RMS_x);
Could you point out why this doesn't work?
Star Strider
Star Strider 2017 年 4 月 25 日
I don’t have the DSP System Toolbox, so if it’s necessary to use it to find out what’s wrong, I can’t.

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by