How to apply a large number of equalization curves

Help for Audacity 2.x.x on Windows.

ImageThis forum is for Audacity 2.x.x on Windows.

  • Please state which version of Windows you are using, the exact three-section version of Audacity from Help > About Audacity and whether you obtained the .exe installer or the zip.

  • Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at http://www.audacityteam.org/download/.
    The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.

How to apply a large number of equalization curves

Permanent link to this post Posted by cmasco » Thu Apr 13, 2017 10:57 pm

Hi! I have a large number of equalization curves (400+) that I want to apply to a single audio file. I want to apply each equalization curve independently to produce 400+ audio files, each filtered with one curve -- is there an automated way to accomplish this? I see that batch processing is possible using chains, but as far as I can tell, this method applies the equalization filters in an additive way. In terms of commands, I want to do something like:

01 Import wav
02 Apply equalization curve1
03 Export wav
04 Import wav
05 Apply equalization curve2
06 Export wav
etc.

Does anyone have suggestions? I'd like to avoid doing it manually if possible! Thanks for your help!

P.S. I'm running Audacity 2.1.3 on Windows 8.1 64-bit OS obtained via .exe installer
cmasco
 
Posts: 3
Joined: Thu Apr 13, 2017 10:01 pm
Operating System: Windows 8 or 8.1

Re: How to apply a large number of equalization curves

Permanent link to this post Posted by kozikowski » Fri Apr 14, 2017 3:45 am

Could you fake out Chains? Make hundreds of copies of the show each with a slightly different filename? Ummmmm. No, because Chains will probably try to apply one effect to them all sequentially.

What's the show? Sometimes we can figure a different way to get the same result.

Koz
kozikowski
Forum Staff
 
Posts: 36274
Joined: Thu Aug 02, 2007 5:57 pm
Location: Los Angeles
Operating System: OS X 10.9 Mavericks

Re: How to apply a large number of equalization curves

Permanent link to this post Posted by cmasco » Fri Apr 14, 2017 4:21 am

Thanks for the reply! The audio file has 30 examples of birdsong in a sequence, and I'm using equalization filters to simulate the change in sound as it travels through the environment. Each filter corresponds to a distance traveled, so I need to apply each filter individually to produce examples of birdsong traveling 20m, 21m, 22m, etc.
cmasco
 
Posts: 3
Joined: Thu Apr 13, 2017 10:01 pm
Operating System: Windows 8 or 8.1

Re: How to apply a large number of equalization curves

Permanent link to this post Posted by Gale Andrews » Fri Apr 14, 2017 4:38 pm

Even if Chains had an Import command that let you select a file, you would still have to spend a lot of time inserting Equalization commands into the Chain for the different EQ curves.

So I think the answer is no, unless you are skilled at AutoHotkey or similar and wrote some kind of macro that iterated the curve to be used and the file name to be written to.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Gale Andrews
Quality Assurance
 
Posts: 25534
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: How to apply a large number of equalization curves

Permanent link to this post Posted by Trebor » Fri Apr 14, 2017 7:19 pm

cmasco wrote: I'm using equalization filters to simulate the change in sound as it travels through the environment. Each filter corresponds to a distance traveled

A gradual low-pass filter will do that part, e.g. use this variant of Steve's code in Audacity's Nyquist prompt ...

Code: Select all
   (setq start-freq 22000) ; cannot be greater than 1/2 the sample rate
    (setq end-freq 200)
    (setq passes 2)         ; more passes for a steeper filter cut-off
    (setq sweep-type 0)     ; 1 for a linear sweep, 0 for exponential sweep

    (let* ((nyq (/ *sound-srate* 2.0))
           (f0 (max 0 (min nyq start-freq)))
           (f1 (max 0 (min nyq end-freq))))
      (if (= sweep-type 0)
          (setf lpfreq (pwev f0 1 f1))
          (setf lpfreq (pwlv f0 1 f1)))
      (dotimes (i passes *track*)
        (setf *track* (lp *track* lpfreq))))

