78rpm EQ Curve Generator

Share your Audacity/Nyquist plug-ins here, or test drive the latest plug-ins submitted by Audacity users.

After testing a plug-in from this forum, please post feedback for the plug-in author.
steve
Site Admin
Posts: 81227
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: 78rpm EQ Curve Generator

Post by steve » Sun Aug 22, 2010 11:47 pm

Irish wrote:
Gale Andrews wrote wrote:I think it would be far more useful if a new write could insert into the xml file, not overwrite."
I don't know if that is possible.
It's not pretty, and I'm not sure that it's a good idea, but I think it can be done. You can probably do it by reading the existing file, then appending the new data before writing it back to the file.
Irish wrote:there doesn't seem to be an easy way to output a floating-point number in fixed-format with anything other than six decimal places
Have you tried (for example)

Code: Select all

(setq *float-format* "%#1.3f")
or

Code: Select all

(setq *float-format* "%g")
See here for details: http://www.audacity-forum.de/download/e ... ef-119.htm
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Irish
Forum Crew
Posts: 550
Joined: Sat Sep 05, 2009 9:25 pm
Operating System: Please select

Re: 78rpm EQ Curve Generator

Post by Irish » Mon Aug 23, 2010 12:13 am

Thanks for the tips, Steve.
Setting the format to "%#1.nf" does the job. %g is not so good with columns, as it gives the shortest output, which could be anything from 1 to 6 decimal places.

I had read the page in your link, but it didn't give the syntax for setting the number of decimal places, so I hadn't pursued it, except to change from the default %g to %f.

PO'L
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * Tips * * * * Tutorials * * * * 1.3 Quick Start Guide * * * * Audacity 1.3 Manual * * * * Audacity wiki * * * *

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: 78rpm EQ Curve Generator

Post by Gale Andrews » Wed Oct 13, 2010 9:01 pm

Please see further comments in the Submit your EQ curves thread.



Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

Irish
Forum Crew
Posts: 550
Joined: Sat Sep 05, 2009 9:25 pm
Operating System: Please select

Re: 78rpm EQ Curve Generator

Post by Irish » Tue Oct 19, 2010 7:42 pm

Following discussion in the Submit Your EQ Curves thread, the latest version (2.1) of the 78EQCurveGen plug-in is available here.

This version has the extra functions of the previous version removed, as they were considered superfluous, and also corrects some errors in the code of the previous versions.

POL

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: 78rpm EQ Curve Generator

Post by Gale Andrews » Wed Jan 19, 2011 1:55 pm

78rpm EQ curve generator is now at v4. See http://forum.audacityteam.org/viewtopic ... 34#p125334



Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

Irish
Forum Crew
Posts: 550
Joined: Sat Sep 05, 2009 9:25 pm
Operating System: Please select

Re: 78rpm EQ Curve Generator

Post by Irish » Thu Feb 24, 2011 2:49 pm

Update:

The latest version of the EQ Curve Generator plug-in is now V2.5, available here. See this topic for the details.

POL
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * Tips * * * * Tutorials * * * * 1.3 Quick Start Guide * * * * Audacity 1.3 Manual * * * * Audacity wiki * * * *

Irish
Forum Crew
Posts: 550
Joined: Sat Sep 05, 2009 9:25 pm
Operating System: Please select

Re: 78rpm EQ Curve Generator

Post by Irish » Wed Jan 04, 2012 11:42 pm

Update:

The EQ Curve Generator plug-in is now at V2.7, and can be downloaded here.

See this topic for the details.

POL
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * Tips * * * * Tutorials * * * * 1.3 Quick Start Guide * * * * Audacity 1.3 Manual * * * * Audacity wiki * * * *

steve
Site Admin
Posts: 81227
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: 78rpm EQ Curve Generator

Post by steve » Wed Jan 11, 2012 12:05 am

I've not forgotten this Irish, just been a bit busy.

I've not found any bugs in it, but as it is rather a complex plug-in there's a lot to check.
I'd like to get this plug-in up on the wiki where it will hopefully reach a larger audience so the more testing that can happen now the better.

I've also had a few ideas for streamlining the code - I doubt that they'll make any appreciable difference to the efficiency of the code, but they may help to make it easier to maintain if any updates are required at a later date. Details to follow.

Regarding the actual curves - I don't know the formula for calculating the gain but I assume that you do. What is that, 6dB per octave?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Irish
Forum Crew
Posts: 550
Joined: Sat Sep 05, 2009 9:25 pm
Operating System: Please select

Re: 78rpm EQ Curve Generator

Post by Irish » Wed Jan 11, 2012 10:05 pm

No apology necessary - look at the dates of my two previous posts!

Yes, it is 6dB per octave.

The equation for a generic EQ curve is
EQ curve equation.jpg
EQ curve equation.jpg (6.21 KiB) Viewed 2414 times
where
N is the gain in dB
f is the frequency at which the gain is being calculated
t1 is the time constant of the treble cut curve
t2 is the time constant of the bass boost curve
t3 is the time constant of the LF shelving curve.

In each case t = 1/(2*pi*f) where f is the "turnover" or 3dB frequency for that curve.

The turnover frequencies for the bass boost and LF shelving curves are obtained direct from the plug-in inputs, but the turnover frequency for the treble cut curve has to be calculated from the 10kHz gain rolloff parameter. This calculation is in line 250 of the plug-in, and the gain calculations for the three component curves are in lines 258 to 260.

POL
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * Tips * * * * Tutorials * * * * 1.3 Quick Start Guide * * * * Audacity 1.3 Manual * * * * Audacity wiki * * * *

steve
Site Admin
Posts: 81227
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: 78rpm EQ Curve Generator

Post by steve » Wed Jan 11, 2012 11:50 pm

Irish wrote:The equation for a generic EQ curve is
Image
where
N is the gain in dB
f is the frequency at which the gain is being calculated
t1 is the time constant of the treble cut curve
t2 is the time constant of the bass boost curve
t3 is the time constant of the LF shelving curve.

In each case t = 1/(2*pi*f) where f is the "turnover" or 3dB frequency for that curve.
Terrific, that's what I was looking for, but now I'm a bit unclear about how that fits with the (gaincalc freq) function:

Code: Select all

(defun gaincalc (freq)
   (setq togainlf (* 10.0 (logten (+ 1.0 (/ (expt tofreq 2.0) (expt freq 2.0)))))) 
   (setq togainhf (* (- 10.0) (logten (+ 1.0 (/ (expt freq 2.0) (expt hfto 2.0))))))
   (setq togainshelf (* (- 10.0) (logten (+ 1.0 (/ (expt lfshelf 2.0) (expt freq 2.0))))))
   (+ togainlf togainhf togainshelf))
Oh... no it's OK, just found this: http://www.platenspeler.com/background/ ... und_1.html
The formula in your code is the same as Formula 1.1.b after substituting t1, t2 and t3.
I can see that I'll be pinking your brains in the future ;)

I think I'd be tempted to use a macro or function to simplify these equations. Just defining "squared" would help:
(it's a backquote at the beginning of the second line)

Code: Select all

(defmacro sqrd (num)
  `(* ,num ,num))
then you can use:

Code: Select all

(defun gaincalc (freq)
  (+
    (*  10.0 (logten (+ 1.0 (/ (sqrd tofreq) (sqrd freq)))))
    (* -10.0 (logten (+ 1.0 (/ (sqrd freq) (sqrd hfto)))))
    (* -10.0 (logten (+ 1.0 (/ (sqrd lfshelf) (sqrd freq)))))))
which is a bit easier on the eye and the brain cells ;)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply