目錄
1.算法描述
2.仿真效果預(yù)覽
3.MATLAB核心程序
4.完整MATLAB
1.算法描述
? ? ? ?峰值檢驗是示波表中數(shù)據(jù)采集方式之一, 這種技術(shù)起源于存儲深度不能滿足捕獲毛刺的需要。如果用模擬示波器去觀察, 只有當(dāng)毛刺信號是重復(fù)性的并且和主信號同步時, 才能看到毛刺信號?。由于毛刺源于其他電路系統(tǒng), 所以這些毛刺只是偶爾發(fā)生, 并且和主信號不同步。正常采樣方式時, 要捕捉窄的毛刺, 示波表必須將收集到的全部采樣數(shù)據(jù)存儲到示波表中, 對于快速掃描, 單次觸發(fā)就涉及到幾千個數(shù)據(jù), 而慢速的掃描則需要更大的存儲器。峰值檢測不像正常采樣那樣給出一個詳細的完整波形顯示, 而是以最高的采樣率捕捉信號, 簡單地忽略某些采樣, 只記錄發(fā)生在每個采樣間隔期間內(nèi)的最大最小的峰值, 這樣就不用增加存儲深度, 還可以捕捉毛刺或偶發(fā)事件。峰值檢測是數(shù)字示波表的重要技術(shù)之一, 主要用來實現(xiàn)波形的毛刺捕捉, 包絡(luò)的顯示以及限制混疊。
2.仿真效果預(yù)覽
matlab2022a仿真結(jié)果如下:
文章來源:http://www.zghlxwxcb.cn/news/detail-521464.html
3.MATLAB核心程序
......................................................................
pos=[200:50:17800]; % Positions of the peaks (Change if desired)
amp=round(10.*randn(1,length(pos))); % Amplitudes of the peaks (Change if desired)
wid=20.*ones(size(pos)); % Widths of the peaks (Change if desired)
Noise=.1; % Amount of random noise added to the signal. (Change if desired)
% A = matrix containing one of the unit-amplidude peak in each of its rows
A = zeros(length(pos),length(x));
ActualPeaks=[0 0 0 0 0];
p=1;
for k=1:length(pos)
if amp(k)>9, % Keep only those peaks above a certain amplitude
% Create a series of peaks of different x-positions
A(k,:)=exp(-((x-pos(k))./(0.6005615.*wid(k))).^2); % Gaussian peaks
ActualPeaks(p,:) = [p pos(k) amp(k) wid(k) 1.0646.*amp(k)*wid(k)];
p=p+1;
end;
end
z=amp*A; % Multiplies each row by the corresponding amplitude and adds them up
y=z+Noise.*randn(size(z)); % Adds constant random noise
figure(1);plot(x,y,'r') % Graph the signal in red
% Initial values of variable parameters
WidthPoints=mean(wid)/increment; % Average number of points in half-width of peaks
SlopeThreshold=0.5*WidthPoints^-2; % Formula for estimating value of SlopeThreshold
AmpThreshold=0.05*max(y);
SmoothWidth=round(WidthPoints); % SmoothWidth should be roughly equal the peak width (in points)
FitWidth=round(WidthPoints); % FitWidth should be roughly equal to the peak widths (in points)
% Lavel the x-axis with the parameter values
xlabel(['SlopeThresh. = ' num2str(SlopeThreshold) ' AmpThresh. = ' num2str(AmpThreshold) ' SmoothWidth = ' num2str(SmoothWidth) ' FitWidth = ' num2str(FitWidth) ])
end
A221
4.完整MATLAB
V文章來源地址http://www.zghlxwxcb.cn/news/detail-521464.html
到了這里,關(guān)于基于matlab的高精度信號峰值檢測算法的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!