How to select peak data and min data from noise in spectrum?
3 views (last 30 days)
Show older comments
Sabella Huang on 4 Jul 2022
Commented: Sabella Huang on 5 Jul 2022
I want to take upside and downside noise signal from my spectrum (the dashed line) just like on this figure. Here, I attach the figure and the excel data. Please can anyone help me with this?.
Thank you, I waiting for your humbly answers
Emmanuel J Rodriguez on 4 Jul 2022
Edited: Emmanuel J Rodriguez on 4 Jul 2022
This should do it:
%% Import data
x = xlsread('Spectrum.xlsx','Sheet1','A1:A2503');
y = xlsread('Spectrum.xlsx','Sheet1','B1:B2503');
%% Plot data
%% Find peaks and dips in the signal
[pks, pks_locs] = findpeaks(y,x); % Finds peaks and their locations
plot(pks_locs, pks, '--k') % Plots a black dashed-line connecting peaks
[dip, dip_locs] = findpeaks(-y, x); % Find dips and their locations
plot(dip_locs, -dip, '--k') % Plots a black dashed-line connecting dips
More Answers (0)
Find more on Signal Processing Toolbox 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!