Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th June 2012, 11:40   #1  |  Link
Poutnik
Useless idea generator
 
Poutnik's Avatar
 
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 332
Limiting amplitude of audio spikes

Is there recommended automated way to remove audio spikes,
based on limiting of amplitude of WAV/MP2 of audio record ?

I often do processing of DVB-T videos for personal archive purposes.
I use ProjectX to fix transmittion errors and process m2v and wav/mp2 files with MeGUI..

There are occasional spikes of maximum amplitude, some dozens ms in duration.
The problem with them is they ruin listener comfort.
They make squeezing noise and player often set volume temporarily weaker.

I fix it eventually by manual way in Audacity by setting silence there.

Is there an automated way, best by command line,
that either selectively limit amplitude under given values,
or fix/replace such a piece ?

I have not found in Audacity, or elsewhere, automated way, but I am not familiar with it audio processing so much.
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 /
focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC]

Last edited by Poutnik; 10th June 2012 at 11:45. Reason: minor edit
Poutnik is offline   Reply With Quote
Old 10th June 2012, 12:00   #2  |  Link
Poutnik
Useless idea generator
 
Poutnik's Avatar
 
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 332
I tried to search Int/Ext Avisynth filters, but I am afraid nothing usable, possibly some clever script......

There are some filters in Audacity to remove something like that, but it is probably aimed to much shorter analog spikes.
These ones seem to be corrupted 24/48 ms mp2 audio chunks, and filters do not catch them at any parameter settings.
But I can be wrong, as I am novice in AC.

But best way would be command line filter.
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 /
focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC]

Last edited by Poutnik; 10th June 2012 at 12:06.
Poutnik is offline   Reply With Quote
Old 10th June 2012, 12:16   #3  |  Link
Poutnik
Useless idea generator
 
Poutnik's Avatar
 
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 332
Hm, I got an idea, it should be simple.

Audacity has amp scale -1.0 .. 1.0, the signal amp is usually within -0.5 .. 0.5, with spikes -1 .. 1.
If I amplify it in Avisynth by proper coef, it should discriminate the spikes, and not yet the signal.
Then I could attenuate it back again.
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 /
focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC]
Poutnik is offline   Reply With Quote
Old 11th June 2012, 11:57   #4  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,048
foobar2000 hard -6dB limiter or advanced limiter - but... what is reason for such spikes? Perhaps improving reception will make stream glitch free - solving spike issue should start from root.

Quote:
Originally Posted by Poutnik View Post
Hm, I got an idea, it should be simple.

Audacity has amp scale -1.0 .. 1.0, the signal amp is usually within -0.5 .. 0.5, with spikes -1 .. 1.
If I amplify it in Avisynth by proper coef, it should discriminate the spikes, and not yet the signal.
Then I could attenuate it back again.
Spikes ALWAYS will be on +-1 for digital samples - digital signal can't be higher or lower than +-1 - spikes are errors when decoder produce error sample value due lack or due of corrupted data.

Last edited by pandy; 11th June 2012 at 12:00.
pandy is offline   Reply With Quote
Old 11th June 2012, 20:42   #5  |  Link
Poutnik
Useless idea generator
 
Poutnik's Avatar
 
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 332
Quote:
Originally Posted by pandy View Post
foobar2000 hard -6dB limiter or advanced limiter - but... what is reason for such spikes? Perhaps improving reception will make stream glitch free - solving spike issue should start from root.
I am interested rather on encoding side than playback side.

I agree with improving idea, but this would be problem. It is a block of flat common wall source of TV signal, based on DVB-T receiver.

Sometimes there is none, sometimes 2-3, sometimes 20 in case of near thunderstorm. I would say ProjectX would eliminate most of them, but it seems not.

Quote:
Spikes ALWAYS will be on +-1 for digital samples - digital signal can't be higher or lower than +-1 - spikes are errors when decoder produce error sample value due lack or due of corrupted data.
I am afraid you are wrong here. They are not digital 1-0.
+/- 1 is relative scale of sound amplitude stored in WAV format.
Of course wave format cannot produce more than what can produce.
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 /
focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC]
Poutnik is offline   Reply With Quote
Old 11th June 2012, 22:33   #6  |  Link
turab
Registered User
 
