フィルターのクリア

Help with Cross-correlation and Auto-correlation

1 回表示 (過去 30 日間)
David Jones
David Jones 2021 年 6 月 26 日
コメント済み: David Jones 2021 年 6 月 30 日
Hi
I don’t have that much experience in MATLAB, I hope someone can point me in the right direction, I am looking at breathing and the rate and various ways to detect this. I am currently looking into Cross correlation and auto correlation can somebody please help me setup some basic code and give me a few pointers.
I have attached a file which has 6000 samples, 100 samples per second, over 60 seconds.
Any help would be greatly appreciated.
Kind Regards
David

採用された回答

Image Analyst
Image Analyst 2021 年 6 月 26 日
Try this:
s = load('raw_data.mat')
y = s.raw_ad_data_sine;
plot(y, 'b-', 'LineWidth', 2);
grid on;
% Find peaks
[peakValues, indexesOfPeaks] = findpeaks(y, 'MinPeakDistance', 200, 'Threshold', 1000);
% Plot them.
hold on;
plot(indexesOfPeaks, y(indexesOfPeaks), 'rv', 'LineWidth', 2, 'MarkerSize', 10);
% Find valleys
[valleyValues, indexesOfValley] = findpeaks(-y, 'MinPeakDistance', 200, 'Threshold', 1000);
valleyValues = -valleyValues;
% Plot them.
hold on;
plot(indexesOfValley, y(indexesOfValley), 'r^', 'LineWidth', 2, 'MarkerSize', 10);
  5 件のコメント
Image Analyst
Image Analyst 2021 年 6 月 29 日
Not sure what that means but you can create an x axis if you want with linspace. If the total length of y is 60 seconds, you can make x like
x = linspace(0, 60, length(y));
David Jones
David Jones 2021 年 6 月 30 日
Hi
I am strugling to get the display to show the 60s of data correctly, please see atached display I need to display the last graph (5) with the x axis showing the correct timimng , could you please help.
David

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpectral Measurements についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by