Why i am getting matrix misdimension.

1 回表示 (過去 30 日間)
Kutru biladi
Kutru biladi 2015 年 7 月 23 日
編集済み: Kutru biladi 2015 年 7 月 23 日
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

回答 (0 件)

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by