Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function rms = RMS(n, s, delta, K)
- %%This function calculates the RMS at the points s where n is the sample number we start and s are the values of the signal
- %%Calculate the rms
- s_part = s(n-K:n-1).^2; %Get the part of s we need and square it
- valuesum = sum(s_part); %Determine the sum
- rms = sqrt(valuesum * (delta/K)); %Multiply our sum by delta on K and take the sqrt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement