"Reprint" MATLAB for speech signal plus random noise and denoising program

Source: Internet
Author: User

MATLAB for speech signal plus random noise and denoising program(2011-01-28 23:26:51)% The original time-domain waveform analysis and spectrum analysis for language signals

[Y,fs,bits]=wavread (' C:\Documents and settings\administrator\ desktop \cuocuo.wav ');

% Sound (Y,FS)% playback of voice signals

N=length (y)% Select the number of points to transform

Y_p=fft (Y,n); % Fourier transform to frequency domain for n points

f=fs* (0:n/2-1)/n; % corresponds to the frequency of the point

Figure (1)

Subplot (2,1,1);

Plot (y); % voice signal time domain waveform diagram

Title (' Original speech signal sampling time domain waveform ');

Xlabel (' Timeline ')

Ylabel (' Amplitude A ')

Subplot (2,1,2);

Plot (F,abs (y_p (1:N/2))); % Voice Signal spectrum graph

Title (' Spectral graph after sampling of the original speech signal ');

Xlabel (' frequency Hz ');

Ylabel (' frequency amplitude ');

% noise generated for audio signals

L=length (y)% calculates the length of the audio signal

NOISE=0.1*RANDN (l,2); % generates a random noise signal of equal length (the size of the noise here depends on the amplitude multiples of the random function)

Y_z=y+noise; % two signals are superimposed into a new signal--plus noise processing

%sound (Y_Z,FS)

% Analysis of voice signals after noise suppression

N=length (y); % Select the number of points to transform

Y_zp=fft (Y_z,n); % Fourier transform to frequency domain for n points

f=fs* (0:n/2-1)/n; % corresponds to the frequency of the point

Figure (2)

Subplot (2,1,1);

Plot (y_z); % noise-cancelling speech signal time domain waveform diagram

Title (' Noisy voice signal time domain waveform ');

Xlabel (' Timeline ')

Ylabel (' Amplitude A ')

Subplot (2,1,2);

Plot (F,abs (Y_zp (1:N/2))); % noise-cancelling speech signal spectrum graph

Title (' Noise-cancelling speech signal spectrum graph ');

Xlabel (' frequency Hz ');

Ylabel (' frequency amplitude ');

The noise cancellation procedure for noisy speech signals is as follows:

fp=1500;fc=1700; as=100; Ap=1;

(The above is the performance index of the low-pass filter)

wc=2*pi*fc/fs; wp=2*pi*fp/fs;

WDEL=WC-WP;

beta=0.112* (As-8.7);

N=ceil ((As-8)/2.285/wdel);

wn= Kaiser (N+1,beta);

Ws= (WP+WC)/2/pi;

B=fir1 (N,WS,WN);

Figure (3);

FREQZ (b,1);

(Previously low-pass filter design phase)--The next procedure to remove the noise signal--

X=fftfilt (b,y_z);

X=fft (X,n);

Figure (4);

Subplot (2,2,1);p lot (F,abs (Y_ZP));

Title (' Spectrum of pre-filtering signals ');

Subplot (2,2,2);p lot (F,abs (X));

Title (' Filtered signal spectrum ');

Subplot (2,2,3);p lot (y_z);

Title (' Waveform of pre-filter signal ')

Subplot (2,2,4);p lot (x);

Title (' Waveform of the filtered signal ')

%sound (x,fs,bits)% playback of filtered audio

Design filters:

The methods commonly used are: impulse response invariance and bilinear transformation method.

We know in the digital signal that the impulse response does not have the benefit of the simulation angular frequency ω and the digital frequency W presents a linear relationship w=ωt, but the main disadvantage is that it will produce a spectrum aliasing, so that the frequency response of the digital filter deviates from the frequency of the analog filter. In order to overcome this shortcoming, we often adopt bilinear transformation method.

Below we give the design steps of IIR digital filter and FIR Digital filter:

First, the design steps of IIR filter are as follows:

(1), to determine the digital low-pass filter technical indicators: The pass band boundary frequency, the maximum attenuation of the pass band, the cutoff frequency of the band, the minimum attenuation of the band Resistance.

(2), the digital low-pass filter technical indicators into the response of the analog low-pass filter technical indicators.

(3), according to the analog low-pass filter technical indicators design analog low-pass filter.

(4) The Analog filter system function is converted into a digital low-pass filter system function by using the bilinear transform method.

Second, the FIR filter design steps are as follows: (Focus on Window function method)

(1), according to the attenuation of the resistance band and the requirements of the transition zone, select the Window function type (have: Rectangular window, triangular window, Henning window, Hamming window, Kaiser window, etc.), and estimated window length n. The Selection window function type is first followed by the drag band attenuation. In the case of ensuring the attenuation of the resistance band satisfies the requirement, select the window function in the main valve set as far as possible.

(2), constructs the frequency response function which the hope approximates.

(3), calculate h (n), finite long sequence

(4), plus window to get the design results.

"Reprint" MATLAB for speech signal plus random noise and denoising program

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.