Commit 7a32dc0e authored by Marc van Wanrooij's avatar Marc van Wanrooij

no message

parent a8a01381
function HS = modelHeadshadow(theta,freq,varargin)
function [HS,freq,theta] = modelHeadshadow(theta,freq,varargin)
% HS = MODELHEADSHADOW(THETA,FREQ)
%
% Approximation of the acoustic head shadow at horizontal angle THETA (deg)
......@@ -26,8 +26,8 @@ a = keyval('a',varargin,0.0875); % radius of head (m)
minAlpha = keyval('minAlpha',varargin,0.1); % minimum
minTheta = keyval('minTheta',varargin,150); % minimum head shadow at minTheta, typically not at 180 deg due to summation of sounds coming from both sides
method = keyval('method',varargin,'brown'); % use default Brown and Duda's filter approximation
method = keyval('method',varargin,'rayleigh'); % use default Brown and Duda's filter approximation
method = keyval('method',varargin,'duda'); % use default Brown and Duda's filter approximation
method = keyval('method',varargin,'rayleigh'); % use Rayleigh's head shadow physical model
method = keyval('method',varargin,'duda'); % use Duda's description of Rayleigh's physical model
threshold = keyval('threshold',varargin,0.01); % threshold
r = keyval('r',varargin,1); % distance (m)
......@@ -50,7 +50,7 @@ switch method
mu = 2*pi*a*freq/c;
alpha = (1+minAlpha/2)+(1-minAlpha/2).*cosd(theta./minTheta.*180);
HS = (1+1j.*alpha.*o./(2*o0))./(1+1j*o./(2*o0));
HS = 20*log10(abs(HS)); % head shadow in deciBel
HS = 20*log10(abs(HS)); % head shadow in deciBe
case 'opstal'
%% fit sine through ILD data with square-root frequency dependency
% from: van Opstal A.J. 2016, The Auditory System and Human
......@@ -63,7 +63,7 @@ switch method
[~,~,~,~,~,GI] = getcipicavg;
HS = GI(freq,theta);
case 'rayleigh'
getrayleigh;
HS = getrayleigh;
return
case 'duda'
HS = sphere(theta, freq,'c',c,'a',a,'r',r);
......@@ -202,7 +202,7 @@ else
end
function getrayleigh
function L = getrayleigh
%% Work In Progress
%% General
......
function BF = bayesfactor(samplesPost,samplesPrior,crit)
% Quick and dirty code
%
% BF = PA_BAYESFACTOR(SAMPLESPOST,SAMPLESPRIOR)
% BF = BAYESFACTOR(SAMPLESPOST,SAMPLESPRIOR)
%
% Determine Bayes factor for prior and posterior MCMC samples via the
% Savage-Dickey method.
%
% Determine if posterior is significantly different from a critical value
% CRIT:
% BF = PA_BAYESFACTOR(SAMPLESPOST,SAMPLESPRIOR,CRIT)
% BF = BAYESFACTOR(SAMPLESPOST,SAMPLESPRIOR,CRIT)
% By default this will the null hypothesis.
%
% See also KSDENSITY
......
......@@ -14,6 +14,6 @@ if (nargin==1 && size(x,2)==3)
x=x(:,1);
end
azel = zeros(length(x),2);
azel(:,1) = RTD * atan2 (y, sqrt (x.^2 + z.^2));
azel(:,2) = RTD * atan2 (x, sqrt (y.^2 + z.^2));
azel = zeros(length(x),2);
azel(:,1) = RTD * atan2 (y, sqrt (x.^2 + z.^2));
azel(:,2) = RTD * atan2 (x, sqrt (y.^2 + z.^2));
function [TOT,s] = bubbleplot(X,Y,varargin)
% BUBBLEPLOT(X,Y)
%
% Make a bubbleplot of Y vs X
% Make a bubbleplot of Y vs X.
%
% BUBBLEPLOT(X,Y)
%
% - Xwidth
% - Ywidth
% - col
% (c) 2011 Marc van Wanrooij
% E-mail: marcvanwanrooij@gmail.com
......@@ -33,7 +37,7 @@ uY = unique(Y);
% if numel(uY)==1
% keyboard
% end
%%
x = uY;
......@@ -43,10 +47,10 @@ for ii = 1:length(uX)
r = Y(sel);
N = hist(r,x);
if isscalar(x)
N = histogram(r,[x-Xwidth x+Xwidth]);
N = histogram(r,[x-Xwidth x+Xwidth]);
end
TOT(:,ii) = N;
end
%% Normalize
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment