A smoothing algorithm for noise reduction of MATLAB learning

Source: Internet
Author: User
Tags sin

Smooth noise reduction test, code as follows

% smoothing de-noising% FFT transform and wavelet transform Clcclfclearlength_of_sig=128;x=linspace (0,2*pi,length_of_sig);% signal=5*sin (x) +2*sin (5*x) + RANDN (x); This is wrong in the book, the parameter requirement in the random number is the integer raw=5*sin (x) +2*sin (5*x), Signal=5*sin (x) +2*sin (5*x) +randn (1,length_of_sig); jiequ= 16;TRANSF=FFT (signal); Filter_transf (1:jiequ) =transf (1:jiequ); Filter_transf (Length_of_sig-jiequ:length_of_sig) = Transf (Length_of_sig-jiequ:length_of_sig); Filter_signal=ifft (FILTER_TRANSF);% before_hist=real (transf);% After_ Hist=hist (before_hist);% After_hist=histogram (before_hist); [Xd1,cxd1,lxd1] = Wden (signal, ' sqtwolog ', ' h ', ' SLn ', 3, ' db3 '); [Xd2,cxd2,lxd2] = Wden (signal, ' sqtwolog ', ' s ', ' one ', 2, ' db3 ');p lot (x,signal, ' k--') hold on;% plot (X,raw, ' r ') ' No noise signal ', Plot (x,filter_signal, ' B ') plot (x,xd1);  Plot (X,XD2);  Legend (' No noise signal + noise ', ' FFT recovery signal ',...    ' Wavelet 1 Recovery signal ', ' wavelet 2 recovery signal ')% from the results it appears that the Wavelet 2 and the FFT effect are good.

  

Reference:

1, Matlab tutorial, example 1.6 Fourier transform and signal analysis, then found that the change course is based on matlab5.2.

2, seven-medium filtering method test MATLAB implementation (turn)

A smoothing algorithm for noise reduction of MATLAB learning

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.