Advertisement
Guest User

Untitled

a guest
Sep 21st, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.42 KB | None | 0 0
  1. function rms = RMS(n, s, delta, K)
  2.  
  3. %%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
  4.  
  5. %%Calculate the rms
  6. s_part = s(n-K:n-1).^2;                     %Get the part of s we need and square it
  7. valuesum = sum(s_part);                     %Determine the sum
  8. 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