% This high-level script calls the function broadcast_level_corrector.m

% Input signal has to be either in mono (M) or stereo (L and R)

tic % tic & toc display elapsed time in Command Window

[x, fs, nbits] = wavread('input_eg2_music_mono.wav'); % reads input wave file

targetLKFS = -24; % Target LKFS value in dB (LKFS) [Default is -24]
LT = -12; % Limiter threshold in dB (FS) [Default is -2]
plotdata = 1; % 1 = plot data, 0 = no plot [if not defined, no plot]

y = broadcast_level_corrector (x,fs,targetLKFS,LT,plotdata); % call to broadcast_level_corrector function

wavwrite(y, fs, nbits,'OUTPUT.wav'); % writes wave file

toc