Choosing dimension for filter

19 ビュー (過去 30 日間)
Aboltabol
Aboltabol 2023 年 3 月 28 日
コメント済み: Star Strider 2023 年 3 月 28 日
I have voltage recordings from x sensors for y time-frames, each spanning z seconds. This is stored in a x*y*z matrix. Now, I designed an iirnotch to remove the line noise (60 Hz). When I apply the filter to the matrix using filtfilt, am I correct in assuming that the filter will run along the x dimension, and is this choice of dimension appropriate?

回答 (1 件)

Star Strider
Star Strider 2023 年 3 月 28 日
I believe so.
From the filtfilt documentation for x:
The function operates along the first array dimension of x unless x is a row vector. If x is a row vector, then the function operates along the second dimension.
So I believe it will operate along each column (down the rows) of the matrix and across all dimensions. (I have only filtered 2D matrices with it, not 3D.)
.
  2 件のコメント
Aboltabol
Aboltabol 2023 年 3 月 28 日
編集済み: Aboltabol 2023 年 3 月 28 日
My matrix has sensors as rows, events as columns, and time as pages. Now, ought not the filter run per sensor per event along the time dimension i.e. the third dimension (page)?
Star Strider
Star Strider 2023 年 3 月 28 日
Yes, it should, however that information did not originally appear.
Use the permute function to put them in the order you want them, for example —
A = randn(12, 5, 30); % Sensor x Event x Time
Ap = permute(A, [3 1 2]);
PermutedSize = size(Ap) % Time x Sensor x Event
PermutedSize = 1×3
30 12 5
That appears to me to be appropriate for the filtering you want to do. If it is not, changing it is straightforward.
.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeEEG/MEG/ECoG についてさらに検索

タグ

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by