当前位置:网站首页>Will signal with different start time alignment
Will signal with different start time alignment
2022-08-10 03:22:00 【jk_101】
目录
Align signals with different start times
Align signals with different start times
Many measurements involve data collected asynchronously by multiple sensors.If you want to integrate signals,They must be synchronized.Signal Processing Toolbox Some functions are provided to achieve this.
例如,Suppose a car passes over a bridge.The vibrations it produces are measured by three identical sensors located in different locations.Signals have different arrival times.
Load the signal into MATLAB workspace and draw.
load relatedsig
ax(1) = subplot(3,1,1);
plot(s1)
ylabel('s_1')
ax(2) = subplot(3,1,2);
plot(s2)
ylabel('s_2')
ax(3) = subplot(3,1,3);
plot(s3)
ylabel('s_3')
xlabel('Samples')
linkaxes(ax,'x')如图所示:

信号s1落后于s2,but ahead of s3.可以使用finddelayLatency is calculated accurately.可以看到,s2 领先于 s1 350 个样本,s3落后于 s1 150 个样本,而 s2 领先于 s3 500 个样本.
t21 = finddelay(s2,s1)
t31 = finddelay(s3,s1)
t32 = finddelay(s2,s3)
t21 =
350
t31 =
-150
t32 =
500
Signals are aligned by keeping the oldest signal stationary and truncating delays in other vectors.Lag needs to be added 1,因为 MATLAB 使用从 1 开始的索引.This method uses the earliest signal arrival time(即 s2 的到达时间)Use as a reference to align the signals.
axes(ax(1))
plot(s1(t21+1:end))
axes(ax(2))
plot(s2)
axes(ax(3))
plot(s3(t32+1:end))如图所示:

使用 alignsignals alignment signal.This function delays older signals,to use the latest signal arrival time(即 s3 的到达时间)作为基准.
[x1,x3] = alignsignals(s1,s3);
x2 = alignsignals(s2,s3);
axes(ax(1))
plot(x1)
axes(ax(2))
plot(x2)
axes(ax(3))
plot(x3)如图所示:

These signals are now synchronized,available for further processing.
Remove peaks from the signal
Sometimes there are unwanted transients in the data(即峰值).Median filtering is a good way to get rid of it.
以存在 60 Hz An example of an open-loop voltage at the input of an analog instrument when there is wire noise.采样率为 1 kHz.
load openloop60hertz
fs = 1000;
t = (0:numel(openLoopVoltage) - 1)/fs;Add transients to corrupt the signal by adding random symbols at random points.重置随机数生成器以获得可再现性.
rng default
spikeSignal = zeros(size(openLoopVoltage));
spks = 10:100:1990;
spikeSignal(spks+round(2*randn(size(spks)))) = sign(randn(size(spks)));
noisyLoopVoltage = openLoopVoltage + spikeSignal;
plot(t,noisyLoopVoltage)
xlabel('Time (s)')
ylabel('Voltage (V)')
title('Open-Loop Voltage with Added Spikes')如图所示:

yax = ylim;函数 medfilt1 Replaces each point of the signal with the median of that point and the specified number of neighbors.因此,Median filtering discards points that are very different from their surroundings.The signal is filtered by computing the median using the set of three neighbors.Notice how the peak disappears.
medfiltLoopVoltage = medfilt1(noisyLoopVoltage,3);
plot(t,medfiltLoopVoltage)
xlabel('Time (s)')
ylabel('Voltage (V)')
title('Open-Loop Voltage After Median Filtering')
ylim(yax)
grid如图所示:

边栏推荐
猜你喜欢
随机推荐
官宣出自己的博客啦
Redis - Basic operations and usage scenarios of String|Hash|List|Set|Zset data types
51单片机驱动HMI串口屏,串口屏的下载方式
数据库治理利器:动态读写分离
ImportError: Unable to import required dependencies: numpy
T5:Text-toText Transfer Transformer
SQLserver加个判断
.Net面试经验总结
sqlmap dolog外带数据
状态压缩小经验
量化交易策略介绍及应用市值中性化选股
Open3D 网格均匀采样
数据治理(五):元数据管理
自动化测试中,测试数据与脚本分离以及参数化方法
JCMsuite—单模光纤传播模式
《GB39732-2020》PDF下载
OpenCV图像处理学习四,像素的读写操作和图像反差函数操作
HRnet
Open3D 泊松盘网格采样
16. 最接近的三数之和









