Commit e54d2870 authored by Jan-Gerrit Richter's avatar Jan-Gerrit Richter

added diffuse field hrtf calculation

parent b5a4a117
...@@ -1124,6 +1124,8 @@ classdef itaHRTF < itaAudio ...@@ -1124,6 +1124,8 @@ classdef itaHRTF < itaAudio
end end
% JRI: isn't this the same as itaHRTF.interp?
function thisS = smooth_spatial(this, varargin) function thisS = smooth_spatial(this, varargin)
% function this = smooth_spatial(varargin) % function this = smooth_spatial(varargin)
% %
...@@ -1233,6 +1235,26 @@ classdef itaHRTF < itaAudio ...@@ -1233,6 +1235,26 @@ classdef itaHRTF < itaAudio
end end
% calculate diffuse field HRTF from data
% taken from
% Equalization methods in binaural technology
% Veronique Larcher et al
function returnData = getDiffuseFieldHRTF(this)
coords = this.getEar('L').channelCoordinates;
[~,weights] = coords.spherical_voronoi;
returnData = itaAudio;
tmp(:,1) = sum(bsxfun(@times,abs(this.getEar('L').freqData).^2,weights.'),2)./(4*pi);
tmp(:,2) = sum(bsxfun(@times,abs(this.getEar('R').freqData).^2,weights.'),2)./(4*pi);
returnData.freqData = tmp;
returnData.signalType = 'power';
returnData.channelNames = {'Left Ear','Right Ear'};
returnData.comment = 'Diffuse Field HRTF';
end
%% Plot %% Plot
function plot_ITD(varargin) function plot_ITD(varargin)
......
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