Filtering out a telephone touch tone.
Forum rules
Audacity 1.3.x is now obsolete. Please use the current Audacity 2.1.x version.
The final version of Audacity for Windows 98/ME is the legacy 2.0.0 version.
Audacity 1.3.x is now obsolete. Please use the current Audacity 2.1.x version.
The final version of Audacity for Windows 98/ME is the legacy 2.0.0 version.
Filtering out a telephone touch tone.
Hi - I accidentally previously posted this to the wrong forum...
I use Audacity to manipulate audio recorded via a telephone. At the end of each call, people press the touch tone "1". I'd like to filter this out (rather than having to locate it and deleting it). A touch tone 1 is a sinusoidal tone of both 1209 Hz and 697 Hz. Any ideas on how I can filter this without impacting the spoken audio? Thanks.
I use Audacity to manipulate audio recorded via a telephone. At the end of each call, people press the touch tone "1". I'd like to filter this out (rather than having to locate it and deleting it). A touch tone 1 is a sinusoidal tone of both 1209 Hz and 697 Hz. Any ideas on how I can filter this without impacting the spoken audio? Thanks.
-
kozikowski
- Forum Staff
- Posts: 69367
- Joined: Thu Aug 02, 2007 5:57 pm
- Operating System: macOS 10.13 High Sierra
Re: Filtering out a telephone touch tone.
DTMF Dual Tone Multi Frequency was chosen so that each "number" combination was robust and unique even though transmitted through a distorted telephone system. If you had the actual pure DTMF tones, you could probably filter them out with a Nyquist or two. But if they're the slightest bit distorted, you're also going to have harmonics of both tones straight up through the audio performance. 697, 1394, 2091.
Somewhere between 440 and 1000 is considered the "middle" frequency of everything you can hear.
Also there is a specification as to the accuracy of those tones and they don't always sound at the same frequencies, so fixed notches are not the answer.
As a first pass, I would sample the tone(s) in the Noise Removal Profile tool and then use that to try and get rid of it in the final performance as a Noise Removal task.
However, by the time you made the tones vanish, I'm betting the actual show is going to start sounding funny, swimmy, or gargly. That and applying a complex filter tool to an entire performance may take longer than had you just gone ahead and removed the tones manually.
Koz
Somewhere between 440 and 1000 is considered the "middle" frequency of everything you can hear.
Also there is a specification as to the accuracy of those tones and they don't always sound at the same frequencies, so fixed notches are not the answer.
As a first pass, I would sample the tone(s) in the Noise Removal Profile tool and then use that to try and get rid of it in the final performance as a Noise Removal task.
However, by the time you made the tones vanish, I'm betting the actual show is going to start sounding funny, swimmy, or gargly. That and applying a complex filter tool to an entire performance may take longer than had you just gone ahead and removed the tones manually.
Koz
Re: Filtering out a telephone touch tone.
OK, thanks for the reply. I have 200 - 300 audio files that I need to go through in a day, so I was hoping to be able to use Audacity chains in an automated way. I tried the noise removal tool, but that barely had an effect on the touch tones.
-
kozikowski
- Forum Staff
- Posts: 69367
- Joined: Thu Aug 02, 2007 5:57 pm
- Operating System: macOS 10.13 High Sierra
Re: Filtering out a telephone touch tone.
Can you post say :30 or so of typical dialog with the tones included? Try to avoid MP3 as it has its own distortion. WAV is good.
Are you sure Noise Removal is one of the tools you can chain? It's not a very long list.
Koz
Are you sure Noise Removal is one of the tools you can chain? It's not a very long list.
Koz
-
kozikowski
- Forum Staff
- Posts: 69367
- Joined: Thu Aug 02, 2007 5:57 pm
- Operating System: macOS 10.13 High Sierra
Re: Filtering out a telephone touch tone.
You win. It's number four in Mac Audacity 1.3.7 chains list.
Koz
Koz
Re: Filtering out a telephone touch tone.
Thanks for the replies and the assistance Koz!
I tried uploading files to this thread, but the bulletin board software told me that .wav and .mp3 extensions weren't supported. Even when I removed the extensions or tried to make the extensions .doc it didn't work. So instead I uploaded them to a web server. They can be found here:
http://www.lifeonrecord.com/koz/Sample-1-For-Koz.wav
http://www.lifeonrecord.com/koz/Sample-2-For-Koz.wav
http://www.lifeonrecord.com/koz/Sample-3-For-Koz.wav
I cut them down to be thirty seconds or less. You should be able to right click on the link (on a PC anyway) to save the file to your computer.
Sample files...
I tried uploading files to this thread, but the bulletin board software told me that .wav and .mp3 extensions weren't supported. Even when I removed the extensions or tried to make the extensions .doc it didn't work. So instead I uploaded them to a web server. They can be found here:
http://www.lifeonrecord.com/koz/Sample-1-For-Koz.wav
http://www.lifeonrecord.com/koz/Sample-2-For-Koz.wav
http://www.lifeonrecord.com/koz/Sample-3-For-Koz.wav
I cut them down to be thirty seconds or less. You should be able to right click on the link (on a PC anyway) to save the file to your computer.
Sample files...
Re: Filtering out a telephone touch tone.
The best results that I can get are by using a couple of notch filters.
Try running this code in the "Nyquist Prompt" box ("Effect" menu) on some of the files:
Unfortunately you can not run this as a batch (chain), but you can run it on multiple files at the same time (load in your tracks, then Ctrl+A to select All, then run the Nyquist script.)
BTW, the samples that you posted have tones at around 941Hz and 1477 Hz, hence those numbers in the Nyquist script. If you have recordings with different frequencies, use the "Analyze" function to find the frequencies and change the script accordingly.
Try running this code in the "Nyquist Prompt" box ("Effect" menu) on some of the files:
Code: Select all
(notch2 (notch2 s 941 1) 1477 1)BTW, the samples that you posted have tones at around 941Hz and 1477 Hz, hence those numbers in the Nyquist script. If you have recordings with different frequencies, use the "Analyze" function to find the frequencies and change the script accordingly.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Filtering out a telephone touch tone.
Wow, I tried that out, and it's very helpful. I know this is an Audacity forum, but since I can't run these in batch, I'll do some research and see what the comparable SoX commands might be. I think to lower overall distortion, I'll try and select the last four seconds of audio in Sox, and run the filter on that. Thanks again.
-
kozikowski
- Forum Staff
- Posts: 69367
- Joined: Thu Aug 02, 2007 5:57 pm
- Operating System: macOS 10.13 High Sierra
Re: Filtering out a telephone touch tone.
I think I would be searching for a filter that knew what DTMF touchtones were. As is obvious by now, they're not all the same pitch and multiple tracks are going to wander. The filter can't wander, and even if it did, it would create some serious distortion in the show. That's the elephant in the room. If you leave the filters running and the talent has a voice that falls in the holes, that will cause some significant problems.
Koz
Koz
Re: Filtering out a telephone touch tone.
You can adjust the narrowness of the notch filter by adjusting the "Q" parameter.
The narrower the notch is, the less damage is done to the show, but if it is too narrow than it may miss the tone frequency altogether.
In the code example given previously the "Q" factor was set at 1.0
The format of a single notch filter is:
function sound frequency Q
So you can probably work out that the code provides two notches, one at 941 Hz and another at 1477 Hz, both with a Q of 1.0
The higher the Q factor, the narrower the notch.
So to produce 2 notches at those frequencies, but with notches only half as wide we would use a Q of 2.0 like this
If the notch is too narrow, it will also tend to cause ringing.
I chose a Q value of 1 as this was plenty wide enough to catch the tones in all of the given samples, while producing very little noticeable deterioration of the rest of the recording. A lightly higher Q value could have been used (perhaps up to about 2.0) but there is little if any improvement on the given files, and a greater chance of missing the frequencies on other tracks.
I was surprised at how consistent the tone frequencies were on those 3 files. If the other files have tones equally close then you should have no trouble at all inmaking substantial reductions.
The narrower the notch is, the less damage is done to the show, but if it is too narrow than it may miss the tone frequency altogether.
In the code example given previously the "Q" factor was set at 1.0
The format of a single notch filter is:
function sound frequency Q
So you can probably work out that the code provides two notches, one at 941 Hz and another at 1477 Hz, both with a Q of 1.0
The higher the Q factor, the narrower the notch.
So to produce 2 notches at those frequencies, but with notches only half as wide we would use a Q of 2.0 like this
Code: Select all
(notch2 (notch2 s 941 2.0) 1477 2.0)I chose a Q value of 1 as this was plenty wide enough to catch the tones in all of the given samples, while producing very little noticeable deterioration of the rest of the recording. A lightly higher Q value could have been used (perhaps up to about 2.0) but there is little if any improvement on the given files, and a greater chance of missing the frequencies on other tracks.
I was surprised at how consistent the tone frequencies were on those 3 files. If the other files have tones equally close then you should have no trouble at all inmaking substantial reductions.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)