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!