フィルターのクリア

i found out the peaks of a signal as well as its locations but i have not been able to plot the peaks in the signal can anyone please help

2 ビュー (過去 30 日間)
the matlab code i used was [pks,locs] = findpeaks(x1,'MINPEAKDISTANCE',40,'MINPEAKHEIGHT',0.12); now how can i show the peaks while plotting the graph

採用された回答

Wayne King
Wayne King 2013 年 3 月 6 日
Have you looked at the findpeaks reference page in the documentation, which has an example doing exactly that?
x = linspace(0,1,1024);
Pos = [0.1 0.13 0.15 0.23 0.25 0.40 ...
0.44 0.65 0.76 0.78 0.81];
Hgt = [ 4 5 3 4 5 4.2 2.1 4.3 3.1 5.1 4.2];
Wdt = [.005 .005 .006 .01 .01 .03 .01 .01 .005 .008 .005];
PeakSig = zeros(size(x));
for n =1:length(Pos)
PeakSig = ...
PeakSig + Hgt(n)./( 1 + abs((x - Pos(n))./Wdt(n))).^4;
end
% find peaks with defaults
[pks,locs] = findpeaks(PeakSig);
plot(x,PeakSig); hold on;
% offset values of peak heights for plotting
plot(x(locs),pks+0.05,'k^','markerfacecolor',[1 0 0]);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by