Declicking without Interpolating

Using Nyquist scripts in Audacity.
Post and download new plug-ins.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
innocenceisdeath
Posts: 4
Joined: Sat Jun 07, 2014 12:21 pm
Operating System: Please select

Declicking without Interpolating

Post by innocenceisdeath » Sat Jun 07, 2014 12:29 pm

I really don't know if this is the right place to post this, so please excuse me if it is in the wrong forum.

I am looking for advice on declicking without interpolating audio.

I have two audio tracks of the same tape:
  • One has a low noise floor, and higher frequency response, but suffers from the occasional pop/click.
  • The other has more noise, and a lower frequency response, but is free of any pops and clicks.
I have the two tracks synced up. What I want to do is replace the pops and clicks in the first track, with the equivalent audio in the second track. The tracks are far too long to do this manually.

kozikowski
Forum Staff
Posts: 68902
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: Declicking without Interpolating

Post by kozikowski » Sat Jun 07, 2014 4:20 pm

How would you do it manually? Sometimes doing one manually and counting the steps can tell you how to automate the process.

Koz

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

Re: Declicking without Interpolating

Post by steve » Sun Jun 08, 2014 9:05 am

Reliably finding clicks automatically without "false positives" is difficult.
"Paul L" has been making good progress on detecting vocal clicks (http://forum.audacityteam.org/viewtopic ... 49#p245549) and somewhere else on the forum is a plug-in that detects "peak inversion" (digital wrap-around), but as yet no-one has written a general solution for accurately detecting clicks.

Working with more than one track at a time is tricky with Nyquist. Where mono tracks are used it is easier to join them into one stereo track before processing, then split the stereo track back to two mono tracks after processing (the code here may then be useful: http://forum.audacityteam.org/viewtopic ... 27#p164527)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

innocenceisdeath
Posts: 4
Joined: Sat Jun 07, 2014 12:21 pm
Operating System: Please select

Re: Declicking without Interpolating

Post by innocenceisdeath » Sun Jun 08, 2014 10:38 am

Thanks for the advice. Given that it is difficult to work with multiple tracks (and assuming clicks can be accurately detected), would it be possible to instead log the location and duration of the clicks to a file. Then use this log file to mute the clicks in one track, and mute everything but the clicks in the other?

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

Re: Declicking without Interpolating

Post by steve » Sun Jun 08, 2014 10:04 pm

innocenceisdeath wrote:Given that it is difficult to work with multiple tracks (and assuming clicks can be accurately detected), would it be possible to instead log the location and duration of the clicks to a file. Then use this log file to mute the clicks in one track, and mute everything but the clicks in the other?
Yes that could be done (assuming, as you say, that the clicks can be accurately detected).

There is a slight problem that Nyquist does not know much about the computer file system so file handling is not great, but see http://manual.audacityteam.org/o/man/sa ... xport.html as an example of how output files can be specified.

You could analyze the fault track and in one pass detect the clicks, write a text file with start/end times for each correction, and mute those parts. Then run a plug-in that reads the text file and mutes everything except for those parts.

Alternatively (and possibly easier to program) you could write a WAV file to disk that has amplitude 0 where you want to mute the track and amplitude 1.0 where you want the track not muted. Example: to mute from 0.0 to 3.0 seconds and from 3.5 seconds to the end of the selected track, leaving 3.0 to 3.5 seconds not muted:

Code: Select all

; find the end of the selection
(setq dur (get-duration 1))

;; "controlwave" is the waveform that would be written to disk
(setf controlwave
  (abs-env
    (pwlv 0 3.0 0 3.0 1 3.5 1 3.5 0 dur 0)))

;; Applying the controlwave to the selected audio
(mult controlwave s)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply