Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

non-idealistic equal loudness curve

For general discussion related FlowStone

non-idealistic equal loudness curve

Postby tester » Thu Apr 25, 2013 10:47 pm

Here is the issue.

Let say that I have frequency slider (Hz), and gain slider (dB). I'd like to achieve generally "equal loudness" across the spectra (so that rapid frequency changes don't generate rapid changes in general sound vllume). But I don't want to filter the blue/signal output; I'd like to have the adjustments added to my gain slider (added to fixed offset), depending on selected frequency.

How this can be acieved in greens?
(no ruby)
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: non-idealistic equal loudness curve

Postby trogluddite » Thu Apr 25, 2013 11:18 pm

in schematic terms, I think that what you are going to need is an array of gain alues for different frequencies to use as a look-up table.
If you go to the SM site and look up my "Trogz Toolz" schematic, you will find a couple of ready made modules for drawing simple curves and using them as input vs. output plots (Maths section, i think, but that could be wrong). I could advise you how to add more points to the curves if the resolution isn't enough to fit your needs.

Working out what the points on the curve should be will be by far the hardest part - it may even be best to gather some people together and do it empirically (which is how the official measurement for equal loudness are done in practice). If you can borrow or hire a calibrated sound level meter, that would greatly simplify this task.
Several things make it tricky to determine the values...

1) Perception of level is VERY non-linear when plotted against frequency - you can see HERE the curves used for the curves used in standard calibrations. That's why i suggest a lookup table, as these curves would be very hard to generate using a mathematical equation.
2) The curves are subtly different at different absolute playback levels - though I think an approximation for general "room-level" volume would be reasonable. The blue curve in that link is, I think, the averaged response.
3) The curves assume a perfect sine wave. For more complex waves, harmonics which lie in the area of maximum sensitivity will badly skew the perceived volume.

..hence why I suggest making your own tables empirically - even if a large sample of volunteers is not available and you must be the only test subject. You will at least then approximate good levels for real local conditions and the nature of your waveforms.

I seem to recall that the curve points on those modules can be stored in presets, so if you find you need different curves for different sounds, that should be possible.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: non-idealistic equal loudness curve

Postby tester » Fri Apr 26, 2013 10:55 am

Thanks trog for tip on your tools, I check it. As for saving custom tables inside the preset, I would rather use a path to an external file, than storing the array directly. Less painful. I just realized, that for default paths, I could use a simple config file loaded at startup, where any paths can be added even more easily. I prefer to split externalization into "user data" and "profiles" for other variables. Larger presets load slow (at 2000 parameters - c.a. 30 seconds here, but what interesting - the same time for single program and all programs; I bet if a single preset would be re-organized to bypass the preset manager, it would load much faster; different routines).

As for equal loudness custom tables... That why I used the word "non-idealistic". I bet there are some general tables that perform well enough, I just don't know how to find them. The issue here is, that if I pick sine freqs like 100, 300, 1000, 2500Hz, then if it goes through speakers - well - it can be problematic in the middle of the night or peaceful session ;-) So I'd like to compensate it. Second option would be to use a filter for the blue output, indeed. I don't know - Trog - is this related? http://synthmaker.co.uk/forum/viewtopic ... 50&p=76132
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: non-idealistic equal loudness curve

Postby trogluddite » Fri Apr 26, 2013 1:43 pm

Yes, the "weighting" filters are very closely related.
They wouldn't be used to filter your final output though - rather, they would be used to filter the feed to a level meter, so that it would show "perceived volume".
It would be more complex, but in theory you could use such a "filtered meter" to adjust for loudness automatically - using the level detected as a gain control signal, somewhat like the side-chain of a compressor. Because the whole spectrum gets adjusted by the filter, that would have the advantage of truly accounting for the spectrum of the waveform - no need for different settings depending on the harmonic content of the signal.

Re: the preset loading.
Yes, I think that's right - if you load a whole bank, only one of the patches in the bank is needed immediately for setting parameters inside the schematic, the others are simply stored somewhere ready for recalling later. It is passing the values to the "live" parts of the schematic, and then processing the resulting triggers that really takes the time, not the loading per se.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: non-idealistic equal loudness curve

Postby tester » Fri Apr 26, 2013 2:17 pm

Generally the basic idea is, to temporarily compensate the general loduness across the spectra (at fixed gain offset for all units), when random frequencies are picked. But it would be better if these gain adjustements/values also appear on gain sliders, because these could be the final program settings. Filtering blue output and then adjusting green sliders - it's a duplication of work.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: non-idealistic equal loudness curve

Postby trogluddite » Fri Apr 26, 2013 3:37 pm

tester wrote:it's a duplication of work.

And a whole lot of extra CPU load too! - those weighting filters look pretty complex beasts!
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: non-idealistic equal loudness curve

