How to find the sliding RMS of a signal by sliding a window one unit at a time along a signal?
조회 수: 3 (최근 30일)
이전 댓글 표시
I have codes to calculate the RMS for each window. But one window starts at the end of the previous window. I am new to MATLAB and I am struggling to modify the for loop such that the window slides along the time axis.
The data is in the form of an excel document with 2 columns that I read using the first few lines in my code.
if true
clear all;
Array=csvread('Pencilbreak-63dB.csv');
col1 = Array(:, 1);
col2 = Array(:, 2);
window = 100;
for i=1:window:length(col1)
RMS(i:i+window-1) = (sum(col2(i:i+window-1).^2)/window)^0.5;
end
plot(col1,RMS)
end
댓글 수: 0
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!