【 MATLAB 】Filter Data

举报
李锐博恩 发表于 2021/07/15 06:31:07 2021/07/15
2.1k+ 0 0
【摘要】 Filter Data Filter Difference Equation(滤波器差分方程) 滤波器是一种数据处理技术,可以消除数据中的高频波动或从数据中去除特定频率的周期性趋势。 在MATLAB®中,滤波器功能根据以下差分方程过滤数据x的向量,该差分方程描述了抽头延迟线滤波器。 在该等式中,a和b是滤波器系数的矢量,Na是反馈滤波器阶数,Nb是前馈滤波器阶数。...

Filter Data

Filter Difference Equation(滤波器差分方程)

滤波器是一种数据处理技术,可以消除数据中的高频波动或从数据中去除特定频率的周期性趋势。

在MATLAB®中,滤波器功能根据以下差分方程过滤数据x的向量,该差分方程描述了抽头延迟线滤波器。

在该等式中,a和b是滤波器系数的矢量,Na是反馈滤波器阶数,Nb是前馈滤波器阶数。 n是x的当前元素的索引。 输出y(n)是x和y的当前元素和先前元素的线性组合。

滤波函数使用指定的系数向量a和b来过滤输入数据x。 



Moving-Average Filter of Traffic Data


滤波器功能是实现移动平均滤波器的一种方法,这是一种常见的数据平滑技术。
The following difference equation describes a filter that averages time-dependent data with respect to the current hour and the three previous hours of data.

(以下差分方程描述了一个过滤器,它根据当前小时和前三个小时的数据平均时间相关数据。)

导入描述流量随时间变化的数据,并将第一列车辆计数分配给向量x。


      clc
      clear
      close all
      % Import data that describes traffic flow over time, and assign the first column of vehicle counts to the vector x.
      load count.dat
      x = count(:,1);
      % Create the filter coefficient vectors.
      a = 1;
      b = [1/4 1/4 1/4 1/4];
      % Compute the 4-hour moving average of the data, and plot both the original data and the filtered data.
      y = filter(b,a,x);
      t = 1:length(x);
      plot(t,x,'--',t,y,'-')
      legend('Original Data','Filtered Data')
  
 


Modify Amplitude of Data


This example shows how to modify the amplitude of a vector of data by applying a transfer function.
In digital signal processing, filters are often represented by a transfer function. The Z-transform of the difference equation

此示例显示如何通过应用传递函数来修改数据矢量的幅度。
在数字信号处理中,滤波器通常由传递函数表示。 差分方程的Z变换

is the following transfer function.

Use the transfer function

to modify the amplitude of the data in count.dat.


      clc
      clear
      close all
      % Load the data and assign the first column to the vector x.
      load count.dat
      x = count(:,1);
      % Create the filter coefficient vectors according to the transfer function .
      a = [1 0.2];
      b = [2 3];
      % Compute the filtered data, and plot both the original data and the filtered data. This filter primarily modifies the amplitude of the original data.
      y = filter(b,a,x);
      t = 1:length(x);
      plot(t,x,'--',t,y,'-')
      legend('Original Data','Filtered Data')
  
 


 

文章来源: reborn.blog.csdn.net,作者:李锐博恩,版权归原作者所有,如需转载,请联系作者。

原文链接:reborn.blog.csdn.net/article/details/83314727

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

作者其他文章

评论(0

抱歉,系统识别当前为高风险访问,暂不支持该操作

    全部回复

    上滑加载中

    设置昵称

    在此一键设置昵称,即可参与社区互动!

    *长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

    *长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。