530 likes | 736 Views
“Noise Gate”. Texas Instruments University Programme Teaching Materials. Noise Gate. Introduction. Listening to speech when there is a high level of background noise can be fatiguing A “noise gate” only lets through speech, but blocks background noise
E N D
“Noise Gate” Texas Instruments University Programme Teaching Materials
Introduction • Listening to speech when there is a high level of background noise can be fatiguing • A “noise gate” only lets through speech, but blocks background noise • It is useful in applications where there is a high level of ambient noise, for example in an aircraft
Objectives • To look at the properties of signals and noise • To introduce autocorrelation • To apply autocorrelation to signals and random noise • To implement a noise gate on the TMS320C5505 USB stick.
Knowledge Required • In order to fully understand the statistical techniques being discussed here, some additional reading is required on the following subjects: • Variance and Standard Deviation • 95% and 99% confidence levels • Details of an article on www.cnx.org by Michael Haag are given in the references section.
Signal and Noise • Between audio signals there is background noise. Audio Signal Background Noise
Background Noise • Is generated by random movement of electrons. • Sometimes described as “hiss” and “pop”. • Makes listening difficult. • If the background noise content is reduced, then the signal is easier to hear.
Replace Noise with Silence • Replace noise with silence for easier listening. Signal Silence
Set Simple Noise Thresholds • If –0.1 < input < 0.1 then output = 0: Trend Line Noise Thresholds
Problem: Small Signals Ignored • Small signals below threshold are ignored.
Problem: Noise Let Through • High levels of noise will be let through.
Problems with Thresholds • A simple threshold does not work because: • Low level signals are ignored • High level noise is let through • We need a better method to distinguish between • signals and noise • For this we will use autocorrelation.
Autocorrelation • The equation for the autocorrelation of a data series of size N is: • This is the “biased” correlation of a data series with itself • Autocorrelation calculates the energy/power in the data series.
Unbiased Autocorrelation • A variant of the autocorrelation process is to use “unbiased” autocorrelation • This is useful for periodic signals to keep the amplitude constant.
Expected Value and Variance • Expected value of the autocorrelation r11(j): • Variance of r11(j):
95% Confidence Limits • The 95% confidence limits (2 Standard Deviations) for autocorrelated random noise are: • When N = 100: • 95% Upper Confidence Limit = -0.01+0.20 = 0.19 • 95% Lower Confidence Limit = -0.01-0.20 = -0.21
99% Confidence Limits • The 99% confidence limits (3 Standard Deviations) for autocorrelated random noise are: • When N = 100: • 99% Upper Confidence Limit = -0.01+0.30 = 0.29 • 99% Lower Confidence Limit = -0.01-0.30 = -0.31
Confidence Limits Random Data 95% Confidence Limit 99% Confidence Limit
Statistical Identification • From the result of the autocorrelation, we can • distinguish between a signal and random noise using • statistics. • Our limits will be set by the number of Standard Deviations.
Identification of Noise • For random noise, only 1% of the autocorrelated values > 3 Standard Deviations. 99% Confidence Limit
Identification of Signal • For an audio signal, there should be ~10% of the autocorrelated values > 3 standard deviations. Values outside expected random range
Two Stage Autocorrelation • In speech analysis, the output of the autocorrelation is again autocorrelated • This greatly reduces a random data series to nearly zero.
Two Stage Autocorrelation 0.3 0.0015
Autocorrelation • Autocorrelation is implemented using the acorr() function in DSPLIB. • The input data to acorr() needs to be scaled so that it lies in the range –4096 to +4095, otherwise overload occurs. • A convenient frame size 128 is elements. • The 95% confidence limits have been used.
Supported Autocorrelation • The function acorr() supports the following types of autocorrelation: • Raw • Biased • Unbiased • The required type is selected using the keyword “bias”, “unbias” or “raw” when calling the acorr() function.
Connecting up the System USB Stick USB to PC Microphone Headphones
Installing the Application • Copy the code given in Application16 Noise Gate to the workspace • Follow the steps previously given in Chapter 1 to set up the new project.
Console • First setting – determine if input is signal or noise • Second setting – noise gate.
About the Program • Makes the decision whether the input is: • signal • noise • If the input is a signal, output = input • If the input is noise over a certain duration, then output = 0 (silence) • The attack time (the time from off to on) and decay times are adjustable.
High Pass Filter • A 150 Hz filter cuts off low frequency mains noise.
Autocorrelation Length • Change BUFFER_SIZE from 128 to 256 in autocorrelation.c • It will be necessary to calculate new 95% confidence limits.
Autocorrelation Types • In the call to acorr() in autocorrelation.c, experiment with “raw”, “bias” and “unbias” • Try each type autocorrelation with: • an audio signal • random noise • mixture of signal + noise.
“bias” and “unbias” • In the case of “bias” and “unbias”, the autocorrelation output is divided by the number of samples N, here 128 • Therefore the confidence limits will also need to be divided by the number of samples N.
Questions • Why is it not possible to use simple thresholds to distinguish between signals and noise? • What are the differences between the autocorrelation of signals and random noise? • How do we use autocorrelation to decide between signal and noise? • What is the best type of autocorrelation (raw, biased or unbiased) to detect: • random noise • audio signal?