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.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

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,050
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 12th June 2012, 12:05   #6  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,050
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   #7  |  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 13th June 2012, 09:10   #8  |  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   #9  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,050
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 11th June 2012, 22:33   #10  |  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   #11  |  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   #12  |  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   #13  |  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   #14  |  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, 18:27   #15  |  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, 22:40   #16  |  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   #17  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,050
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, 16:32   #18  |  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
Old 15th June 2012, 16:14   #19  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,050
Quote:
Originally Posted by Poutnik View Post
That I think either. Or from microwave oven, magnetrons or klystrons or whatever is inside can be very powerful in side effects.
Probably not - microwave oven is made as a Faraday cage - also magnetron is relatively narrow band RF source and front-end attenuate everything above 1GHz so for 2.4GHz overall attenuation should be quite high.

Switching large electric power without proper decoupling create spikes which have high energy and very high bandwidth. This can be compared at some point to EMP.

Quote:
Originally Posted by Poutnik View Post
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.
Signal power is less important than BER (or "quality") - there can be high power signal with BER over 1.0E-4 and this mean visible and audible glitches.
My advice - instead of building common antenna installation, use home antenna, passive, no amplifier.

And also seems that You should be able to raise this problem to government authority responsible for quality of the RF spectrum - it is forbidden to corrupt RF signal - they should help you - this is mandatory for them - usually there special agency in telecommunication ministry - they searching for illegal transmitters but also they search for sources of such spikes.
pandy is offline   Reply With Quote
Old 16th June 2012, 13:25   #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
Probably not - microwave oven is made as a Faraday cage - also magnetron is relatively narrow band RF source and front-end attenuate everything above 1GHz so for 2.4GHz overall attenuation should be quite high.

Switching large electric power without proper decoupling create spikes which have high energy and very high bandwidth. This can be compared at some point to EMP.
I have meant rather along the power lines noise.
E.g. using digital video output from videocard, to monitor picture is fine. But during temporal period I used integrated intel graphics with analog output. At that time monitor picture was very eye-disturbing, if my microwave oven was working.

Quote:
My advice - instead of building common antenna installation, use home antenna, passive, no amplifier.
I am afraid my low floor location ad position away from signal,
without direct visibility and with reflection from other buildings will not be satisfactory.

I used initially a simple dipole, coming with my receiver,
but strength and quality was very poor. Than I bought room active antenna,
strength and quality better, but still not excellent.
The common source was much better.

All that struggles are not worthy for me to solve.
Either I can take the signal as it is,
either I fix it and I already know how.

Thanks all for the support.
__________________
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 13:31.


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