Calibration and outer and middle ear filter Fluctuation.m
Opened this issue · 2 comments
Hey, I am currently trying to use the function Fluctuation.m. After I calibrated the method to a fluctuation strength of 1 vacil for the 1 kHz sinusoid with a modulation frequency of 4 Hz and a sound pressure level of 60 dB (Cal = 0.0343, line 421) I tested this function with some signals.
When I use an ordinary sinusoid with a frequency of 1 kHz (60 dB SPL), a calibration value cal=94, a sampling rate of 44100, signaltype 0 (unmodulated) and soundfield 0 (free). The resulting fluctuation strength should really low (at about 0), but it is 0.4245.
The first thing I am curious is the calibration: I kept the value calconstant (line 32) on its value 0 and used a cal value of 94 as an input so the command window shows correctly:
rms level of the entire wave 60 dB
But when I observe now the variable audio which is multiplied with the factor 10.^(cal/20) it results in really high values for the time signal audio.
Then I looked through the code in debugging mode and saw the lines 333-338 which made me curious what is going to happen there:
333 dataIn = fft((N_b(:,currentFrame) .* window),N); % apply window to current frame
334 filteredOuter = filtfilt(b_outer,1,filtfilt(b_middle,1,dataIn)); % apply outer and middle ear filters
335 filteredOuterSpect = real(ifft(filteredOuter));
336 filteredOuterNyq = filteredOuterSpect(1:N/2+1);
337 filteredOuterNyq(2:end-1) = 2*filteredOuterNyq(2:end-1);
338 dataOut = filteredOuterNyq';
The input signal is fourier-transformed by an fft. Why is the filter applied to the resulting spectrum in line 334? In line 335 the resulting spectrum is transformed back into time-domain, but the operations in line 336 and 337 are obviously on a spectrum (take the single-sided spectrum). When I look now on the filtered output dataOut, the resulting spectrum doesnt look like a sinusoid anymore.
Is this an error in a code or am I maybe using the script in a wrong way? It would be greatful if you could provide me some help about this script.
Best regards
Florian Doleschal
Department of Experimental Audiology
Otto von Guericke University Magdeburg
I also tried to use this function with a 1 kHz tone having 60 dB SPL, 4 Hz modulation frequency and 100% amplitude modulation. By definition, this should lead to fluctuation strength of 1 Vacil. However, the function did not return that value.
Regarding to the observation of Florian Doleschal of the Fourier-transformation and the filtering. The method this function tries to implement is introduced by Zhou et al. in AES Journal in 2015. The article instructs to filter the signal in the frequency domain. Thus, this is probably why the filtering is tried to apply to the FFT-transformed data. However, I think that this is currently implemented in erroneous manner, as frequency domain filtering should not be conducted in MATLAB by using function filtfilt.
Best regards,
Ville Rajala
Research Scientist
Turku University of Applied Sciences
Dear @vrajala
thank your for the information that you also read through the code. Our department carefully looked through the code and revised the (in our opinion) erroneous steps according to the original paper by Zhou et al, 2015. The model is able to (approximately) predict the changes of fluctuation strength when varying the parameters modulation frequency, modulation depth, center frequency and level by keeping the other parameters constant (as in the paper), see attached picture. I will attach the version to this post, so can have a look through it. It would be grateful, if you could inform me, if we implemented everything correct as there might be still errors in the code.
FluctuationStrength.txt
Best regards
Florian Doleschal
Department of Experimental Audiology
Otto von Guericke University Magdeburg