clear all;
clear classes;
clc;

addpath('PQevalAudio');
addpath('PQevalAudio/CB');
addpath('PQevalAudio/Misc');
addpath('PQevalAudio/Mov');
addpath('PQevalAudio/Patt');

%
referencesounds=ReferenceAudioCollection('castanets.wav');
referencesounds.add('iron.wav');
referencesounds.add('else3.wav');
coders=AudioCoderCollection;
%
mp3params.bitrate=[128 192];
ac3params.bitrate=[128 192];
oggparams.bitrate=[128 192];
%
coders.add('MP3CBR',mp3params);
coders.add('AC3',ac3params);
coders.add('OGG',oggparams);

%
audiometrics=AudioMetricsCollection;
audiometrics.add('A-Weighted-PSNR');
audiometrics.add('PSNR');
audiometrics.add('PEAQ');

%
CompressedSounds=coders.proc(referencesounds);
CompressedSounds.addmetrics(audiometrics);
CompressedSounds.calcmetrics;

CompressedSounds.fcc;

rng('shuffle');
[refdata,matdata]=CompressedSounds.makestatistics;
save(sprintf('refdata_matdata_audio_session_new_2_%d.mat',...
    round(10000*rand)),'refdata','matdata');
%
makeplots(0,'refdata_matdata_audio_session_new_2*.mat');
