[Audacity-nyquist] Removing Echoes
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
|
From: Chris G. <cgo...@ho...> - 2004-12-06 16:50:48
|
I'm trying to write a Nyquist plug-in to remove an echo. The first plug-in
seems to add an echo, but the second doesn't remove it. Am I using Nyquist
wrong, or is my math wrong?
(1+cZ^d)*f(Z) = g(Z)
(1+cZ^d)^-1*g(Z) = f(Z)
The sum of (-c)^n Z^dn from n = 0 to infinity * g(Z) = f(Z)
;nyquist plug-in
;version 1
;type process
;name " Add Echo..."
;action "Adding Echo..."
;info "This effect adds an echo."
;control decay "Decay" real "%" 50.0 0.0 100.0
;control delay "Delay" real "seconds" 1.0 0.001 10.0
(sum s (scale (/ decay 100.0) (at-abs delay (cue s))))
;nyquist plug-in
;version 1
;type process
;name "DeEcho..."
;action "Removing Echo..."
;info "This effect removes an echo."
;control decay "Decay" real "%" 50.0 0.0 100.0
;control delay "Delay" real "seconds" 1.0 0.001 10.0
(defun de-echo (s decay delay n)
(cond
((= n 0) s)
((oddp n) (diff
(de-echo s decay delay (- n 1))
(prod (expt (/ decay 100.0) (float n)) (at-abs (*
delay n) (cue s)))))
(t (sum
(de-echo s decay delay (- n 1))
(prod (expt (/ decay 100.0) (float n)) (at-abs (*
delay n) (cue s)))))))
(de-echo s decay delay 10)
Thanks
|