Postby tester » Fri Apr 26, 2013 9:17 pm

There seem to be some standarization, as I suspected:
http://www.cycling74.com/forums/topic.php?id=13899
I believe this is the MATLAB script that owen wanted to post but I didn't find it in the message so... here it is
If you want to implement it elsewhere you need the 4 tables from the ISO standard and the 2 math relations near the end of the script

function [spl, freq] = iso226(phon);
%
% Generates an Equal Loudness Contour as described in ISO 226
%
% Usage: [SPL FREQ] = ISO226(PHON);
%
% PHON is the phon value in dB SPL that you want the equal
% loudness curve to represent. (1phon = 1dB @ 1kHz)
% SPL is the Sound Pressure Level amplitude returned for
% each of the 29 frequencies evaluated by ISO226.
% FREQ is the returned vector of frequencies that ISO226
% evaluates to generate the contour.
%
% Desc: This function will return the equal loudness contour for
% your desired phon level. The frequencies evaulated in this
% function only span from 20Hz - 12.5kHz, and only 29 selective
% frequencies are covered. This is the limitation of the ISO
% standard.
%
% In addition the valid phon range should be 0 - 90 dB SPL.
% Values outside this range do not have experimental values
% and their contours should be treated as inaccurate.
%
% If more samples are required you should be able to easily
% interpolate these values using spline().
%
% Author: Jeff Tackett 03/01/05

% /---------------------------------------\
%%%%%%%%%%%%%%%%% TABLES FROM ISO226 %%%%%%%%%%%%%%%%%
% \---------------------------------------/
f = [20 25 31.5 40 50 63 80 100 125 160 200 250 315 400 500 630 800 ...
1000 1250 1600 2000 2500 3150 4000 5000 6300 8000 10000 12500];

af = [0.532 0.506 0.480 0.455 0.432 0.409 0.387 0.367 0.349 0.330 0.315 ...
0.301 0.288 0.276 0.267 0.259 0.253 0.250 0.246 0.244 0.243 0.243 ...
0.243 0.242 0.242 0.245 0.254 0.271 0.301];

Lu = [-31.6 -27.2 -23.0 -19.1 -15.9 -13.0 -10.3 -8.1 -6.2 -4.5 -3.1 ...
-2.0 -1.1 -0.4 0.0 0.3 0.5 0.0 -2.7 -4.1 -1.0 1.7 ...
2.5 1.2 -2.1 -7.1 -11.2 -10.7 -3.1];

Tf = [ 78.5 68.7 59.5 51.1 44.0 37.5 31.5 26.5 22.1 17.9 14.4 ...
11.4 8.6 6.2 4.4 3.0 2.2 2.4 3.5 1.7 -1.3 -4.2 ...
-6.0 -5.4 -1.5 6.0 12.6 13.9 12.3];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Error Trapping
if((phon < 0) | (phon > 90))
disp('Phon value out of bounds!')
spl = 0;
freq = 0;
else
%Setup user-defined values for equation
Ln = phon;

%Deriving sound pressure level from loudness level (iso226 sect 4.1)
Af=4.47E-3 * (10.^(0.025*Ln) - 1.15) + (0.4*10.^(((Tf+Lu)/10)-9 )).^af;
Lp=((10./af).*log10(Af)) - Lu + 94;

%Return user data
spl = Lp;
freq = f;
end


Huh, which part to use & how?

or maybe this one?
https://github.com/jcarrano/rtfi/blob/master/iso226.py
Last edited by tester on Fri Apr 26, 2013 9:36 pm, edited 1 time in total.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: non-idealistic equal loudness curve

Postby tester » Fri Apr 26, 2013 9:32 pm

Generally - it could be a preselected set of arrays (help me to make them), switched manually depending on audible loudness pressented from speakers. "1-click setup" so to speak. Destination - gain (dB) in relation to frequency (Hz).
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: non-idealistic equal loudness curve

Postby digitalwhitebyte » Fri Apr 26, 2013 11:05 pm

a thought,
the equal-loudness contours are based on pure tones,
and when you generate complex signals (i.e. containing many frequencies)
you would instead need a loudness model to estimate the loudness of your synthesized sound.
User avatar
digitalwhitebyte
 
Posts: 106
Joined: Sat Jul 31, 2010 10:20 am

Re: non-idealistic equal loudness curve

Postby tester » Fri Apr 26, 2013 11:24 pm

I'm working with pure (sine) tones here, with only slight deviation factors on board, that why I focused on direct greeen conversion instead outputing via filter. But - yes, I'm aware of that. Meanwhile I found something like attached (excel file).
Attachments
eq.zip
(20.56 KiB) Downloaded 1024 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Next

Return to General

Who is online

Users browsing this forum: No registered users and 22 guests