Ticket #243 (new Bugs)

Opened 19 months ago

Last modified 44 hours ago

Possible distortion issue...

Reported by: MiiJaySung Owned by: admin
Priority: 1 Milestone:
Component: Liquidsoap Version:
Keywords: distortion filter noise Cc:
Mac OSX: yes Linux: yes
NetBSD: yes Other Operating System: yes
FreeBSD: yes

Description

Not sure entirely if this is a bug. Basically, as you might have saw on the mailing list, I had a issue with a small amount of noise being noticeable when the stream is supposed to be silent.

I did a very hacked filter (which I know distorts audio to some degree because of the way it works) based on this...

amplify(2.0, add([

clip(min = 0.01, max = 1.0, stream), clip(max = -0.01, min = -1.0, stream) ]))

Because I don't know how you can do a proper filter for white noise (i.e. one where you do a FFT to get the freq-amplitude domain, trim off anything that is below a the threshold where the noise stops, then do an inverse FFT to get back to the amp-time domain) I took this approach which I know will leave noise on when there is speech (it's not noticeable then), and I know it clips a bit of the singal as it tends towards 0 amplitude.

Besides the fact the above code is a dirty ugly hack which probably will find it's way on the "Daily WTF", the below code in theory shouldn't alter the audio noticeably (in an ideal world the result should be the same as the input, but obviously working in floats means there might be minimal change, though it shouldn't be an in any way noticeable).

amplify(2.0, add([

clip(min = 0.0, max = 1.0, stream), clip(max = -0.0, min = -1.0, stream) ]))

In the above, nothing is discarded, the signal just gets split into two +'ive and -'ive sections. The add should join them together and the 2x amp should just reverse the cancelling (well merging with 0) from the add operation. However I found it often makes a noticeable degradation which makes things sound quite metallic.

This isn't critical, as I should be doing my noise cancellation properly for a start, however basic filters shouldn't be distorting streams like this??? I'm not using raw buffering so I can't think it's int over/under flows.

Change History

Changed 19 months ago by smimram

A proper way of removing the noise when there is no sound would be to use the strip_blank operator and do something like

mksafe(strip_blank(length=0.1, stream))

You should also adjust the threshold parameter of strip_blank if the noise is noisier than -40dB.

Filtering blank noise is usually quite hard because it is not confined to a particular frequency range, so I'm not sure that FFT would help so much here without degrading the signal.

I cannot hear the degradation in your example above, are you sure that it does not come from somewhere else in your script? Notice that you don't need the amplify with

add(normalize=false, [clip(min = 0.0, max = 1.0, stream), clip(max = -0.0, min = -1.0, stream)])

Changed 44 hours ago by 太阳能

China is the world's commitment to implement energy-saving emission reduction targets, to enhance policy support the new energy economy strategy, accelerating the construction of solar photovoltaic technology in rural and urban areas of the application, the relevant state ministries launch solar roofs program. Solar roof planned efforts to break through the integration and solution architecture design of a lack of optical, optoelectronic products combined with low level of construction, optical and network problems, low market awareness of the problem. Solar Roofs Plan into consideration economic and social benefits and other factors, at this stage of economic development, industrial base cities to actively promote a better solar roofs, building integrated photovoltaic curtain wall and other optical model; actively support development in rural and remote areas from the net-generation, implementation of transmission to rural areas, the implementation of the national farmer-friendly policy. Solar roof planned to mobilize all sectors of society through the development of demonstration projects and promote the implementation of relevant national policies. Demonstration projects to strengthen advocacy, to expand its influence, increase market awareness, formation and development of solar photovoltaic products, a good social atmosphere; to promote the implementation of tariff and other Internet-sharing policy, the formation of policy together, amplifying the effect of policies; the optical construction applications as an important building energy efficiency content, in new construction, existing building energy-saving, actively promote the use of urban lighting. Policy limit sun roof demonstration project must be greater than 50kW, which requires at least 400 square meters of total floor area, construction is difficult to participate in the general population, eligible owners will focus on schools, hospitals and government and other public and commercial buildings. Ministry of Finance to consider subsidies, the cost of electricity can be reduced to 0.58 yuan / kWh. Whether PV electricity price electricity price in the thermal power given premium is not clear, but even without the premium, due to lower power generation cost sales price, the owners are still building solar power projects to generate electricity for personal use, replacement power purchased from power. Moreover, local governments can be expected to give additional subsidies, electricity costs will decline further  http://solar-poweronline.info/

Note: See TracTickets for help on using tickets.