How could I create a sliding window of 300ms, with an overlap of 50ms?

23 ビュー (過去 30 日間)
GOTOTO
GOTOTO 2022 年 1 月 24 日
コメント済み: GOTOTO 2022 年 9 月 15 日
Hello, I have an Emg data of 15mins length (1808331x12), sampling frequency : 2kHz. I want to apply a 300ms window(600samples) with an overlap of 20samples(10ms). I want 300ms segments so i can extract features from it.
Can somebody help me?

採用された回答

Pratyush Roy
Pratyush Roy 2022 年 1 月 27 日
Hi JJyh,
You can extract the data from individual windows and store them in a cell array. The following code might be helpful to understand how to store data from individual windows in a cell:
emg_data = randn([1808331,12]); % Here I have used random data since I don't have the original data on my end. This can be replaced by the data array that you are using.
[r c] = size(emg_data)
n_start = 1;
window_size = 600;
overlap_size = 20;
frame_cell = {};
while (n_start+window_size<=r)
window = emg_data(n_start:n_start+window_size-1,:);
frame_cell{end+1} = window;
n_start = n_start + window_size - overlap_size;
end
Hope this helps!

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCurve Fitting Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by