# v_sone2phon

## PURPOSE

V_PHON2SONE convert SONE loudness values to PHONs p=(s)

## SYNOPSIS

function p=v_sone2phon(s)

## DESCRIPTION

    V_PHON2SONE convert SONE loudness values to PHONs p=(s)
    Inputs:    s is a matrix of sone values

    Outputs:   p is a matrix, the same size as s, of phon values

     The phon scale measures perceived loudness in dB; at 1 kHz it is identical to dB SPL
     relative to 20e-6 Pa sound pressure. The sone scale is proportional to apparent loudness
     and, by definition, equals 1 at 40 phon. The form of the loudness curve is taken from [1].
     The hearing threshold at 1 kHz for 18 to 25 year olds with normal hearing is taken from [2].

     Refs: [1]    J. Lochner and J. Burger. Form of the loudness function in the presence of masking noise.
               The Journal of the Acoustical Society of America, 33: 1705, 1961.
           [2]    ISO/TC43. Acoustics, Normal equal-loudness-level contours.
               Standard ISO 226:2003, Aug. 2003.

## CROSS-REFERENCE INFORMATION

This function calls:

- v_axisenlarge V_AXISENLARGE - enlarge the axes of a figure (f,h)
- v_phon2sone V_PHON2SONE convert PHON loudness values to SONEs s=(p)
- v_sone2phon V_PHON2SONE convert SONE loudness values to PHONs p=(s)
- v_xticksi V_XTIXKSI labels the x-axis of a plot using SI multipliers S=(AH)

This function is called by:

- v_sone2phon V_PHON2SONE convert SONE loudness values to PHONs p=(s)

## SOURCE CODE

    0001 function p=v_sone2phon(s)
    0002 %V_PHON2SONE convert SONE loudness values to PHONs p=(s)
    0003 %Inputs:    s is a matrix of sone values
    0004 %
    0005 %Outputs:   p is a matrix, the same size as s, of phon values
    0006 %
    0007 % The phon scale measures perceived loudness in dB; at 1 kHz it is identical to dB SPL
    0008 % relative to 20e-6 Pa sound pressure. The sone scale is proportional to apparent loudness
    0009 % and, by definition, equals 1 at 40 phon. The form of the loudness curve is taken from [1].
    0010 % The hearing threshold at 1 kHz for 18 to 25 year olds with normal hearing is taken from [2].
    0011 %
    0012 % Refs: [1]    J. Lochner and J. Burger. Form of the loudness function in the presence of masking noise.
    0013 %           The Journal of the Acoustical Society of America, 33: 1705, 1961.
    0014 %       [2]    ISO/TC43. Acoustics, Normal equal-loudness-level contours.
    0015 %           Standard ISO 226:2003, Aug. 2003.
    0016
    0017
    0018 %      Copyright (C) Mike Brookes 2012-2013
    0019 %      Version: $Id: v_sone2phon.m 10865 2018-09-21 17:22:45Z dmb $
    0020 %
    0021 %   VOICEBOX is a MATLAB toolbox for speech processing.
    0022 %   Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html
    0023 %
    0024 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    0025 %   This program is free software; you can redistribute it and/or modify
    0026 %   it under the terms of the GNU Lesser General Public License as published by
    0027 %   the Free Software Foundation; either version 3 of the License, or
    0028 %   (at your option) any later version.
    0029 %
    0030 %   This program is distributed in the hope that it will be useful,
    0031 %   but WITHOUT ANY WARRANTY; without even the implied warranty of
    0032 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    0033 %   GNU Lesser General Public License for more details.
    0034 %
    0035 %   You can obtain a copy of the GNU Lesser General Public License from
    0036 %   https://www.gnu.org/licenses/ .
    0037 %
    0038 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    0039 persistent a b d
    0040 if isempty(a)
    0041     b=1/(log(10)*0.1*0.27); % 0.27 is the exponent from [1] and [2]
    0042     d=exp(2.4/b); % 2.4 dB is teh hearing threshold from [2]
    0043     a=exp(40/b)-d; % scale factor to make p=40 give s=1
    0044 end
    0045 if nargout>0
    0046
    0047     p=b*log(a*s+d);
    0048 else
    0049     if nargin<1 || isempty(s)
    0050         pp=linspace(5,90,100)'; % phon values
    0051         ss=v_phon2sone(pp);
    0052     else
    0053         ss=s;
    0054     end
    0055     semilogx(ss,v_sone2phon(ss));
    0056     v_axisenlarge(-1);
    0057     v_xticksi;
    0058     ylabel('phon = dB SPL @ 1 kHz');
    0059     xlabel('sone');
    0060 end