Mercurial > hg > ape
comparison aux/getLoudness.m @ 4:b28ffd29e6e1
Audio file preparation for listening test
author | Brecht De Man <b.deman@qmul.ac.uk> |
---|---|
date | Wed, 19 Nov 2014 18:59:51 +0000 |
parents | 5e72201496c8 |
children |
comparison
equal
deleted
inserted
replaced
3:1f7b986dab05 | 4:b28ffd29e6e1 |
---|---|
1 function result = getLoudness( vector, Fs, timescale, plotBOOL ) | 1 function result = getloudness( vector, Fs, timescale, plotBOOL ) |
2 %GETLOUDNESS returns loudness levels according to EBU R 128 specification | 2 %GETLOUDNESS returns loudness levels according to EBU R 128 specification |
3 % Function getLoudness accepts an audio file vector (vector), a sampling | 3 % Function getLoudness accepts an audio file vector (vector), a sampling |
4 % rate (Fs), a timescale ('M' - Momentary, 'S' - Short, 'I' - Integrated) | 4 % rate (Fs), a timescale ('M' - Momentary, 'S' - Short, 'I' - Integrated) |
5 % and a boolean of whether or not to plot the results, and returns either a | 5 % and a boolean of whether or not to plot the results, and returns either a |
6 % scalar for Integrated timescales, or a vector of loudnesses with a | 6 % scalar for Integrated timescales, or a vector of loudnesses with a |
27 | 27 |
28 rlbBcoeffs = [[0.994975383507587;], [-1.98995076701517;], [0.994975383507587;]]; | 28 rlbBcoeffs = [[0.994975383507587;], [-1.98995076701517;], [0.994975383507587;]]; |
29 rlbAcoeffs = [1, -1.98992552008493, 0.989976013945421]; | 29 rlbAcoeffs = [1, -1.98992552008493, 0.989976013945421]; |
30 | 30 |
31 % loudness prefilter function below this one (see Pestana 2013) | 31 % loudness prefilter function below this one (see Pestana 2013) |
32 [prefilterBcoeffs, prefilterAcoeffs] = getLoudnessPreFilter(10, Fs); | 32 [prefilterBcoeffs, prefilterAcoeffs] = getloudnessprefilter(10, Fs); |
33 | 33 |
34 | 34 |
35 % Weighting coefficients with channel format [L, R, C, Ls, Rs] | 35 % Weighting coefficients with channel format [L, R, C, Ls, Rs] |
36 nrChannels = size(vector,2); | 36 nrChannels = size(vector,2); |
37 switch nrChannels | 37 switch nrChannels |
227 end | 227 end |
228 end | 228 end |
229 | 229 |
230 | 230 |
231 | 231 |
232 function [prefilterBcoeffs, prefilterAcoeffs] = getLoudnessPreFilter(gainIndB, fs) | 232 function [prefilterBcoeffs, prefilterAcoeffs] = getloudnessprefilter(gainIndB, fs) |
233 % GET LOUDNESS calculates coefficients for prefilter with arbitrary gain as | 233 % GET LOUDNESS calculates coefficients for prefilter with arbitrary gain as |
234 % specified in EBU R 128 and the modification proposed in Pestana 2013. | 234 % specified in EBU R 128 and the modification proposed in Pestana 2013. |
235 % | 235 % |
236 % by Brecht De Man at Centre for Digital Music on 24 April 2014 | 236 % by Brecht De Man at Centre for Digital Music on 24 April 2014 |
237 | 237 |