how to compute average power of the generated sinusoidal signal?

조회 수: 3 (최근 30일)
Snow sin
Snow sin 2018년 4월 5일
답변: Abraham Boayue 2018년 4월 6일
lim1 = 0;
lim2 = 2*pi;
t = lim1:0.01:lim2;
A = 1.5;
f = 0.1;
omega= 2*pi*f;
phase= 0;
x = A*cos(omega*t+phase);
plot(t,x);
the following is my signal graph ? hohw should i compute the average power of the signal? how do i write out the formula?? for the average power signal
Px= limN→∞(1/2N+1) ∑|x(n)|^2

답변 (2개)

Abraham Boayue
Abraham Boayue 2018년 4월 5일
Try this code, just an extension of your code.
clear variables
close all;
lim1 = -10;% no need to have t in pi
% units since omega is
% already measured in pi.
lim2 = 10;
M = 500; % length of
delta = (lim2-lim1)/(M-1);
t = lim1:delta:lim2;
A = 1.5;
f = 0.1;
omega= 2*pi*f;
phase= 0;
x = A*cos(omega*t+phase);
N = 10; % let say you want to average
% 10 terms of x
px = zeros(1,M);
for n = 1:N
px = px + (abs(A*cos(n*omega*t+phase))).^2;
end
px = (1/(2*N+1))*px;
%disp(px)
figure
plot(t,x,'linewidth',2);
hold on
plot(t,px,'linewidth',2)
a = ylabel('Signal');
set(a,'Fontsize',14);
a = xlabel('x');
set(a,'Fontsize',14);
a=title('x(t) and its average px');
legend('x(t)','px')
set(a,'Fontsize',16);
grid;
  댓글 수: 1
Snow sin
Snow sin 2018년 4월 6일
Hi, thanks for the code, i tried it and have some question... Why your px values have 2 answer? shouldn't the average power value is a single value??

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


Abraham Boayue
Abraham Boayue 2018년 4월 6일
Are you saying that px = 1/(2×N+1)[(Acos(wt))^2 + (Acos (2wt))^2 +... (Acos(N*wt))^2] should equal a single number? How possible is that? No way! According to the formula that you provided, you are simply summing a series of cosine squares and then dividing the result by 1/(2*N+1). You are actually performing an ensamble averaging on a time varying function and the result show be a time varying function. If you choose N large enough, you should end up with a delta function, a single value function that occurs at the peak of the cosine wave.

카테고리

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