필터 지우기
필터 지우기

subdivision of samples to calculate RMS

조회 수: 2 (최근 30일)
Win co
Win co 2012년 4월 6일
Hi, I have a signal recorded with 10^6 samples. I would like to calculate its RMS for each 10^2 samples. Could you show me how to do it please ? Thanks

채택된 답변

Wayne King
Wayne King 2012년 4월 6일
You can create a matrix where you take every 100 consecutive samples of your waveform and use those as the columns of the matrix. The you can compute the RMS value for each column.
x = randn(1e6,1);
for nn = 0:1e4-1
X(:,nn+1) = x(nn*100+1:(nn+1)*100,1);
end
You could also try repmat for this, but you may run into memory problems.
x = randn(1e6,1);
x1 = repmat(x,[1e2 1e4]);
The for loop above should not have memory issues.

추가 답변 (1개)

Win co
Win co 2012년 4월 6일
thanks alot for your answer. It works very well.

카테고리

Help CenterFile Exchange에서 Matched Filter and Ambiguity Function에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by