Skip to content

Instantly share code, notes, and snippets.

@fireattack
Created July 1, 2017 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fireattack/5e614bab979ee382ece6cf3b8a81b208 to your computer and use it in GitHub Desktop.
Save fireattack/5e614bab979ee382ece6cf3b8a81b208 to your computer and use it in GitHub Desktop.
Normalize audio signal via target RMS (in dB)
function [ y ] = normalizerms( x, targetdB )
%NORMALIZERMS Summary of this function goes here
% Detailed explanation goes here
%normalize
targetrms=10^(targetdB/20);
myrms=rms(x);
% valueDBFS = 20*log10(abs(myrms));
y=x/(myrms/targetrms);
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment