當前位置:首頁 » 編程語言 » c語言plot

c語言plot

發布時間: 2025-10-13 17:10:26

① 我想用多貝西小波對有奇異點的信號進行分析,然後提取奇異點發生的時間點信息,用C語言怎麼寫

(1)小波模極大值重構 MATLAB代碼_天天向上_新浪博客 http://blog.sina.com.cn/s/blog_6c00b0e30100u1s5.html

function
[signal,swa,swd,ddw,wpeak]=wave_peak(points,level,Lo_D,Hi_D,Lo_R,Hi_R,offset)
%
該函數用於讀取ecg信號,找到小波變換模極大序列

warning off;
ecgdata=load('ecg.txt');
%需要分析的信號,自己加
plot(ecgdata(1:points)),grid on,axis
tight,axis([1,points,-50,300]);
signal=ecgdata(1:points)'+offset;

% 信號的小波變換,按級給出概貌和細節的波形
[swa,swd] =
swt(signal,level,Lo_D,Hi_D);
figure;
subplot(level,1,1);
plot(real(signal)); grid on;axis tight;
for i=1:level
subplot(level+1,2,2*(i)+1);
plot(swa(i,:)); axis
tight;grid on;xlabel('time');
ylabel(strcat('a
',num2str(i)));
subplot(level+1,2,2*(i)+2);
plot(swd(i,:)); axis
tight;grid on;
ylabel(strcat('d ',num2str(i)));
end

%求小波變換的模極大值及其位置
ddw=zeros(size(swd));
pddw=ddw;
nddw=ddw;
posw=swd.*(swd>0);
pdw=((posw(:,1:points-1)-posw(:,2:points))<0);
pddw(:,2:points-1)=((pdw(:,1:points-2)-pdw(:,2:points-1))>0);
negw=swd.*(swd<0);
ndw=((negw(:,1:points-1)-negw(:,2:points))>0);
nddw(:,2:points-1)=((ndw(:,1:points-2)-ndw(:,2:points-1))>0);
ddw=pddw|nddw;
ddw(:,1)=1;
ddw(:,points)=1;
wpeak=ddw.*swd;
wpeak(:,1)=wpeak(:,1)+1e-10;
wpeak(:,points)=wpeak(:,points)+1e-10;

%按級給出小波變換模極大的波形
figure;
for i=1:level
subplot(level,1,i);
plot(wpeak(i,:)); axis tight;grid
on;
ylabel(strcat('j= ',num2str(i)));
end

註:運行此程序時一定要將待處理信號添加進去,程序中的紅色部分。
追問:
ecgdata=load('ecg.txt');

熱點內容
java返回this 發布:2025-10-20 08:28:16 瀏覽:710
製作腳本網站 發布:2025-10-20 08:17:34 瀏覽:972
python中的init方法 發布:2025-10-20 08:17:33 瀏覽:681
圖案密碼什麼意思 發布:2025-10-20 08:16:56 瀏覽:833
怎麼清理微信視頻緩存 發布:2025-10-20 08:12:37 瀏覽:741
c語言編譯器怎麼看執行過程 發布:2025-10-20 08:00:32 瀏覽:1081
郵箱如何填寫發信伺服器 發布:2025-10-20 07:45:27 瀏覽:312
shell腳本入門案例 發布:2025-10-20 07:44:45 瀏覽:192
怎麼上傳照片瀏覽上傳 發布:2025-10-20 07:44:03 瀏覽:879
python股票數據獲取 發布:2025-10-20 07:39:44 瀏覽:837