当前位置:网站首页>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
如图所示:
边栏推荐
猜你喜欢
随机推荐
Unity3D创建道路插件EasyRoads的使用
sqlmap dolog外带数据
数据挖掘和数据仓库之间的区别
LeetCode每日两题02:两数之和 II - 输入有序数组 (均1200道)
在蓝图中给组件动态加子Actor组件
web crawler error
小菜鸟河北联通上岗培训随笔
具有多孔光纤的偏振分束器
ECCV 2022 Oral | CCPL: 一种通用的关联性保留损失函数实现通用风格迁移
On the Harvest of Travel
夏克-哈特曼波前传感器
2022.8.9考试平衡的余数--1000题解
微透镜阵列后光传播的研究
【二叉树-中等】2265. 统计值等于子树平均值的节点数
C# 单例模式
华为HCIE云计算之FC添加ipsan数据存储
OpenCV图像处理学习二,图像掩膜处理
宝塔服务器PHP+mysql网页URL跳转问题
2020.11.22考试哥德巴赫猜想题解
【二叉树-中等】1261. 在受污染的二叉树中查找元素