what is the correct formula of (sum of ...from...to...) in matlab
1 次查看(过去 30 天)
显示 更早的评论
snrin=(-5:5:55); %initial snr
N=length(ecg); % length of ecg signal
n=(0:N-1);
e=sum (ecg^2) from 0 to N-1; **% I want to write this formula correctly**
f=sum (W^2) from 0 to N-1; *% also this*
A=sqrt(e/(10^(snrin/10))*f); *% also this one*
2 个评论
James Tursa
2017-4-27
How is the indexing from 0 to N-1 related to the variable "ecg"? I.e., what would an index of 0 mean? Same question for the other sums.
采纳的回答
Walter Roberson
2017-4-27
e = sum( ecg(1+n).^2 );
f = sum( W(1+n).^2 );
7 个评论
Walter Roberson
2017-4-30
ecgnoisy = repmat(ecg(:), 1, length(A)) + repmat(W(:), 1, length(A)) .* repmat(A, numel(W), 1);
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!