Matlab signal analysis and processing: time domain analysis

Introduction

Time domain analysis: Analyze the curve of the recorded signal amplitude with time. Because it is performed in the time domain, it is also called time domain analysis. That is, after the analog signal is sampled and converted into a digital signal, the data is analyzed in the time domain to obtain the signal parameters.

1. Waveform analysis

  1. Frequency (period)
    zero crossing detection method
  2. Peak (double peak)
  3. Initial phase
  4. Mean
  5. Mean square
  6. variance

2. Signal digital differentiation / integration

Digital differentiation

Write a picture description here

Digital integral

Write a picture description here

Examples

%采样获得数字信号,实际上就是一个列表t=linspace(0,1,N);
Fs=1000; %采样频率
dt=1/Fs;
T=1;    %采样时间
N=T/dt;
t=linspace(0,1,N);
f=10;  %信号频率 
x=sin(2*pi*f*t);   %正弦信号
plot(t,x); %输出正弦信号

%信号分析
peak=max(x);	%峰值
pp=max(x)-min(x);	%峰峰值
mean1=mean(x);	%均值
rms1=rms(x);	%有效值(均方值)
%计算频率
p=max(x);q=min(x);n=1;
% at=0.8*(p-q)+q;	%原理:过零点法。选取的点可原则上可任取;这种at计算值效果较好;但此例选取0来演示。
at=0;
for k=2:1:N-2	
    if (x(k-1)<at && x(k)<=at && x(k+1)>at && x(k+2)>at)
        ti(n)=k;
        n=n+1;
    end
end
T_cal=(ti(2)-ti(1))*dt;	%周期
F=1/T_cal;	%频率

Result analysis The
higher the sampling rate, the more consistent the result is with the actual value.

Published 47 original articles · Like 33 · Visit 310,000+

Guess you like

Origin blog.csdn.net/kaever/article/details/70477968