Sample Signal Generation
For our sample signal we decided on a chirp covering the range of human hearing, 15 Hz to 20000 Hz. This signal was created using the Matlab chirp command as follows:
%% Chirp Function
Fs = 44100;
f0 = 15;
f1 = 20000;
t = 0:1/Fs:1-1/Fs;
y = chirp(t,f0,1,f1);
where f0 and f1 are the edges of the spectrum of human hearing. The vector t has 44100 entries, each separated by 1/44100. Taken as a time vector and with the end time of the chirp set as 1 second, this creates a chirp which goes from 15 Hz to 20000 Hz in 1 second at intervals of 1/44100 seconds, which allows for a clean transition from 15 Hz to 20000 Hz at the standard sampling rate of 44100 Hz.
Finding the Transfer Function of the Speaker to Mic Channel
In order to find HRTFs we first had to know the transfer function of the speaker to mic channel through air. We did this by first playing our chirp signal at a mic held approximately 3 feet away and recording the mic output. We did this twice and averaged the two outputs to remove any anomalies. Then using the property that for an LTI filter:
hchannel(t)∗in(t)=out(t)(1)
or in terms of frequency domain:
HChannel(ω)⋅IN(ω)=OUT(ω)(2)
HChannel(ω)=OUT(ω)/IN(ω)(3)
where HChannel(ω)is the transfer function of the system and IN(ω) and OUT(ω) are the fourier transforms of the input and output signals respectively. Thus, by taking the fft of the mic output and pointwise dividing by the fft of the chirp signal (3), we found the transfer function of the speaker to mic channel.
0 comments:
Post a Comment