A list,

1 heart sound: the sound produced when the heart contractions and diastolic, can be heard by ear or stethoscope in the chest wall, can also be recorded with electronic instruments (heart sound map). Can be divided into the first heart sound (S1) second heart sound (S2). (Can be heard under normal circumstances). Third heart sound (S3 is usually heard only in children and adolescents), and fourth heart sound (S4 is rarely heard normally). The sound produced from the heart is transmitted to the surface of the chest wall through tissue mediation, of which bone conduction is the best. Heart sound is the reflection of the mechanical movement of the heart and cardiovascular system, which contains the physiological and pathological information of each part of the heart itself and the interaction between them. The recognition and classification of heart sound signal is of great significance to the diagnosis of cardiovascular diseases, and its accuracy and reliability determine the effect of diagnosis and treatment of heart disease patients. Early heart sound recognition and classification is completed by doctors according to auscultation results, obviously this process has a certain degree of subjectivity and reliability is not high. With the development of signal processing and analysis technology, the study of heart sound has gradually changed from qualitative analysis to quantitative analysis. Many biomedical engineering researchers at home and abroad have applied the traditional pattern recognition method and neural network method to the recognition and classification of heart sounds, hoping to realize the automatic interpretation and diagnosis of heart sounds, so as to provide practical auxiliary diagnostic information to clinicians. In addition, the recognition and classification of heart sounds is helpful to understand the mechanism of heart sounds. The research of heart sound signal mainly uses microelectronic technology, detection technology, modern digital signal processing technology and biomedical engineering technology to study and reveal the relationship between heart sound and heart disease. No matter how big the unit of record, human body weight, heart rate, blood pressure and other physiological parameters, are time-varying, known as heart rate or blood pressure variability. Heart sounds is in the cardiac cycle, due to myocardial systolic and diastolic, valve opening and closing, the impact factors such as ventricular wall and large artery blood flow caused by mechanical vibration, through the surrounding tissue to the chest wall, the ear close to the chest wall or put the stethoscope on the chest wall parts, hear the sound Usually it is easy to hear the first and second heart sound and sometimes heard in some cases the 3rd or the 4th heart sounds. First heart sound: S1, occurs at the beginning of systole, with a low pitch and a longer duration (about 0.15 seconds). Causes include contraction of ventricular muscles, sudden closure of the atrioventricular valve and subsequent ejection of blood into the aorta. The best auscultation site of the first heart sound is in the fifth intercostal space of the midclavicle or at the right margin of the sternum. Second heart sound: S2, which occurs at the beginning of diastolic period, has a higher frequency and shorter duration (about 0.08 seconds) compared with 0.020.04s after QRS wave starts on ecg. This is caused by the closing of the semilunar valve, the clashing of valves against each other and the vibration caused by the deceleration of blood in the aorta and the rapid drop in indoor pressure. The best auscultation sites for second heart sounds are the aortic valve region on the right and the pulmonary valve region on the left of the second intercostal space. Student: Relative to the T terminal. The 3rd heart sound and the 4th heart sound: the 3rd heart sound S3 happens after the 2nd heart sound 0.1 ~ 0.2 seconds, frequency is low, its generation and blood flow into ventricle quickly make ventricle and valve produce vibration concerned, can hear only in children normally, because more easily conduction to body surface. Equivalent to T wave behind the second heart sound 0.12~0.20s. The fourth heart sound S4 is caused by atrial contraction, also known as atrial sound, which is equivalent to 0.15~0.18s after P wave on electrocardiogram, with low amplitude.