Join Date: Apr 2012
Posts: 38
I think this is what you want: http://manual.audacityteam.org/man/Low_Pass_Filter. Your approach isn't so good because of the scaling.
turab is offline   Reply With Quote
Old 12th June 2012, 07:00   #7  |  Link
Poutnik
Useless idea generator
 
Poutnik's Avatar
 
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 332
Quote:
Originally Posted by turab View Post
I think this is what you want: http://manual.audacityteam.org/man/Low_Pass_Filter. Your approach isn't so good because of the scaling.
Thanks. I am aware about existence of low pass filters,
but I am afraid it cannot be distinguished by frequency from signal.
It would probably attenuate the majority of signal.

I think my the approach is acceptable
as there are not such quality demands as for CD audio.

I can try it.
Or, I can look for Avisynth alternative for
mp2/wav -> Avisynth -> wav
or
mp2/wav -> Avisynth -> BEpipe/wavi -> NeroAAC CLI encoder
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 /
focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC]
Poutnik is offline   Reply With Quote
Old 12th June 2012, 10:28   #8  |  Link
markanini
Registered User
 
Join Date: Apr 2006
Posts: 299
Please upload a short clip (audio only) containg the spikes.
markanini is offline   Reply With Quote
Old 12th June 2012, 11:21   #9  |  Link
Poutnik
Useless idea generator
 
Poutnik's Avatar
 
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 332
Well, currently I have none, no DVB-T MPG to process.
Later at home I will try t get one and upload it. I bet none will occur if I want to find it :-)

In Audacity the Hard Limiter within LADSPA Effects does exactly what I want.

Even better would be some automated Avisynth processing.
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 /
focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC]
Poutnik is offline   Reply With Quote
Old 12th June 2012, 11:49   #10  |  Link
Poutnik
Useless idea generator
 
Poutnik's Avatar
 
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 332
As I said . :-)
I have remotely checked some 55 min freshly recorded document, and no spikes there in demuxed ProjectX processed WAV,
not even in original MPEG2 PS.
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 /
focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC]
Poutnik is offline   Reply With Quote
Old 12th June 2012, 12:05   #11  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,048
Quote:
Originally Posted by Poutnik View Post
I am interested rather on encoding side than playback side.
foobar can decode and encode with DSP processing in real time.

Quote:
Originally Posted by Poutnik View Post
I agree with improving idea, but this would be problem. It is a block of flat common wall source of TV signal, based on DVB-T receiver.
Better antenna? Like Biquad for example:

https://www.youtube.com/watch?v=gHwZEEFvnVM
http://www.cnet.de/praxis/wochenend/...ro_basteln.htm
http://wirbel.htpc-forum.de/electron...ad/index2.html

Quote:
Originally Posted by Poutnik View Post
Sometimes there is none, sometimes 2-3, sometimes 20 in case of near thunderstorm. I would say ProjectX would eliminate most of them, but it seems not.
ProjectX can't help you to improve reception and signal with errors can be decoded correctly - key to solve your issue is improve RF signal reception which should be made with proper hardware (antenna and antenna localization)

Quote:
Originally Posted by Poutnik View Post
I am afraid you are wrong here. They are not digital 1-0.
+/- 1 is relative scale of sound amplitude stored in WAV format.
Of course wave format cannot produce more than what can produce.
No, i use +-1 as float values - in fact it should be or +-0.5 or 0 - 1 for integer PCM but i understand your convention and i use this convention.
pandy is offline   Reply With Quote
Old 12th June 2012, 14:15   #12  |  Link
Poutnik
Useless idea generator
 
Poutnik's Avatar
 
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 332
Quote:
Originally Posted by pandy View Post
foobar can decode and encode with DSP processing in real time.
I suppose so, for sound it should not be difficult. But I would prefer Avisynth solution I am more familiar with.

