필터 지우기
필터 지우기

find the mean, energy and power of cosine function

조회 수: 7 (최근 30일)
Passband  Modulation
Passband Modulation 2012년 9월 21일
댓글: Abdullah Zubair 2020년 2월 21일
i am just a matlab beginner.
x[n]=2cos(0.2*pi*n) with a length of N =100 , that is, ,0<N<99 plotted
clear all
n=[0:99];
x=2*cos(0.2*pi*n);
stem(n,x);
legend('x[n]');
title('Sequence of 2*cos(0.2*pi*n)');
xlabel('n');
ylabel('x[n]');
axis([0 99 -2 2]);
how to use MATLAB to compute the mean, and energy and power of x[n]given mean=x, energy=Ex and power=Px.

채택된 답변

Wayne King
Wayne King 2012년 9월 21일
편집: Wayne King 2012년 9월 21일
You can just do:
mean(x)
Ex = norm(x,2)^2 % the energy
Px = 1/numel(x)*norm(x,2)^2 % power
If you don't want to use norm(), you just use sum()
Ex = sum(abs(x).^2)
Px = 1/numel(x)*sum(abs(x).^2)
Note that the RMS of the signal is
sqrt(Px)
The Signal Processing Toolbox implements this as rms()
  댓글 수: 3
Walter Roberson
Walter Roberson 2013년 12월 18일
pinak parida commented,
power ,energy of a signal how norm works to be check?
Abdullah Zubair
Abdullah Zubair 2020년 2월 21일
mean(x)
Ex = norm(x,2)^2 % the energy
Px = 1/numel(x)*norm(x,2)^2 % power
what is this 2 in norm function is for?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by