signal processing - remove unwanted portion from the signal
조회 수: 22 (최근 30일)
이전 댓글 표시
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
채택된 답변
Star Strider
2022년 6월 2일
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.
.
추가 답변 (1개)
Image Analyst
2022년 5월 29일
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) = [];
참고 항목
카테고리
Help Center 및 File Exchange에서 Parametric Spectral Estimation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!