function [output] = hsfilter(theta,fs,input)
% HSFILTER Simuates the head shadowing effect in HRTF
% This function processes a mono input signal applying the transfer
% function for head shadowing and delaying the output for compensating
% the interaural time differences.
%
% Argument FS is the sampling frequency of the processed signal.
%
% Theta is the azimuth angle where the virtual source is going to be
% displaced. It should be used for angles between 90 and -90 degrees.
%
% It outputs a mono signal so it has to be applied twice to a same input
% signal but using opposite values for theta to create output for the
% left and right channels of the stereo signal.
%
% Example:
%
% StereoL = hsfilter(theta,fs,input)
% StereoR = hsfilter(-theta,fs,input)
theta = theta + 90; %angle adjustment so that range is: -90