signal processing - remove unwanted portion from the signal
22 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Yew Jen Chong
am 29 Mai 2022
Kommentiert: Star Strider
am 2 Jun. 2022
The signal in the red circle is the portion that I want as shown in figure below. I have many sets of data similar to the signal below that occur at different time interval. I want to remove the unwanted portion and remain the circled portion. Can anyone teach me how to do it?
Thank you so much.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1014770/image.png)
0 Kommentare
Akzeptierte Antwort
Star Strider
am 2 Jun. 2022
Try this using envelope to outline the signals, then with a threshold value to choose the desired region —
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1019175/Signal%20data.csv', 'VariableNamingRule','preserve');
VN = T1.Properties.VariableNames;
figure
plot(T1{:,1}, T1{:,[2 3]})
grid
xlabel(VN{1})
legend(VN{[2 3]}, 'Location','best')
title('Original Signal')
env1 = envelope(T1{:,[2 3]}, 150, 'peak'); % Calculate 'envelope' Of Both Signals
env1 = max(env1,[],2); % Take The Maximum Across Rows
figure
plot(T1{:,1}, T1{:,[2 3]})
hold on
plot(T1{:,1}, env1, 'LineWidth',2)
hold off
grid
xlabel(VN{1})
legend(VN{[2 3]}, 'Envelope', 'Location','best')
title('Original Signal With Envelope')
Threshold = 1.5; % Detection Threshold For 'env1'
Lv = env1 >= Threshold; % Logical Vector
figure
plot(T1{Lv,1}, T1{Lv,[2 3]})
grid
xlabel(VN{1})
legend(VN{[2 3]}, 'Location','best')
title('Edited Signal')
Change the ‘Threshold’ value to get different results.
.
2 Kommentare
Weitere Antworten (1)
Image Analyst
am 29 Mai 2022
Sure. We could help but you forgot to attach your signal, which hopefully you'll do after reading this:
In the mean time I'd recomment using movmax and getting a signal where it's less than 10 or so. Then delete those elements. Something like
% Find where signal is in a burst.
maxSignal = movmax(signal, 30);
% Determine which elements have low max value.
quietParts = maxSignal < 10;
% Delete those elements that have low value and are not in a burst.
signal(quietParts) = [];
Siehe auch
Kategorien
Mehr zu Parametric Spectral Estimation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!