How can i write code for Peck Detection for DSP by using derivative??

2 views (last 30 days)
How can I write the code to find out the peck detection for DSP by using the derivative function? I am a very beginner. So that I have faced some problems. I have tried to write but now how can I find out the plot for derivative function i.e. 1st,2nd,3rd
clc;
clear;
t=0:1/200:2;
signal=sin(5*pi*t)+cos(13*pi*t)+sin(16*pi*t);
plot(t,signal)
hold on;
for i=2:length(t)-1
if signal(i)>signal(i-1)
if signal(i)>signal(i+1)
plot(t(i),signal(i),'o')
end
end
end
diff(signal)
diff(signal, 2)

Answers (0)

Categories

Find more on Neuroimaging 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!