Detect signal clipping and remove
조회 수: 36 (최근 30일)
이전 댓글 표시
Hi,
I have a signal from a microphone that is listening for respiratory audio. When the test subject talks or moves too much, the signal clipps. I am not interested in data that occurs when the subject is talking but I am trying to figure out how to eliminate these sections of the signal from my file. Either remove them entirely, or replace them with a mid level value.
Would anyone here have a good suggestion as to how I could execute this?
Thank you very much in advanced.
댓글 수: 0
답변 (3개)
Star Strider
2021년 7월 22일
편집: Star Strider
2021년 7월 30일
Without an example signal, I am guessing that the ‘clipped’ or ‘railed’ parts of the sound would be equal to ±1, with the valid data being within those limits, however not equal to them. One option would be to set all the values equal to ±1 as NaN, then use rmmissing to delete them, or similar functions (all introduced in R2016b) to interpolate them.
It will likely be necessary to experiment to get the result you want.
—————
EDIT — (30 Jul 2021 at 18:26)
With respect to your Comment, choose a threshold slightly less than 1, (or sllightly greater than 0, or both), assign NaN to all values exceeding than that threshold in either direction, then use rmmissing to delete them. I would need the actual data to write and test specific code.
.
댓글 수: 2
Star Strider
2021년 7월 30일
The rmmissing function was introduced in R2016b, as was fillmissing that would replace them with 0 or alternatively interpolate the missing values. We have no idea what version or rlelease you are using, since that was not posted. (I assume the latest release unless otherwise stated.)
An alternative would be to simply set the values exceeding the thresholds to 0. That would essentially remove them without disrupting the rest of the file, or the associated time vector (if one exists).
.
Image Analyst
2021년 7월 22일
Try this
clipValue = max(yourSignal); % Assume clipping occurs, or else just assign some known value, like 1.
badIndexes = yourSIgnal == clipValue;
% Set those elements to zero (won't change the time scale);
yourSignal(badIndexes) = 0;
% Or, delete those elements to zero (will change the time scale);
yourSignal(badIndexes) = [];
If you need more help, attach your signal in a .mat file with the paperclip icon along with a screenshot indicating what values you'd like to process, and whether you'd like to delete them or just set them to zero.
댓글 수: 0
Kcire L
2021년 7월 30일
댓글 수: 1
Image Analyst
2021년 7월 31일
Remember when I said "If you need more help, attach your signal in a .mat file with the paperclip icon along with a screenshot indicating what values you'd like to process, and whether you'd like to delete them or just set them to zero."?
Well you attached the screenshots, and that's good, but what can we do now? Nothing, because you forgot to attach the signal in a .mat or text file.
참고 항목
카테고리
Help Center 및 File Exchange에서 Measurements and Spatial Audio에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!