MATLAB: RMS of non sinusoidal wave

rms;non sinusoidal wave

I have a signal sampled at 5000 samples per second . and I have 5 second .please tell me how yo get the RMS of non sinusoidal wave by matlab
I knew that for sinusoidal wave we do this
ac_signal = YourSignal - mean(YourSignal(:));
rms = sqrt( mean(ac_signal.^2) );

Best Answer

You get it just the way you calculated it in your ‘rms’ assignment. It’s the square root of the mean of the squared magnitude of the signal.