Loudness Equalization Across Stimuli-Within Stimuli
Show older comments
Hello Everyone,
I am a PhD student and I am designing auditory stimuli, which are sequences of 50-ms tone-pips (gated on and off with 5-ms raised cosine ramps) with frequencies drawn from a pool of 26 values, equally spaced on a logarithmic scale between 198 and 3563 Hz (12% steps). Each stimulus includes 60 tone-pips, selected from this defined pool and presented in a mixed order, without gap. ( a possible frequencies in a sound sequence could be like :250-445-500-100...etc). (In my case I chose 5 random adjacent frequency for example. and presented them in a mixed order)
When working with different frequencies, you need to adjust their loudness. This is because, even when presented at the same level, some frequencies tend to be perceived as louder than others. To address this, I am using a function shared here: https://github.com/IoSR-Surrey/MatlabToolbox, which follows the ISO226 standards.
My problem is even if I used a loudness correction factor when I play them in my computer some of them sound louder than others. If a sound sequence mostly include higher frequencies, it sounds louder to me.
Is it because I have a mistake in one of my steps (loudness normalization or correction)
I was thinking it could be because of the normalization I was doing. I was using stim=stim/abs(max(stim)) to prevent audio-clipping. Since in here, each stimuli was divided by a different value, I modified this as :stim=stim/abs(3.15). Here 3.15 is chosen because it is the highest value in my stimuli sequences--corresponds to 198 Hz.
However, still I have the same problem and couldn't understand why.
If anyone have any idea or solution- I greatly appreciate it!
%%%% Here are my scripts :
I am creating my tone sequences using a code below (just that part)
stimuli = [315 890 707 561 707 561 315 561 397 707 397 890 561 890 561 397 315 707 561 707 397 890 561 397 707 890 315 707 890 397 315 561 890 397 707 890 315 397 315 397 315 0 707 890 315 890 315 707 397 561 397 890 707 890 315 561 315 707 397 561]
freqpattern=stimuli; %includes my tone sequences as a vector 1x60
for i=1:numel(freqpattern)
tone = fgenTone(freqpattern(i), toneDur, 44100); %toneDur=50 ms 44100= sampling freq
stim = [stim tone];
end
stim=stim/abs(3.15); % I previously used as stim=stim/abs(max(stim));
stim = stim *0.5; %normalization
ID=[stimFolder 'Block' int2str(bi) '\' design.conds{c} '_' num2str(i) '_.wav'];
audiowrite(ID,stim,44100);
Here is fgenTone function which creates tones :
% a function for making a simple tone
% input Freq, len (length in ms) and SampFreq
function sig=fgenTone(freq,len,SampFreq);
sd = 1/SampFreq;
n=[1:SampFreq*(len)/1000];
N=length(n);
t=n*sd;
sig=sin(2*pi*freq*t);
%% add scaling factor (for equal loudness)
sfact=fgetLoudnessCorrectionFactor(freq)
sig=sfact*sig;
sig=fRamp(5,sig); % each tone 5 ms- gated on-off
end
I have a function fgetLoudnessCorrectionFactor (which is called in fgenTone) below which uses iso226 that mentioned :
function fct=fgetLoudnessCorrectionFactor(freq)
% Pure tones (PT) %%%%
dB=iso226(60,freq); %using the 60 phon baseline
dbDiff=dB-60;
fct=10^(dbDiff/20); %power_db = 20 * log10(amp / amp_ref);
end
Many Thanks!
Best Regards,
3 Comments
Star Strider
on 27 Dec 2024
You did not mention the characteristtics of the transducer (headphones, speaker) that you are using. The transducer itself could also have its own characteristics, such that some frequencies are louder than others in absolute terms. That information might already exist in the documentation that came with the transducer, or online in its documentation.
Otherwise, evaluating that would requiire a calibrated microphone that had equal (or at least known) amplitude responses across the spectrum-of-interest.
It is always best first to deteremine the linearity and dynamic characteristics of all the instrumentation you use.
.
Buse
on 27 Dec 2024
Star Strider
on 27 Dec 2024
My pleasure!
Accepted Answer
More Answers (1)
Jimmy Lapierre
on 2 Jan 2025
1 vote
If you want to analyze your sequences to see if loudness is perceived as the same for different frequencies, I'd recommend looking at acousticLoudness in the Audio Toolbox. This will account for the stimuli duration.
In particular, the TimeVarying option will show the loudness over time, so that you can compare each 50ms burst in your sequence. Also consider the TimeResolution option in case that helps.
Categories
Find more on Audio Processing Algorithm Design in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