I would not say the problem is the signal strength, but some unclear disturbations in the signal.

Quote:
ProjectX can't help you to improve reception and signal with errors can be decoded correctly - key to solve your issue is improve RF signal reception which should be made with proper hardware (antenna and antenna localization)
Yes, PX cannot improve reception, this is matter of antenna systems.
But No, Antenna systems would not help you with signal path, and PX does help to fix the record at least to look nicer for
video processing systems, keeping A/V synchronization, and at the worst case to omit 1/2s - 12 frame GOP from MPG.

Typical value is 2 clicks per 90min movie, that is too few for just weak signal.
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 /
focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC]
Poutnik is offline   Reply With Quote
Old 12th June 2012, 18:27   #13  |  Link
Poutnik
Useless idea generator
 
Poutnik's Avatar
 
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 332
Interesting option for automation would be CLI swiss knife for sound processing

SOX ( Sound Exchange from sourceforge)

and/or with

Avisynth External_filters#Audio_Filters - Sox Audio Effect Filter by Sh0dan
Sox Audio Effect Filters v1.1 beta
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 /
focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC]
Poutnik is offline   Reply With Quote
Old 13th June 2012, 09:10   #14  |  Link
Poutnik
Useless idea generator
 
Poutnik's Avatar
 
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 332
Quote:
Originally Posted by pandy View Post

Better antenna?
The local city DVB-T transmitter is about 2-3 km at direct visibility.
The signal must be strong enough. Stronger signal could make things even worse, with possibility of over saturation of receiver input.

Even in opposite case,
I cannot imagine I would persuade the council of housekeepers to buy a new antenne.
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 /
focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC]

Last edited by Poutnik; 13th June 2012 at 09:14.
Poutnik is offline   Reply With Quote
Old 13th June 2012, 12:31   #15  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,048
Quote:
Originally Posted by Poutnik View Post
The local city DVB-T transmitter is about 2-3 km at direct visibility.
The signal must be strong enough. Stronger signal could make things even worse, with possibility of over saturation of receiver input.
Oh please - typical cheap RF frontend is able to receive signals with level up to 80dBuV (microvolts), most of RF frontends deals quite well with signal even up to 95dBuV, i know frontends that can't be saturated even for 108dBuV (customer equipment not studio) - we talking about very high level signal - most likely active antennas can be saturated thus AVOID active antennas (equipped with amplifier).
If your current configuration is susceptible to interferences search for better one even at a cost of signal level, if not use directional antenna to improve immunity for interferences, you can reduce level of signal with simple fixed 10 - 20dB attenuator if You think that this will help. However solve root cause not search for method to fix corrupted signal.

Quote:
Originally Posted by Poutnik View Post
Even in opposite case,
I cannot imagine I would persuade the council of housekeepers to buy a new antenna.
I can imagine - they buying new home appliances, washing liquid etc - sometimes if current configuration is Not OK you need to fix problem by buying antenna not searching algorithms for fixing corrupted signal (imagine that you persuade housekeepers to fix corrupted signal with DSP algorithms).

Of course there is possibility that broadcaster distribute corrupted signal but even today usually broadcaster care about technical side of the RF emission.
pandy is offline   Reply With Quote
Old 13th June 2012, 15:31   #16  |  Link
Poutnik
Useless idea generator
 
Poutnik's Avatar
 
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 332
Quote:
Originally Posted by pandy View Post
Oh please - typical cheap RF frontend is able to receive signals with level up to 80dBuV (microvolts), most of RF frontends deals quite well with signal even up to 95dBuV, i know frontends that can't be saturated even for 108dBuV (customer equipment not studio) - we talking about very high level signal - most likely active antennas can be saturated thus AVOID active antennas (equipped with amplifier).
If your current configuration is susceptible to interferences search for better one even at a cost of signal level, if not use directional antenna to improve immunity for interferences, you can reduce level of signal with simple fixed 10 - 20dB attenuator if You think that this will help.
OK, I am not expert in TV antenna receiver, i was just guessing it is possible to saturate sensitive input amplifiers, getting them to non-linear stage, or cross interference dues non linearity.
Quote:

