Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% Calculate the power of the sum of a signal and the same signal shifted in phase
- clear all; close all; clc;
- % Generate signal
- fs = 100000;
- t = 0:1/fs:1;
- fi = 0:0.0174532925:pi;
- s = sin(2*pi*t) + sin(2*pi*t + fi');
- % Calculate power
- P = 1/length(t)*(sum(s, 2).^2);
- figure;
- plot(fi, P); xlabel("Phase angle [rad]"); title("Power of the sum of two signals shifted in phase");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement