【 MATLAB 】filter 函數介紹 之 Filter Data in Sections

      網友投稿 1379 2025-04-02

      【 MATLAB 】filter 函數介紹(一維數字濾波器)

      在上篇博文中,里面有一個例子,就是過濾部分中的數據,這個部分中的數據的意思是如果有一個向量需要過濾,我們可以把它分為幾段,然后分段過濾。

      【 MATLAB 】filter 函數介紹 之 Filter Data in Sections

      關于這個問題,使用語法:

      [y,zf] = filter(___)

      賦值符號左邊的部分有一個y是過濾后的數據,那至于zf到底是個什么玩意,當時沒有弄清楚,所以這里來專門討論一番,參考MATLAB的參考文檔的例子。

      賦值符號右邊的部分,可以是函數filter的語法中任何一種,即:

      filter(b,a,x):對x進行濾波;

      filter(b,a,x,zi):關于zi的解釋,我們看下面這一段:

      zi?—?Initial conditions for filter delays

      []?(default) |?vector?|?matrix?|?multidimensional array

      Initial conditions for filter delays, specified as a vector, matrix, or multidimensional array.

      濾波器延遲的初始條件,指定為矢量,矩陣或多維數組。

      If?zi?is a vector, then its length must be?max(length(a),length(b))-1.

      If?zi?is a matrix or multidimensional array, then the size of the leading dimension must be?max(length(a),length(b))-1. The size of each remaining dimension must match the size of the corresponding dimension of?x. For example, consider using?filter?along the second dimension (dim = 2) of a 3-by-4-by-5 array?x. The array?zi?must have size [max(length(a),length(b))-1]-by-3-by-5.

      The default value, specified by?[], initializes all filter delays to zero.

      Data Types:?double?|?single?|?int8?|?int16?|?int32?|?int64?|?uint8?|?uint16?|?uint32?|?uint64?|?logical

      Complex Number Support:?Yes

      對比zf,看看zf的解釋:

      zf?— Final conditions for filter delays

      vector | matrix | multidimensional array

      Final conditions for filter delays, returned as a vector, matrix, or multidimensional array.

      濾波器延遲的最終條件,作為矢量,矩陣或多維數組返回。

      If?x?is a vector, then?zf?is a column vector of length?max(length(a),length(b))-1.

      If?x?is a matrix or multidimensional array, then?zf?is an array of column vectors of length?max(length(a),length(b))-1, such that the number of columns in?zf?is equivalent to the number of columns in?x. For example, consider using?filter?along the second dimension (dim = 2) of a 3-by-4-by-5 array?x. The array?zf?has size [max(length(a),length(b))-1]-by-3-by-5.

      Data Types:?double?|?single

      filter(b,a,x,zi,dim):dim是指定維度,如果x是一個矩陣,那么如果dim為1(默認值),那么就把對矩陣的每個列進行濾波,如果dim為2,則對矩陣的行進行濾波。

      Filter Data in Sections

      Use initial and final conditions for filter delays to filter data in sections, especially if memory limitations are a consideration.

      Generate a large random data sequence and split it into two segments, x1 and x2.

      x = randn(10000,1);

      x1 = x(1:5000);

      x2 = x(5001:end);

      The whole sequence, x, is the vertical concatenation of x1 and x2.

      Define the numerator and denominator coefficients for the rational transfer function,

      b = [2,3];

      a = [1,0.2];

      Filter the subsequences x1 and x2 one at a time. Output the final conditions from filtering x1 to store the internal status of the filter at the end of the first segment.

      [y1,zf] = filter(b,a,x1);

      Use the final conditions from filtering x1 as initial conditions to filter the second segment, x2.

      y2 = filter(b,a,x2,zf);

      y1 is the filtered data from x1, and y2 is the filtered data from x2. The entire filtered sequence is the vertical concatenation of y1 and y2.

      Filter the entire sequence simultaneously for comparison.

      y = filter(b,a,x);

      isequal(y,[y1;y2])

      上面這個例子,驗證了一種情況,就是如果對一個序列進行濾波,可以得到一個結果

      也可以通過另一種方式,就是把該序列分成兩段,分段濾波,最后將濾波數據拼接起來,對比兩種方式的最終結果,發現是一致的。

      對第一段數據進行濾波時候會得到一個zf,這個zf作為第二段數據濾波時候的zi。

      MATLAB

      版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。

      版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。

      上一篇:低代碼平臺|2022年國內十大低代碼平臺盤點,哪個值得一試?
      下一篇:焊接結構生產與制造(焊接的結構)
      相關文章
      亚洲AV综合色区无码一二三区| 最新国产精品亚洲| 亚洲人成在久久综合网站| 亚洲第一黄色网址| 亚洲日韩国产二区无码| 亚洲卡一卡二卡乱码新区| 亚洲一级片在线观看| 亚洲偷自精品三十六区| 亚洲国产激情在线一区| 久久狠狠爱亚洲综合影院| 亚洲人成777在线播放| 亚洲中文字幕在线无码一区二区| 久久国产亚洲电影天堂| 亚洲精品乱码久久久久久自慰| 亚洲一区AV无码少妇电影☆| 亚洲色无码专区在线观看| 亚洲爆乳无码一区二区三区| 久久精品国产精品亚洲色婷婷| 久久91亚洲精品中文字幕| 亚洲黄色网址在线观看| 亚洲人成网网址在线看| 久久夜色精品国产噜噜亚洲a| 亚洲熟女www一区二区三区| 亚洲色大成网站www久久九| 日韩精品亚洲专区在线影视 | 朝桐光亚洲专区在线中文字幕| 亚洲精品成a人在线观看夫| 精品亚洲视频在线| 亚洲人成电影网站国产精品| 中文字幕亚洲乱码熟女一区二区| 亚洲乱色熟女一区二区三区丝袜 | 亚洲精品国产美女久久久| 亚洲va无码专区国产乱码| 亚洲a在线视频视频| 亚洲女人影院想要爱| 色天使亚洲综合在线观看| 色五月五月丁香亚洲综合网| 亚洲日韩国产精品乱| 亚洲午夜福利精品无码| 亚洲AV综合色区无码一二三区 | 亚洲人AV永久一区二区三区久久|