How can I convert the bandpass function to C code?
Show older comments
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;
Answers (0)
Categories
Find more on Multirate Signal Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!