Trying to plot summation based sine signal
Show older comments
I am generating a random signal based on summation.
Here is the code:
clear all
clc
format long
syms x u
L = 2*pi;
s = rand;
si = L*s;
G5_6 = gamma(5/6); G1_3 = gamma(1/3); k_di = 10000/35;
C = (55/9)*(G5_6/(sqrt(pi)*G1_3));
sigma = 2; ke = 5; l = (2*pi)/5;
n = 1; N=10; u = 0; eta = l/(10^4);
nke = n/ke; k_eta = (2*pi)/eta;
sigma_n = k_eta/10; a_n = 0;
for i = n:N
E_vk = C*((sigma^2)/ke)*((nke)^4)/((1+nke^2)^(17/6));
E_n = E_vk*exp((-(n-k_di)^2)/(sigma_n^2));
a_n = ((2*E_n)^(1/2)) + a_n;
u = (a_n*sin(n*x+si) + u);
end
u
Now, I want to plot u on y-axis against x on x-axis that goes from 0 to 10*pi
I have tried a few things but nothing works, please help
Accepted Answer
More Answers (0)
Categories
Find more on Spectral Estimation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!