t = 0:0.001:1; y1 = 400 * sin(2*pi*20*t); y2 = 200 + 400 * sin(2*pi*20*t); plot(t,y1) hold on plot(t,y2,'-g') grid on; rms_y1 = sqrt(mean(y1.^2)) rms_y2 = sqrt(mean(y2.^2))
In the above MATLAB code there are two signals
y1 is a sinusoidal signal 20 Hz with 400V amplitude.
y2 is a signal which is nothing but
y1 + 200V DC offset.
So I was thinking the "rms of
y2" would be equal to "rms of
y1 + 200". Since rms of a constant is the constant itself.
But rms of
y1 is 282.7014; and rms of
y2 turns out to be 346.2948 (not 282 + 200).
What am I doing wrong here?