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

clear; % call MATLAB data file leleccum containing noise; load leleccum; index=1:3000;
x=leleccum(index);
N=8;
slength = length(x);
M=slength- 100.;
subplot(221); plot(x(1:M));
title('Raw signal'); % form data matrix; Signal=zeros(N,M);for i=1:N
   Signal(i,:)=x(i:M+i- 1); End % performs eigenvalue decomposition on the data matrix; [U, S, V]=svd(Signal); d=diag(S(1:N,1:N));

subplot(222); stem(d); title('Eigenvalue');
for i=1:N
   if d(i)<mean(d)
      d(i)=0;
   end
end 
stemp=S;
stemp(1:8.1:8)=diag(d);
Sf=U*stemp*V';
subplot(223); plot(Sf(1:)); title('Filtered signal; The threshold is the average of the eigenvalues'.);
d=diag(S(1:N,1:N));
for i=1:N
      if d(i)<=median(d)
      d(i)=0; Function [TempData,Sample] =ReadData(FileName) % The data format is stored in the detector format % FileName='SR10-100021-SPL-5-4.dat';
fid=fopen(FileName,'rb'); % Sample_Time = struct('year', {2009},'month', {1},	'day', {22},'hour', {12},'minute', {12},'second', {12}); % define sampling time format SensorAddr=fread(fid,1.'int32'); % sensor address Fseek (FID,4.'bof'); % Data file header length is44Byte Sample_Time. Year = fread (fid,1.'int32');
Sample_Time.month=fread(fid,1.'int32');
Sample_Time.day=fread(fid,1.'int32');
Sample_Time.hour=fread(fid,1.'int32');
Sample_Time.minute=fread(fid,1.'int32');
Sample_Time.second=fread(fid,1.'int32');
GroupOrder=fread(fid,1.'int8'); % Batches read,0xffStartPack =fread(FID,1.'int8'); % Start packet number,0~255
totalPack=fread(fid,1.'int8'); % Total number of packets,0~255.0said256Package location = fread (fid,1.'int8'); %/GPS location information % Device configuration information structure Device_Config device_config. group=fread(FID,1.'int8'); % batch Device_Config. The year = fread (fid,1.'int8'); % years Device_Config. The month = fread (fid,1.'int8'); % month Device_Config. The day = fread (fid,1.'int8'); % Device_Config day. The hour = fread (fid,1.'int8'); % when Device_Config. The minute = fread (fid,1.'int8'); % points Device_Config. The second = fread (fid,1.'int8'); % s Device_Config. Repeat = fread (fid,1.'int8'); % number Device_Config. The interval = fread (fid,1.'int8'); % Device_Config interval. The sampleLen = fread (fid,1.'int8'); % Sampling length device_config. speed=fread(fid,1.'int8'); % sampling speed device_config. gain=fread(fid,1.'int8'); % gain fseek (fid,44.'bof'); % Data file header length is44Byte Count =261120; % Data length [TempData,Count]=fread(fid,'int16');

TempData=TempData*2.5/2048; % to get the data lengthswitch Device_Config.sampleLen
    case {8}
        Sample.Len='512KB';
    case {9}
        Sample.Len='512KB';
    case {10}
        Sample.Len='512B';
    case {11}
        Sample.Len='1024B';
end
 %   // Sampling speed
    switch Device_Config.speed
        case {1} 
            Sample.Frequency = '500k';
        case {2} 
            Sample.Frequency = '250k';
        case {3} 
            Sample.Frequency = '125k';
        case {4} 
            Sample.Frequency = '62.5 k';
    end

  %   / / gain

    switch Device_Config.gain
        case {0} 
            Sample.Gain = 1;
        case {1} 
            Sample.Gain = 4;
        case {2} 
            Sample.Gain = 16;
        case {3} 
            Sample.Gain = 64;
        case {4} 
            Sample.Gain = 10;
        case {5} 
            Sample.Gain = 40;
        case {6} 
            Sample.Gain = 160;
        case {7} 
            Sample.Gain = 640;
        case {8} 
            Sample.Gain = 100;
        case {9} 
            Sample.Gain = 400;
        case {10} 
            Sample.Gain = 1600;
        case {11} 
            Sample.Gain = 6400;
    end
Copy the code

3. Operation results

Fourth, note

Version: 2014 a