当前位置:网站首页>Filtered data analysis

Filtered data analysis

2022-06-24 22:01:00 jk_ one hundred and one

Catalog

Filter difference equation

Moving average filter of traffic flow data

Modify data amplitude


Filter difference equation

         Filter is a data processing technology , You can filter out the high-frequency fluctuations in the data to smooth them or delete the periodic trend of a specific frequency from the data . stay MATLAB in ,filter The function compares the data according to the following difference equation x The vector of , The difference equation describes a tapped delay line filter .

         In this equation ,a and b Is the vector of filter coefficients ,Na Is the order of the feedback filter ,Nb Is the order of the feedforward filter .n yes x Index of the current element of . Output y(n) yes x and y A linear combination of the current element and the previous element of .

        filter The function uses the specified coefficient vector a and b For input data x Filtering .

Moving average filter of traffic flow data

        filter Function is a way to realize moving average filter , It is a common data smoothing technique .

         The following difference equation describes a filter , It averages the time-dependent data about the current hour and the previous three hours .

         Import data that describes how traffic flows change over time , And assign the first vehicle count to the vector  x.

load count.dat
x = count(:,1);

         Create a filter coefficient vector .

a = 1;
b = [1/4 1/4 1/4 1/4];

         Calculating data 4 Hourly moving average , Draw raw data and filtered data at the same time .

y = filter(b,a,x);

t = 1:length(x);
plot(t,x,'--',t,y,'-')
legend('Original Data','Filtered Data')

         As shown in the figure :

Modify data amplitude

         This example shows how to modify the amplitude of a data vector by applying a transfer function . In digital signal processing , Filters are usually represented by transfer functions . Of the following difference equations Z Transformation

         Is the following transfer function . 

         Use transfer functions  

          modify count.dat Amplitude of data in . Load the data and assign the first column to the vector x.

load count.dat
x = count(:,1);

         According to the transfer function   Create a filter coefficient vector .

a = [1 0.2];
b = [2 3];

         Calculate the filtered data , Draw raw data and filtered data at the same time . This filter mainly 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')

         As shown in the figure :

原网站

版权声明
本文为[jk_ one hundred and one]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206241506016288.html