Main Content

采取信号的衍生品

您希望在不增加噪声功率的情况下区分信号。MATLAB®的功能差点放大噪声,并导致更高的衍生物恶化。要解决此问题,请使用差异化器过滤器。

Analyze the displacement of a building floor during an earthquake. Find the speed and acceleration as functions of time.

加载文件earthquake。The file contains the following variables:

  • 漂移:地板位移,以厘米测量

  • T.: Time, measured in seconds

  • FS.:采样率,等于1 kHz

加载('地震.mat'的)

采用pwelch.显示信号的功率谱的估计。注意大部分信号能量在100 Hz以下的频率中包含。

pwelch.(drift,[],[],[],Fs)

图包含轴对象。具有标题Welch功率谱密度估计的轴对象包含类型线的对象。

采用设计档案要设计订单50的冷杉差异。要包括大部分信号能量,请指定100Hz的通带频率和120Hz的停止频率。检查过滤器FVTool.

nf = 50;fpass = 100;fstop = 120;d = designfilt('upidsiatorfir''filterorder'那Nf,......'PassbandFrequency'那Fpass,'stopband职业',fstop,......'采样率',fs); fvtool(d,'magnitudedisplay''零阶段''FS',fs)

Figure Filter Visualization Tool - Zero-phase Response contains an axes object and other objects of type uitoolbar, uimenu. The axes object with title Zero-phase Response contains 2 objects of type line.

区分漂移以找到速度。划分衍生物DT.那T.he time interval between consecutive samples, to set the correct units.

DT.= t(2)-t(1); vdrift = filter(d,drift)/dt;

The filtered signal is delayed. Usegrpdelay确定延迟是过滤器顺序的一半。通过丢弃样品来补偿它。

延迟= mean(grpdelay(d))
延迟= 25
tt = t(1:终止);VD = VDRIFT;VD(1:延迟)= [];

The output also includes a transient whose length equals the filter order, or twice the group delay.延迟samples were discarded above. Discard延迟更多来消除瞬态。

TT(1:延迟)= [];VD(1:延迟)= [];

绘制漂移和漂移速度。采用findpeaks为了验证漂移的最大值和最小值对应于其衍生物的过零点。

[PKP,LCP] = FindPeaks(漂移);zcp = zeros(尺寸(lcp));[PKM,LCM] = FindPeaks(-drift);zcm =零(尺寸(lcm));子图(2,1,1)绘图(t,drift,t([lcp lcm]),[pkp -pkm],'要么'的)Xlabel('Time (s)'的)ylabel('位移(cm)')网格子图(2,1,2)绘图(TT,Vd,T([LCP LCM]),[ZCP ZCM],'要么'的)Xlabel('Time (s)'的)ylabel('速度(cm / s)') 网格

图包含2个轴对象。轴对象1包含3个类型线的对象。轴对象2包含3个类型线的对象。

区分漂移速度以找到加速度。滞后是两倍长。丢弃两倍的样本以补偿延迟,以及消除瞬态的相同数量。绘制速度和加速度。

adrift =滤波器(d,Vdrift)/ dt;AT = T(1:结束-2 *延迟);广告=漂泊;广告(1:2 *延迟)= [];在(1:2 *延迟)= [];广告(1:2 *延迟)= [];子图(2,1,1)绘图(TT,VD)XLabel('Time (s)'的)ylabel('速度(cm / s)')网格子图(2,1,2)绘图(AT,AD)AX = GCA;AX.YLIM = 2000 * [ -  1 1];Xlabel('Time (s)'的)ylabel('加速度(cm / s ^ 2)') 网格

图包含2个轴对象。Axes object 1 contains an object of type line. Axes object 2 contains an object of type line.

Compute the acceleration using差点。添加零以补偿阵列大小的变化。将结果与过滤器获得的结果进行比较。注意高频噪声的数量。

Vdiff = diff([漂移; 0])/ dt;adiff = diff([vdiff; 0])/ dt;子图(2,1,1)图(AT,AD)AX = GCA;AX.YLIM = 2000 * [ -  1 1];Xlabel('Time (s)'的)ylabel('加速度(cm / s ^ 2)')网格传奇('筛选'的)T.itle('加速差异滤波器')子图(2,1,2)绘图(T,Adiff)AX = GCA;AX.YLIM = 2000 * [ -  1 1];Xlabel('Time (s)'的)ylabel('加速度(cm / s ^ 2)')网格传奇('差异'的)

图包含2个轴对象。带有差分滤波器的标题加速度的轴对象1包含类型线的对象。此对象表示过滤器。轴对象2包含类型线的对象。该对象表示差异。

也可以看看

||||

Related Topics