A list,

Noise reduction based on SVD (Singular value decomposition) is a subspace algorithm. To put it simply, we want to decompose the noisy signal vector space into two subspaces dominated by the pure signal and the noise signal, and then estimate the pure signal by simply removing the noisy signal vector components in the “noise space”. To decompose the noisy signal vector space into signal subspace and noise subspace, orthogonal matrix decomposition techniques in linear algebra, especially singular value decomposition (SVD) and eigenvalue decomposition (EVD), can be used.











Ii. Source code

% -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- median filter -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - % first through the median filtering to deal with the original data clear all; close all; clc; load data.mat
figure(1);
orig=Data(5000:9000)'; L=length(orig); plot(1:L,orig); % original data N=2:12; Y1=zeros(length(N),L); Var=zeros(length(N),L); mse=zeros(1,length(N)); Y1(I,:)= medFilT1 (orig,N(I)) for I =1:length(N) % Var(i,:)=(Y1(i,:)-orig).^2; mse(i)=sum(Var(i,:)); end clear i; mse_best=min(mse); n_best=N(find(mse==mse_best)); x1_best=Y1(find(N==n_best),:); % -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- the singular value decomposition related operation -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- % % phase space is mapped to the first phase space matrix rows % m = floor (L / 2); % optimal dimension is basically generated in a neighborhood at P=N / 2, and the noise reduction effect of dimension value taken in this neighborhood is ideal, and can meet the engineering requirements. Therefore, the structure of reconstruction matrix can be determined according to the length of vibration signal N, and P=N/2 can be taken in engineering applications. % phase space interval: by calculating the autocorrelation function of time series, take its lowest value less than a certain range (generally 0.1) % r_K =autocorr(ORIg,length(ORIg)-1); % m_k = find (r_k < 0.1); tao=2; m=floor((L+tao)/(tao+1)); n=L+tao-m*tao; %n=L+1-m; y=zeros(1,n); X=zeros(m,n); % for i=1:m % y=x1_best(i:n+i-1); % X(i,:)=y; % end for i=1:m y=x1_best(1+(i-1)*tao:n+(i-1)*tao); X(i,:)=y; end clear i; Singular value decomposition of % matrix [U,S,V] = SVD (X); sv = diag(S); newSv=sv; [a,b] = size(S); %startPosToZero=18; % refactoring order (its sure harder) % -- -- -- -- -- -- -- -- -- -- -- -- reconstruction method for determining the order of singular value ability difference spectrum method -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - % for I = 1: length (sv) - 1% pho(i)=(sv(i)^2-sv(i+1)^2)/(max(sv)^2-min(sv)^2); % end % figure(2) % plot(pho); startPosToZero=11; newSv(startPosToZero:end) = 0; newS = [diag(newSv),zeros(a,b-a)]; newX = U*newS*V'; % Reconstruction phase space matrix % restoration after denoisingCopy the code

3. Operation results



Fourth, note

Version: 2014a complete code or write plus 1564658423