The heart murmur interferes with the normal heart sound to some extent, but it has practical application value and clinical significance for the analysis of heart sound signal. According to the relationship between the occurrence time of murmurs and S1 and S2 heart sounds, it can be divided into early, middle and late murmurs. The intensity of noise is generally classified by its amplitude compared with S1. Greater than S1, strong. Less than S1, greater than 1/3S1, middle. Lower than 1/3 of S1 is low, and only slight vibration is a very low amplitude murmur. Because the heart sound signal belongs to the weak biological signal of human body under the background of strong noise, because the heart sound signal is the unstable natural signal issued by the complex living body. The change of heart sound and the appearance of murmurs are often the early symptoms of heart organic pathological changes, the physical structure of heart interior changes will directly affect and change the heart sound signal.

Electrocardiogram (ECG), which is widely used at present, is the best method to detect cardiac variability and conductivity, but it cannot be used to detect cardiac variability of congenital heart valve damage. Cardiac mechanical activity disorders caused by cardiac conduction tissue lesions will not be first reflected in the ecg, but can be first reflected in the heart sound signal. It takes more than 70 percent of coronary artery disease to cause changes in ecg signals, and actually 25 percent to change heart sound signals.

Abnormal heart sounds include S2, S2 abnormalities and additional sounds (or extra sounds) in systole and diastole. ① Abnormal first heart sound. Refers to an increase, decrease, or division of S1. The loudness of S1 is best estimated by auscultation. Echocardiogram is of limited judgement. The clinical conditions of S1 enhanced, weakened or varied were shown in Table 1. S1 division refers to the distance between M1 and T1 >0.04 SEC, which can be seen in normal children, young people and thin people, but has no significant significance. The distance between M1 and T1 in abnormal division of S1 can be more than 0.06 seconds, which can be seen in delayed electrostimulation (e.g., right bundle branch block, etc.) and delayed mechanical activity (e.g., atrial septal defect, severe mitral stenosis, etc.). On auscultation S1 division was clearest in the mitral and tricuspid areas of sitting and exhalation. ② Abnormal second heart sound. Including S2 increasing, weakening or splitting. Enhancement of S2 can be divided into enhancement of P2 and enhancement of A2. Enhancement of P2 is seen in increased pulmonary blood flow (e.g., septal defect) and increased pulmonary vascular resistance. Increased pulmonary venous pressure (e.g., mitral stenosis). P2 hyperactivity is usually heard in the pulmonary valve region. A2 enhancement is seen in increased systemic circulation resistance or increased blood flow, conduction to pulmonary valve and apical region, in hypertension, etc. S2 weakening is divided into P2 weakening and A2 weakening. Reduced P2 can be seen in pulmonary hypertension, pulmonary blood flow, or pulmonary valve stenosis. Reduced A2 is seen in low systemic circulation resistance, reduced blood flow, hypotension, and aortic stenosis or severe insufficiency. S2 splitting can be biological. Right ventricular ejection ends a little later than left ventricle, and P2 appears delayed on inspiratory, at which point S2 splitting can be heard. On exhalation, A2 and P2 approached or overlapped, and division disappeared. This is seen in adolescents, is evident in the pulmonary valve region auscultation and may disappear in sitting position. S2 abnormal mitosis includes wide mitosis, fixed mitosis, inverse mitosis and reduced mitosis. Wide division refers to S2 division that does not disappear during exhalation and is seen in prolonged right ventricular ejection time or shortened left ventricular ejection time. S2 fixed mitosis refers to no significant change or change <0.02 SEC in a2-P2 interval during respiration, which is seen in atrial septal defects with large shunt volume. S2 reverse fission means that A2 comes after P2, a2-P2 division is not obvious on inhalation, and P2 appears earlier and the division widens on exhalation. This is seen in delayed aortic valve closure. Narrowing of S2 division is often due to the early appearance of P2 in severe pulmonary hypertension.

3 heart sound signal analysis method: the traditional spectral analysis method through fast Fourier transform time domain, frequency domain correlation. But FFT time – frequency domain separation, and the frequency characteristics of the signal time – invariant, or stable statistical characteristics as the premise. The traditional steady-state analysis method reflects the static spectral characteristics of the signal, and the biological and physiological signals, including human heart sound signal, show non-stationary time-varying characteristics due to the influence of the environment. Therefore, classical spectral analysis is difficult to accurately reflect the dynamic changes of heart sound signal. On the basis of traditional heart sound analysis, many methods are proposed: 1. 3. Other time-frequency analysis methods

Ii. Source code

clc; clear; close all; M = importData ('3.txt');
fsample=1000; % sampling rate is1KHz

[mx,my]=size(M);
Signal=M(:,2); %M first column time, second column signal length=floor(mx/2); % takes half of the original signal. S=Signal(1:length); %% high-pass filtering, remove the impact of baseline drift DISP ('-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --');
disp('1: Toolbox Batworth high pass filter ');
disp('2: IIR high-pass Filtering ');
disp('3: FIR high-pass filter ');
disp('4: Median filtering ');
disp('5: Sparse Wavelet Filtering ');
disp('6: Median + wavelet filtering ');
disp('-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --');
choose=input('Select filter mode choose=');
function [s, err_mse, iter_time]=sparseOMP(x,A,m,varargin)
[n1 n2]=size(x);
if n2 == 1
    n=n1;
elseif n1 == 1
    x=x';
    n=n2;
else
   error('x must be a vector.');
end
    
sigsize     = x'*x/n;
initial_given=0;  
err_mse     = [];
iter_time   = [];
STOPCRIT    = 'M';
STOPTOL     = ceil(n/4);
MAXITER     = n;
verbose     = false;
s_initial   = zeros(m,1);
GradSteps   = 'auto';
alpha       = 1;
weakness    = 1;

if verbose
   display('Initialising... ') 
end

switch nargout 
    case 3
        comp_err=true;
        comp_time=true;
    case 2 
        comp_err=true;
        comp_time=false;
    case 1
        comp_err=false;
        comp_time=false;
    case 0
        error('Please assign output variable.')        
    otherwise
        error('Too many output arguments specified')
end


% Put option into nice format
Options= {}; OS=nargin- 3;
c=1;
for i=1:OS
    if isa(varargin{i},'cell')
        CellSize=length(varargin{i});
        ThisCell=varargin{i};
        for j=1:CellSize
            Options{c}=ThisCell{j};
            c=c+1;
        end
    else
        Options{c}=varargin{i};
        c=c+1;
    end
end
OS=length(Options);
if rem(OS,2)
   error('Something is wrong with argument name and argument value pairs.') 
end
for i=1:2:OS
   switch Options{i}
        case {'stopCrit'}
            if (strmatch(Options{i+1}, {'M'; 'corr'; 'mse'; 'mse_change'},'exact'));
                STOPCRIT    = Options{i+1};  
            else error('stopCrit must be char string [M, corr, mse, mse_change]. Exiting.'); end 
        case {'stopTol'}
            if isa(Options{i+1},'numeric') ; STOPTOL     = Options{i+1};   
            else error('stopTol must be number. Exiting.'); end
        case {'P_trans'} 
            if isa(Options{i+1},'function_handle'); Pt = Options{i+1};   
            else error('P_trans must be function _handle. Exiting.'); end
        case {'maxIter'}
            if isa(Options{i+1},'numeric'); MAXITER     = Options{i+1};             
            else error('maxIter must be a number. Exiting.'); end
        case {'wf'}
            if isa(Options{i+1},'numeric'); alpha       = Options{i+1}; 
                if alpha <1 weakness =0; else alpha =1; weakness = 1; end          
            else error('wf must be a number. Exiting.'); end
        case {'verbose'}
            if isa(Options{i+1},'logical'); verbose     = Options{i+1};   
            else error('verbose must be a logical. Exiting.'); end 
        case {'start_val'}
            if isa(Options{i+1},'numeric') && length(Options{i+1}) == m ;
                s_initial     = Options{i+1};   
                initial_given=1;
            else error('start_val must be a vector of length m. Exiting.'); end
        case {'GradSteps'}
            if isa(Options{i+1},'numeric') || strcmp(Options{i+1},'auto') ;
                GradSteps     = Options{i+1};   
            else error('start_val must be a vector of length m. Exiting.'); end
        otherwise
            error('Unrecognised option. Exiting.') 
   end
end




if strcmp(STOPCRIT,'M') 
    maxM=STOPTOL;
else
    maxM=MAXITER;
end

if nargout >=2
    err_mse = zeros(maxM,1);
end
if nargout ==3
    iter_time = zeros(maxM,1);
end


if          isa(A,'float')      P =@(z) A*z;  Pt =@(z) A'*z;
elseif      isobject(A)         P =@(z) A*z;  Pt =@(z) A'*z;
elseif      isa(A,'function_handle') 
    try
        if          isa(Pt,'function_handle'); P=A;
        else        error('If P is a function handle, Pt also needs to be a function handle. Exiting.'); end
    catch error('If P is a function handle, Pt needs to be specified. Exiting.'); end
else        error('P is of unsupported type. Use matrix, function_handle or object. Exiting.'); end

if initial_given ==1;
    IN          = find(s_initial);
    Residual    = x-P(s_initial);
    s           = s_initial;
    oldERR      = Residual'*Residual/n;
else
    IN          = [];
    Residual    = x;
    s           = s_initial;
    sigsize     = x'*x/n;
    oldERR      = sigsize;
end

        mask=zeros(m,1);
        mask(ceil(rand*m))=1;
        nP=norm(P(mask));
        if abs(1-nP)>1e-3;
            display('Dictionary appears not to have unit norm columns.')
        end

if verbose
   display('Main iterations... ') 
