Elimination method and case analysis of time-domain signal trend item

Just for notes, reproduced from:

Elimination method and case analysis of time domain signal trend item- Zhihu (zhihu.com)

1. Detrend item

When doing data analysis work, the original data of the collected signal itself has a certain range of oscillations. In addition, there may be certain low-frequency components that affect our calculations or observations. Due to the zero point drift (temperature drift) of the amplifier with temperature changes, the instability of low-frequency performance outside the frequency range of the sensor, and the environmental interference around the sensor, etc., it often deviates from the baseline, and even the size of the deviation from the baseline will change with time. The overall process of deviation from the baseline over time is called the trend term of the signal . The trend item directly affects the correctness of the signal and should be removed. A commonly used method for eliminating trend items is the polynomial least squares method.

Raw data time domain waveform:

The least square method fits a straight line as BaseLine:

The original data minus the fitted straight line BaseLine (output red result):

The result is as follows:

The Matlab process is implemented as follows.

%% 数据向量 FT 
len = size(ft);
for i = 1:len
    x(i,1) = i;
    y(i,1) = ft(i,1);
end
%% Polyfit 单项式线性拟合 输出结果Y1
p = polyfit(x,y,1);
x1 = 1 : 1 :len;
y1 = polyval(p,x1);
%% 去趋势项
y1 = reshape(y1,1527,1);%(1527是我的数据长度)      
y2 = y - y1;
plot(x,y,'B',x1,y2,'-r');

In the above process, I am actually breaking down the whole process of detrending items, so that everyone can better understand and absorb.

Matlab can also directly use the detrend function to filter out time trend items

plot(detrend(ft));

2. The significance of removing trend items

After removing the trend item of the time domain signal, we further obtain the signal purification

(The following statistical data are all from the data collected by me, no need to deliberately understand, the results are for reference)

Raw data shock range

((560-498)/ 533.9)/ 2 = ±6%

Detrend item to calculate shock range

((13.14-(-13.0199))/533.9)/2 = ±2.45%

The error is reduced by nearly three times

The trend item itself is a problem; such as DC components, low-frequency components, etc., need to be filtered out by hardware filters or software algorithms. Noise filtering must be targeted, and it is difficult to find a general solution when superimposed together.

Attached is the official solution  Detrending Data

Guess you like

Origin blog.csdn.net/m0_38012497/article/details/128453873