Why i am getting matrix misdimension.
Show older comments
i want to implement simple equations.
S=cos(2*pi*fc*t)
Here t[n] is number of samples. Second equation i want to implement is
S1t[n]=cos(2*pi*fc*t[n]+ ϕ(t[n])
Where ϕ(t[n])= ϕ0(t[n])+∑_(k=0)^n▒ϕ1(t[k]) ), here summation goes from k = 0 to n
Where ϕ0(t[n]) is random variables with gaussian distribution
Where ϕ0(t[n]) is also random variables with gaussian distribution
ts = 0.01;
fs = 1/ts;
nsamples = 100;
t = 0:ts:nsamples-ts;
fc = 50;
S = cos(2*pi*fc*t); %%%equation 7.1 noisless
sigma = 1/1000;
phi_sync = sigma * rand(1,nsamples); %%%%random variable with gaussian distributed
for k = 1: nsamples
phi_acc(k,:) = rand(1,nsamples); %%%%random variable with gaussian distributed
phi(k, :) = phi_sync + phi_acc(k,:); %%%%equation 7.11
S1(k,:) = cos(2*pi*fc*t + phi(k,:));
end
%%%%equation 7.10, signal with noise
figure, plot(fftshift(abs(fft(S1))));
return
Answers (0)
Categories
Find more on Numerical Integration and Differential Equations 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!