How can I convert the bandpass function to C code?
显示 更早的评论
Converting to Matlab Coder,
I get errors in bandpass, findpicks and smooth.
I would like to know a solution to this problem.
Or is there a function written in C code?
close all
clear all
[file,path] = uigetfile('*.txt');
ReadData=load(fullfile(path,file));
ChRaw=ReadData(:,1);
Fs=32;
t=(1/Fs):(1/Fs):TotalT;
fCh=ChRaw-ChRaw(1);
fCh1=bandpass(fCh,[0.1 1],Fs);
fCh2=bandpass(fCh,[0.5 1.5],Fs);
[pk,lc]=findpeaks(-fCh2,'MinPeakDistance',20,'MinPeakHeight',0);
RR=diff(lc)/Fs;
RR=RR(RR<2 & RR>0.5);
yy = smooth(RR,10);
HR=60./yy;
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Smoothing and Denoising 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!