end
tic
t=0;
normA=(sum(A.^2.1)). ^0.5;
NI = 1:size(A,2);
p=zeros(m,1);
DR=Pt(Residual);
[v I]=max(abs(DR(NI))./normA(NI)'); INI = NI(I); IN=[IN INI]; NI(I) = []; if weakness ~= 1 [vals inds] = sort(abs(DR),'descend');
    I=inds( find( vals >= alpha * v ) );
end
    
IN = union(IN,I);
if strcmp(STOPCRIT,'M') & length(IN) >= STOPTOL
    IN=IN(1:STOPTOL);
end
MASK=zeros(size(DR));
pDDp=1;
done = 0;
iter=1;

while ~done

    
    % Select new element
    if isa(GradSteps,'char')
        if strcmp(GradSteps,'auto')
             
%             finished=0;    
%             while ~finished
            % Update direction    
                 if iter==1
                     p(IN)=DR(IN);
                     Dp=P(p);
                 else
                     MASK(IN)=1;
                     PDR=P(DR.*MASK);
                     b=-Dp'*PDR/pDDp;
                     p(IN)=DR(IN) +b*p(IN);
                     Dp=PDR +b* Dp;
                 end
             % Step size
%                  Dp=P(p); % =P(DR(IN)) +b P(p(IN));
                 pDDp=Dp'*Dp;
                 a=Residual'*Dp/(pDDp);
             % Update coefficients   
                 s=s+a*p;
             % New Residual and inner products
                 Residual=Residual-a*Dp;
                 DR=Pt(Residual);
                 % select new element
                     [v I]=max(abs(DR(NI))./normA(NI)'); INI = NI(I); if weakness ~= 1 [vals inds] = sort(abs(DR),'descend');
                         I=inds( find( vals >= alpha * v ) );
                     end
                     IN = union(IN,INI);
                     NI(I) = [];
                     if strcmp(STOPCRIT,'M') & length(IN) >= STOPTOL
                        IN=IN(1:STOPTOL);
                     end


        else
            
            
            error('Undefined option for GradSteps, use ''auto'' or an integer.')
        end
    elseif isa(GradSteps,'numeric') 

                
        % Do GradSteps gradient steps
        count=1;
        while count<=GradSteps
            % Update direction    
                 if iter==1
                     p(IN)=DR(IN);
                     Dp=P(p);
                 else
                     MASK(IN)=1;
                     PDR=P(DR.*MASK);
                     b=-Dp'*PDR/pDDp;
                     p(IN)=DR(IN) +b*p(IN);
                     Dp=PDR +b* Dp;
                 end
             % Step size
%                  Dp=P(p);   
                 pDDp=Dp'*Dp;
                 a=Residual'*Dp/(pDDp);
             % Update coefficients   
                 s=s+a*p;
             % New Residual and inner products
                 Residual=Residual-a*Dp;
                 DR=Pt(Residual);
                  count=count+1;
        end
             % select new element
                 [v I]=max(abs(DR(NI))./normA(NI)'); INI = NI(I); if weakness ~= 1 [vals inds] = sort(abs(DR),'descend');
                     I=inds( find( vals >= alpha * v ) );
                 end
                 IN = union(IN,INI);
                  NI(I) = [];
                 if strcmp(STOPCRIT,'M') & length(IN) >= STOPTOL
                    IN=IN(1:STOPTOL);
                 end
                
     else
          error('Undefined option for GradSteps, use ''auto'' or an integer.')
     end


     ERR=Residual'*Residual/n;
     if comp_err
         err_mse(iter)=ERR;
     end
     
     if comp_time
         iter_time(iter)=toc;
     end


     if strcmp(STOPCRIT,'M')
         if length(IN) >= STOPTOL
             done =1;
         elseif verbose && toc-t>10
            display(sprintf('Iteration %i. --- %i selected elements',iter ,length(IN))) 
            t=toc;
         end
    elseif strcmp(STOPCRIT,'mse')
         if comp_err
            if err_mse(iter)<STOPTOL;
                done = 1; 
            elseif verbose && toc-t>10
                display(sprintf('Iteration %i. --- %i mse',iter ,err_mse(iter))) 
                t=toc;
            end
         else
             if ERR<STOPTOL;
                done = 1; 
             elseif verbose && toc-t>10
                display(sprintf('Iteration %i. --- %i mse',iter ,ERR)) 
                t=toc;
             end
         end
     elseif strcmp(STOPCRIT,'mse_change') && iter >=2
         if comp_err && iter >=2
              if ((err_mse(iter- 1)-err_mse(iter))/sigsize <STOPTOL);
                done = 1; 
             elseif verbose && toc-t>10
                display(sprintf('Iteration %i. --- %i mse change',iter ,(err_mse(iter- 1)-err_mse(iter))/sigsize )) 
                t=toc;
             end
         else
             if ((oldERR - ERR)/sigsize < STOPTOL);
                done = 1; 
             elseif verbose && toc-t>10
                display(sprintf('Iteration %i. --- %i mse change',iter ,(oldERR - ERR)/sigsize)) 
                t=toc;
             end
         end
     elseif strcmp(STOPCRIT,'corr') 
          if max(abs(DR)) < STOPTOL;
             done = 1; 
          elseif verbose && toc-t>10
                display(sprintf('Iteration %i. --- %i corr',iter ,max(abs(DR)))) 
                t=toc;
          end
     end
     
    % Also stop if residual gets too small or maxIter reached
     if comp_err
         if err_mse(iter)<1e-16
             display('Stopping. Exact signal representation found! ')
             done=1;
         end
     else


         if iter>1
             if ERR<1e-16
                 display('Stopping. Exact signal representation found! ')
                 done=1;
             end
         end
     end

     if iter >= MAXITER
         display('Stopping. Maximum number of iterations reached! ')
         done = 1; 
     end
     
   
     if ~done
        iter=iter+1;
        oldERR=ERR;
     end
end



if nargout >=2
    err_mse = err_mse(1:iter);
end
if nargout ==3
    iter_time = iter_time(1:iter);
end
if verbose
   display('Done') 
end
Copy the code

3. Operation results



Fourth, note

Version: 2014 a