Declicking without Interpolating

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.

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


Reliably finding clicks automatically without “false positives” is difficult.
“Paul L” has been making good progress on detecting vocal clicks ( 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:

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?

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 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:

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

;; "controlwave" is the waveform that would be written to disk
(setf controlwave
    (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)