To get the full illusion of movement you'll also need to manipulate the stereo-image, as well as the equalization.
Trebor
 
Posts: 3452
Joined: Sat Dec 27, 2008 5:22 pm
Operating System: Windows Vista

Re: How to apply a large number of equalization curves

Permanent link to this post Posted by cmasco » Wed Apr 19, 2017 7:25 pm

Thank you so much for the helpful suggestions!

Gale Andrews wrote: So I think the answer is no, unless you are skilled at AutoHotkey or similar and wrote some kind of macro that iterated the curve to be used and the file name to be written to.


Gale – I’ll need to learn the syntax, but AutoHotKey looks like it could help me automate this and various other aspects of my research. It’s definitely worth exploring!

Trebor wrote: A gradual low-pass filter will do that part, e.g. use this variant of Steve's code in Audacity's Nyquist prompt ...


Trebor – this wouldn’t quite accomplish my goal, but I might be able to make it work if I can use the Nyquist prompt to apply a filter that changes in discrete steps.

For a simple case, let’s say I have two examples of birdsong that I want to simulate at 20m, 40m, and 60m. My current method is to string the examples of birdsong together into one audio file, then apply each filter independently:
[song1…song2…] -- apply curve20m --> all songs at 20m
[song1…song2…] -- apply curve40m --> all songs at 40m
[song1…song2…] -- apply curve60m --> all songs at 60m

If I could use the Nyquist prompt to apply filters in discrete steps, I could change my methods such that the filter changes over time rather than the example song:
[song 1…song1…song1…] -- apply curve20m…curve40m…curve60m --> song1 at all distances
[song 2…song2…song2…] -- apply curve20m…curve40m…curve60m --> song2 at all distances

Would it be possible to specify different curves to be applied every X seconds using the Nyquist prompt? The equalization curves themselves are fairly complex – our model for attenuation takes into account atmospheric absorption and ground reflection. As a result, the change in dB depends on the frequency of the sound (see attached example). I have 400+ of these curves to apply, so assuming this is possible using the Nyquist prompt, would it be nightmarish to code?

Thanks again for the help!
Christina
Attachments
example_curve.xml
Example equalization curve
(3.4 KiB) Downloaded 1 time
cmasco
 
Posts: 3
Joined: Thu Apr 13, 2017 10:01 pm
Operating System: Windows 8 or 8.1

Re: How to apply a large number of equalization curves

Permanent link to this post Posted by steve » Thu Apr 20, 2017 4:55 pm

cmasco wrote:The equalization curves themselves are fairly complex – our model for attenuation takes into account atmospheric absorption and ground reflection.

That looks like a combination of low-pass and comb filtering. How were the curves generated?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Senior Forum Staff
 
Posts: 43160
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux Debian

Re: How to apply a large number of equalization curves

Permanent link to this post Posted by steve » Thu Apr 20, 2017 5:33 pm

cmasco wrote:Would it be possible to specify different curves to be applied every X seconds using the Nyquist prompt?

A simple example:
Code: Select all
;version 4

(defun filter (sig ctrl)
; Filter code goes here.
; As an example, a simple low pass filter that
; takes a sound "ctrl" as a control signal, and applies
; a first order low-pass filter 4 times to the sound "sig".
  (dotimes (i 4 sig)
    (setf sig (lp sig ctrl))))

; A control signal, where the value (amplitude) of rises
; from 1000 to 8000 in 4 equal length steps.
; The total length is the length of the selected audio.
(setf param (pwl  0     1000  0.25  1000
                  0.25  2000  0.5   2000
                  0.5   4000  0.75  4000
                  0.75  8000  1.0   8000))

; Call the function "filter" and pass the selected audio "*track*
; and the control signal "param" to the function.
(filter *track* param)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Senior Forum Staff
 
Posts: 43160
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux Debian


Return to Windows



Who is online

Users browsing this forum: Gale Andrews, marcbrooks and 8 guests