However solve root cause not search for method to fix corrupted signal.
Fixing signal can be much easier in this scenario, than finding root cause. Especially if there can be no error during the whole hour.

And, NO real signal is error free, and any processing of real signals must count with errors and their fixing.

Note that the cause need not to be in antenne system at all.

Quote:
I can imagine - they buying new home appliances, washing liquid etc
Not here.... It is not about housekeepers of my flat, it is about housekeeping of block of 100 flats.

Quote:
- sometimes if current configuration is Not OK you need to fix problem by buying antenna not searching algorithms for fixing corrupted signal (imagine that you persuade housekeepers to fix corrupted signal with DSP algorithms).
No, I cannot imaging I make them to replace antennas, to replace recivers to replace cables in the whole block of flat,
to realize nothing helped. Especially if nobody complains about TV quality.
It is a common system for the whole block.

I would be treated as an overdemanding fool.
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 /
focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC]

Last edited by Poutnik; 13th June 2012 at 17:58.
Poutnik is offline   Reply With Quote
Old 13th June 2012, 22:40   #17  |  Link
Poutnik
Useless idea generator
 
Poutnik's Avatar
 
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 332
Another 2h10m recording, not even one spike.
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 /
focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC]
Poutnik is offline   Reply With Quote
Old 14th June 2012, 10:33   #18  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,048
Once again - Czech use same standards as surrounding countries, perhaps you can replace common antenna with local antenna - DVB-T use lot of error corrections methods, there COFDM modulation, there is convolutional codding + Reed Solomon, but at some point none of them is efficient enough to correct uncorrectable errors - perhaps antenna and amplifier receive strong EM signal from some electrical motor with poorly done decoupling - such flash of energy can blind (saturate) amplifier and mask signal.
And one thing additional - perhaps something is wrong with your receiver? If no one complain except you.
pandy is offline   Reply With Quote
Old 14th June 2012, 15:41   #19  |  Link
Ghitulescu
Registered User
 
Ghitulescu's Avatar
 
Join Date: Mar 2009
Location: Germany
Posts: 5,765
I assume there are video errors as well
I'd rather spend some hours in adjusting the antenna, rather than in encoding the audio (and/or video) with editing. DVB-T has anyway such a low bitrate that makes transcoding into a "more compact" format merely a waste of time.
__________________
Born in the USB (not USA)
Ghitulescu is offline   Reply With Quote
Old 14th June 2012, 16:32   #20  |  Link
Poutnik
Useless idea generator
 
Poutnik's Avatar
 
Join Date: Apr 2004
Location: Europe, Czech Republic, Brno
Posts: 332
Quote:
Originally Posted by pandy View Post
........... ,but at some point none of them is efficient enough to correct uncorrectable errors - perhaps antenna and amplifier receive strong EM signal from some electrical motor with poorly done decoupling - such flash of energy can blind (saturate) amplifier and mask signal.
That I think either. Or from microwave oven, magnetrons or klystrons or whatever is inside can be very powerful in side effects.
Quote:
And one thing additional - perhaps something is wrong with your receiver? If no one complain except you.
Rare error people would not almost notice, will forgot,
or if not forgot, not remember to mention.

It would have be much worse for case otherwise.

BTW vendor TV application shows 7/7 dots of signal power.
__________________
Vista64 Premium SP2 / C2D E4700 2.6GHz/ 6GB RAM/ Intel GMA 3100 / DTV Leadtek DONGLE GOLD USB2 /
focused to DVB-T MPEG2 PS capture -> ProjectX -> M2V/MP2 -> MeGUI/AVS -> MP4[AVC/AAC]
Poutnik is offline   Reply With Quote
Reply

Tags
audio, errors, fix, spikes, transmittion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 15:58.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.