Trebor
August 15, 2013, 11:50pm
1
What Steve did here … https://forum.audacityteam.org/t/a-gradual-filter/22027/4
but a high-pass (not low pass as above) filter with the cut-off frequency gradually dropping until the full audio band is passed at the original volume.

[ I’ve tried experimenting with Steve’s code to make it high-pass instead of low-pass but I can’t fathom-out how to do it ]

steve
August 16, 2013, 1:13am
2
Hi, Steve here
Please describe as clearly as possible what you are trying to do (include the numbers) and I’ll see if I can help.

Trebor
August 16, 2013, 4:10am
3
Hi Steve,
your previous code created a “gradual” low-pass filter whose cut-off frequency increased across the interval selected …
/uploads/default/original/2X/b/be77b1d6ea903f1fa5a8f1e8962acf343f746983.flac
I’m after something very similar but a high-pass filter whose cut-off frequency decreases across the interval selected.
[ I’ve found VSTs which do that, e.g. …

however their maximum interval is too short for my purposes ]

steve
August 16, 2013, 5:30pm
4
Try this:

```
(setq start-freq 10000) ; cannot be greater than 1/2 the sample rate
(setq end-freq 100)
(setq passes 4) ; 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 hpfreq (pwev f0 1 f1))
(setf hpfreq (pwlv f0 1 f1)))
(dotimes (i passes s)
(setf s (hp s hpfreq))))
```

Trebor
August 17, 2013, 12:02am
5

That sounds nice, Trebor,
which transition do you prefer, exponential or linear?

Trebor
August 17, 2013, 8:43am
7
Exponential works better IMO.

BTW using “find” hp, “replace” with lp on the above code gives the same effect as Steve’s 2011 code , but now with a smoother envelope …

Low-pass variant of above code …

```
(setq start-freq 22000) ; cannot be greater than 1/2 the sample rate
(setq end-freq 20)
(setq passes 1) ; 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 s)
(setf s (lp s lpfreq))))
```