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