No BSD License  

Highlights from
Brown Acoustic Simulator

image thumbnail
from Brown Acoustic Simulator by Avram Levi
Creates a source to microphone impulse response in complex room enviroments

stf(az, el, attn, can_freqs, fs)
function attn = stf(az, el, attn, can_freqs, fs)

if az<-180
    az = az+360;
end
if az<0
    az = -az;
end
if az>180
    az = 360-az;
end

if el>90
    el = 90-(el-90);
elseif el<-90
    el = (-90-el)-90;
end

freq_index = [1:512]*fs/1024;
dummy = attn(round(az)+1, round(el)+91, :);
for i=1:18
    can_attn(i) = dummy(1, 1, i);
end

attn = interp1(can_freqs,can_attn,freq_index,'v5cubic');
% ind_NaN = find(isnan(attn));
ind = find(isnan(attn)-1);
attn(1:ind(1)-1) = attn(ind(1));
attn(ind(length(ind))+1:length(attn)) = attn(ind(length(ind)));

attn(length(attn)+1:2*length(attn)) = fliplr(attn);
attn = 10.^(attn/20);


Contact us at files@mathworks.com