>Thank you Greg. > >With Parseval's theorem it works great. >I am attaching MATLAB code for verification: > >f1 = 50; % [Hz] >fs = 10000; % [Hz] >t_max = 1; % [sec] > >x = sin(2*pi*f1*(0:1/(fs-1):t_max)); >% x = randn(10000,1); % It works for any input >X = fft(x); > >RMS_t = sqrt((sum(x.^2))/length(x)); >RMS_f = sqrt(sum(abs(X/length(X)).^2)); > >error = RMS_t - RMS_f > >error = > > 1.8874e-015 >I added this information also to the wikipedia: http://en.wikipedia.org/wiki/Root_mean_square#RMS_in_frequency_domain
How to compute RMS in frequency domain
Started by ●January 23, 2010
Reply by ●January 24, 20102010-01-24
Reply by ●February 10, 20102010-02-10
In article <a5b54ee5-fe98-4652-828c- 437f64dc1ffb@h2g2000vbd.googlegroups.com>, makolber@yahoo.com says...> > > >> >> I have a program that will compute the peak and RMS for a WAV >> file, such as recorded by a digital audio recorder. �I sometimes >> try to use the peak and RMS to equalize the level between tracks, >> but it isn't quite as easy as I might like. � >> >> -- glen > >Glen... > >you are doing this i presume to attempt to equalize the "loudness" >between tracks.. > >I'm sure you have found that equalizing the peak does not do a good >job of equalizing loudnes.. > >How well do you find the RMS works for this? > >My guess is it would work pretty well as long as there are no long >periods of silence in the track.http://en.wikipedia.org/wiki/Replay_Gain
Reply by ●February 11, 20102010-02-11
> > >I'm sure you have found that equalizing the peak does not do a good > >job of equalizing loudnes.. > > >How well do you find the RMS works for this? > > >My guess is it would work pretty well as long as there are no long > >periods of silence in the track. > > http://en.wikipedia.org/wiki/Replay_Gain- Hide quoted text - >thanks Robert... Mark
Reply by ●October 12, 20102010-10-12
>Thank you Greg. > >With Parseval's theorem it works great. >I am attaching MATLAB code for verification: > >f1 = 50; % [Hz] >fs = 10000; % [Hz] >t_max = 1; % [sec] > >x = sin(2*pi*f1*(0:1/(fs-1):t_max)); >% x = randn(10000,1); % It works for any input >X = fft(x); > >RMS_t = sqrt((sum(x.^2))/length(x)); >RMS_f = sqrt(sum(abs(X/length(X)).^2)); > >error = RMS_t - RMS_f > >error = > > 1.8874e-015 >In the RMS calculation if I include abs(X) at only few frequencies among the entire range for which X has been evaluated, would it be equivalent to applying band pass filter to the original time signal and then taking RMS of it? Rahul






