[mythtv] Audio Glitch Detection

Martin Ebourne lists at ebourne.me.uk
Sun Aug 26 22:01:10 UTC 2007


On Mon, 27 Aug 2007 00:22:43 +1000, Daniel Burr wrote:
> Has any work ever been done regarding the ability to mute audio glitches
> during playback?

I've considered doing this but it's never got to the top of my todo
list, and my reception has improved so I don't very often get this
problem now.

>  Occasionally problems with OTA reception will cause
> part of the stream to be missing which produces very annoying high
> pitched "pop" and "squeak" sounds.  I know that some of the more
> upmarket STBs are able to detect when this is happening and apply a low
> pass filter or simply mute the audio.  Does anyone know of:
> 
> * any freely available documentation which outline algorithms for fixing
> audio glitches

I haven't looked, certainly be worth a google. These glitches are often
random like which is quite different from normal sound so I should think
there's a number of quite simple possibilities that would work well. One
obvious thing is the amplitude is very high, it's very uncommon for
normal sound to have numbers approaching maximum amplitude (the 0dB
level), so a simple check for multiple samples within the top couple of
dB could be a trigger.

I suspect the RMS value is also unusually high. A simple square each
sample and check the mean on each packet is probably what I'd try first.

An FFT would be the most reliable but I really doubt you'd need to get
to that level of complexity.

> * any other OSS which already implements it (Kaffeine, perhaps?) that
> MythTV can borrow code from?

I don't know of any.

> Lastly, would it make more sense for this functionality to be added to
> MythTV as it records or as it plays back?

I would do it as it plays back. I see the following advantages:

- If it malfunctions you can turn it off and continue watching the
program, as compared to having a wrecked recording.

- It might be useful on recordings imported into myth

- Be a lot easier to test

Means if you exported a recording to a player that didn't have this
functionality you wouldn't gain, but then maybe mythtranscode could use
it too.

Cheers,

Martin.



More information about the mythtv-dev mailing list